-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
CLI: Instruct the correct auto-migration command #26515
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d708857
fix https://github.com/storybookjs/storybook/issues/26478
ndelangen ac79433
update npx storybook command references
yannbf 7116c05
fix
ndelangen 1c1bb37
Merge branch 'next' into norbert/fix-mention-next-in-cli
ndelangen 6884b4c
Merge branch 'next' into norbert/fix-mention-next-in-cli
ndelangen a2582ba
Remove unused import in doctor/index.ts
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
If someone runs
npx storybook@next upgrade
and after the upgrade someone wants to rerun the automigrations, shouldn't we just tell the users to callnpx storybook automigrate
to run the local version? This makes the most sense to me. Because people might run a specific version of an upgrade likenpx [email protected] upgrade
and then the above commands again do not fit, because the user wants to run theautomigrate
command from 8.1.0 and not fromlatest
ornext
(If 8.1.0 doesn't matchlatest
ornext
).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.
I don't think that that's a great idea, we should optimize for the common cases.
Before this PR, the suggested command to run was always with
@next
, this seems important to fix ASAP?True, but it's not super common to happen?
There's possibly even more edge cases?
The code is also an exact copy of how we already this the exact thing somewhere else already:
storybook/code/lib/cli/src/doctor/index.ts
Lines 144 to 146 in d52adbb
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.
If a user runs a command to upgrade Storybook and it fails to upgrade, then if we tell them to run
npx storybook <command>
that will use the non-upgraded version, a version we might not want, right?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.
@yannbf I might be mistaken, but the migration summary isn't shown when the
upgrade
fails. It should only tell the user that theautomigrate
CLI can be re-executed when automigrations are skipped, but the upgrade itself was successful. Otherwise, only running theautomigrate
command when theupgrade
fails doesn't make much sense. You don't know whether the correct dependencies are already installed or in which phase the upgrade failed.@ndelangen, Can you elaborate on your concerns about why it isn't a good idea? I am not convinced by the arguments yet. The argument that things traditionally were already done in a specific fashion doesn't tell anything about the quality of an idea or why it is good or bad.
We explicitly worked on the idea to enable people to upgrade to specific versions of Storybook. So, we have already identified this use case as pretty important, and we want to acknowledge it and not treat it as an edge-case.
If
next
is 8.4 and someone upgrades to8.3
vianpx [email protected] upgrade
it is a terrible idea to run automigrations from8.4.0
. I understand @yannbf argument, that 8.4 might have automigration improvement/fixes, which8.3.0
doesn't have, on the other hand, the automigration scripts are versioned, and therefore they are coupled with the rest of Storybook's ecosystem in a particular point in time, opening the door for terrible bugs. Second, if Storybook 9 is published, and people upgrade from 7 to 8, should they runnpx storybook@next automigrate
ornpx storybook@latest automigrate
, which both point to a Storybook 9 version? I don't think that's what we want.