Fix: Allow proceeding without selecting automigrations in upgrade command#32597
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds optional selection to automigration prompts, introduces and tests a new exported function promptForAutomigrations, and adjusts clack multiselect invocation to explicitly pass the required flag via an options spread. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant CLI as CLI Automigrate
participant P as Prompt (clack.multiselect)
participant L as Logger
CLI->>P: multiselect({ options..., required: false })
alt User selects automigrations
P-->>CLI: Selected items
CLI->>L: log "Running X automigrations"
CLI-->>CLI: return selected automigrations
else User selects none
P-->>CLI: []
CLI-->>CLI: return []
end
opt --yes flag
U->>CLI: --yes
CLI->>L: log "Running all automigrations"
CLI-->>CLI: return all automigrations
end
opt --dry-run
U->>CLI: --dry-run
CLI->>L: log "Dry run: no changes will be made"
CLI-->>CLI: return []
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
Comment |
|
View your CI Pipeline Execution ↗ for commit 4bc605b
☁️ Nx Cloud last updated this comment at |
…ations Co-authored-by: yannbf <1671563+yannbf@users.noreply.github.com>
Co-authored-by: yannbf <1671563+yannbf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Bug]: SB10 - Can't proceed the upgrade command without selecting at least one automigration
Fix: Allow proceeding without selecting automigrations in upgrade command
Oct 1, 2025
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 43 | 43 | 0 |
| Self size | 30.19 MB | 30.19 MB | 🎉 -291 B 🎉 |
| Dependency size | 17.31 MB | 17.36 MB | 🚨 +53 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 187 | 187 | 0 |
| Self size | 921 KB | 921 KB | 🚨 +21 B 🚨 |
| Dependency size | 79.87 MB | 79.92 MB | 🚨 +53 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 169 | 169 | 0 |
| Self size | 35 KB | 35 KB | 0 B |
| Dependency size | 76.30 MB | 76.35 MB | 🚨 +53 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 44 | 44 | 0 |
| Self size | 1.55 MB | 1.55 MB | 🚨 +30 B 🚨 |
| Dependency size | 47.50 MB | 47.55 MB | 🚨 +53 KB 🚨 |
| Bundle Size Analyzer | node | node |
yannbf
approved these changes
Oct 15, 2025
9 tasks
8 tasks
8 tasks
8 tasks
This file contains hidden or 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
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.
Problem
The Storybook upgrade command's multiselect prompt for automigrations required users to select at least one option before proceeding. This prevented users from continuing with the upgrade when they wanted to skip all automigrations, forcing them to select something even if they didn't want to run any automigrations.
As shown in the screenshot, the prompt displays "Please select at least one option" and won't let users proceed without making a selection.
Solution
This PR fixes the issue by:
Updating
ClackPromptProviderto properly pass therequiredoption to the underlyingclack.multiselectfunction. Previously, the option was defined in the interface but not being passed through to clack.Setting
required: falsein the automigration prompt call, allowing users to press Enter without selecting any options.Changes
code/core/src/node-logger/prompts/prompt-provider-clack.tscode/lib/cli-storybook/src/automigrate/multi-project.tsTesting
Added comprehensive tests to verify:
required: false--yesoption still works correctly (selects all automigrations)--dryRunoption still works correctlyAll existing and new tests pass ✅
Result
Users can now press Enter without selecting any automigrations, allowing them to:
The fix maintains backward compatibility - users can still select automigrations as before, and the
--yesflag continues to work as expected.Fixes #29640
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by CodeRabbit
New Features
Bug Fixes
Tests