-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Create Plugin updates as migrations #1479
Open
jackw
wants to merge
2
commits into
main
Choose a base branch
from
updates-as-migrations-pt1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
leventebalogh
force-pushed
the
updates-as-migrations-pt1
branch
from
January 27, 2025 10:55
6b6203b
to
a0b402b
Compare
leventebalogh
added
minor
Increment the minor version when merged
release
Create a release when this pr is merged
labels
Jan 27, 2025
mckn
reviewed
Jan 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this! Looks really great 🙌🏻 I have some thoughts follow up questions.
- Have you considered having two functions as part of the migration script. One that does the migration and another one that checks if the migration is applicable. Then in the migration manager we could check if a migration is applicable prior to running it. Benefit would be so that you can skip a migration e.g. if the current plugin doesn't have/use that part of the scaffolded plugin.
- Instead of having the version could we just have an array of migrations? Then they will automatically be ordered and you can use the function that checks if a migration is applicable to check version compatibility.
- What is the thoughts regarding applying changes to the create-plugin. Are we planning on using migrations to change the create-plugin project as well?
content: `(This check is necessary to make sure that the updates are easy to revert and don't mess with any changes you currently have. | ||
if (!(await isGitDirectoryClean()) && !argv.force) { | ||
printRedBox({ | ||
title: 'Please clean your repository working tree before updating.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition to this feature!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR introduces the building blocks to allow developers to write migrations, focused on a specific update task, which are run sequentially via the
create-plugin
update command. This is hidden behind a flag--experimental-updates
which should allow us to iterate further on this without impacting current usage.See epic for more info and design doc for even more more info.
Read more about how to add migrations in the CONTRIBUTION guide →
Which issue(s) this PR fixes:
Related #1254
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
npm install @grafana/create-plugin@5.14.0-canary.1479.4200106.0 # or yarn add @grafana/create-plugin@5.14.0-canary.1479.4200106.0