Skip to content

Fix: Incorrect URLS for the upgrade command#32624

Merged
yannbf merged 3 commits into
nextfrom
cli_fix_malformed_urls
Oct 6, 2025
Merged

Fix: Incorrect URLS for the upgrade command#32624
yannbf merged 3 commits into
nextfrom
cli_fix_malformed_urls

Conversation

@jonniebigodes
Copy link
Copy Markdown
Contributor

@jonniebigodes jonniebigodes commented Oct 2, 2025

Closes #32623

With this pull request, the URLS generated with the upgrade command are updated to match the correct pattern and the docs location

What I did

  • Updated the CLI & tests to remove the extra query parameter
  • Adjusted the documentation location to its correct place

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Documentation
    • Updated migration guidance link in CLI messages to point to the correct releases migration guide, improving accuracy and relevance.
  • Bug Fixes
    • Fixed duplicated query parameters in the migration guide URL displayed in upgrade and migration summary outputs.
  • Tests
    • Refreshed test expectations and inline snapshots to align with the corrected URL, ensuring consistent output verification.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 2, 2025

📝 Walkthrough

Walkthrough

Updated hardcoded Storybook migration guide URLs in CLI messages and associated tests to point to https://storybook.js.org/docs/releases/migration-guide?ref=upgrade, replacing the previous incorrect URL.

Changes

Cohort / File(s) Summary
Automigration summary URL update
code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.ts
Replaced migration guide URL string to the releases path.
Automigration summary tests update
code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts
Updated snapshots/expectations to the new migration guide URL.
Upgrade CLI output URL update
code/lib/cli-storybook/src/upgrade.ts
Updated link in upgrade results message to the releases migration guide URL.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix incorrect automigrations link in CLI output [#32623]
Fix incorrect link in upgrade completion message [#32623]
Update related tests/snapshots to reflect corrected URL [#32623]
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli_fix_malformed_urls

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 391bbc6 and 9abcb2b.

📒 Files selected for processing (3)
  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts (3 hunks)
  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.ts (1 hunks)
  • code/lib/cli-storybook/src/upgrade.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Adhere to ESLint and Prettier rules across all JS/TS source files

Files:

  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.ts
  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts
  • code/lib/cli-storybook/src/upgrade.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Fix type errors and prefer precise typings instead of using any or suppressions, consistent with strict mode

Files:

  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.ts
  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts
  • code/lib/cli-storybook/src/upgrade.ts
code/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

code/**/*.{test,spec}.{ts,tsx}: Place all test files under the code/ directory
Name test files as *.test.ts, *.test.tsx, *.spec.ts, or *.spec.tsx

Files:

  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/spy-mocking.mdc)

**/*.test.{ts,tsx,js,jsx}: Use vi.mock() with the spy: true option for all package and file mocks in Vitest tests
Place all mocks at the top of the test file before any test cases
Use vi.mocked() to type and access mocked functions
Implement mock behaviors in beforeEach blocks
Mock all required dependencies that the test subject uses
Mock implementations should be placed in beforeEach blocks
Each mock implementation should return a Promise for async functions
Mock implementations should match the expected return type of the original function
Use vi.mocked() to access and implement mock behaviors
Mock all required properties and methods that the test subject uses
Avoid direct function mocking without vi.mocked()
Avoid mock implementations outside of beforeEach blocks
Avoid mocking without the spy: true option
Avoid inline mock implementations within test cases
Avoid mocking only a subset of required dependencies
Mock at the highest level of abstraction needed
Keep mock implementations simple and focused
Use type-safe mocking with vi.mocked()
Document complex mock behaviors
Group related mocks together

Files:

  • code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Danger JS
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (3)
code/lib/cli-storybook/src/upgrade.ts (1)

266-266: LGTM! Consistent URL fix applied.

The migration guide URL has been updated consistently with the change in logMigrationSummary.ts, ensuring users see the correct documentation link after running the upgrade command.

code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.test.ts (1)

114-114: LGTM! Test expectations updated to match the source changes.

All three inline snapshots have been correctly updated to expect the new URL format (https://storybook.js.org/docs/releases/migration-guide?ref=upgrade), ensuring test coverage remains valid after the URL fix.

Also applies to: 135-135, 156-156

code/lib/cli-storybook/src/automigrate/helpers/logMigrationSummary.ts (1)

66-66: LGTM – old URL references removed. Search confirms no occurrences of migration-guide?ref=upgrade?ref=upgrade or docs/migration-guide remain in the codebase.


Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Oct 2, 2025

View your CI Pipeline Execution ↗ for commit 9daf4b8

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 49s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-03 14:12:06 UTC

@jonniebigodes jonniebigodes requested a review from yannbf October 2, 2025 16:45
@jonniebigodes jonniebigodes self-assigned this Oct 2, 2025
@yannbf yannbf merged commit 38b157d into next Oct 6, 2025
57 checks passed
@yannbf yannbf deleted the cli_fix_malformed_urls branch October 6, 2025 07:15
@github-actions github-actions Bot mentioned this pull request Oct 6, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SB10 - Incorrect link in the migration output

2 participants