Skip to content

CLI: Fix Storybook doctor compatibility checks #32077

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

Merged
merged 1 commit into from
Jul 21, 2025
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Jul 18, 2025

Closes storybookjs/addon-svelte-csf#322

What I did

This PR ignores the compatibility checks for two scenarios:

  • Storybook canaries (e.g. 0.0.0 version)
  • consolidated Storybook packages that are 0.x (essentially the @storybook/csf package)

This makes the compatibility check more accurate, as it actually is supposed to check against same major version packages e.g. 8 vs 9 and never 0 vs X

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>

Greptile Summary

This PR modifies the Storybook doctor's compatibility checking logic to be more accurate by ignoring two specific scenarios:

  1. Storybook canary versions (0.0.0)
  2. Consolidated packages with 0.x versions (specifically @storybook/csf)

The change helps prevent false positive compatibility warnings by focusing the checks on meaningful version mismatches (like v8 vs v9) rather than development or canary versions where version compatibility is less relevant. This is achieved through two main code changes:

  • Adding a check to skip compatibility checks for packages with 0.x versions
  • Adding an early return when dealing with Storybook canary versions (0.0.0)

This change makes the compatibility checker more reliable and reduces noise from false positives that don't represent real compatibility issues.

Confidence score: 5/5

  1. This PR is very safe to merge as it only reduces false positive warnings without affecting core functionality
  2. The changes are small, focused, and the logic is clear and well-documented
  3. Key files to review:
    • code/lib/cli-storybook/src/doctor/getIncompatibleStorybookPackages.ts

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@yannbf yannbf self-assigned this Jul 18, 2025
@yannbf yannbf added bug cli patch:yes Bugfix & documentation PR that need to be picked to main branch ci:normal labels Jul 18, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing changes made in this pull request

Copy link

nx-cloud bot commented Jul 18, 2025

View your CI Pipeline Execution ↗ for commit ea3843a

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

☁️ Nx Cloud last updated this comment at 2025-07-18 16:29:20 UTC

@yannbf yannbf merged commit 2510bf8 into next Jul 21, 2025
56 of 59 checks passed
@yannbf yannbf deleted the yann/fix-doctor-reports branch July 21, 2025 08:39
yannbf added a commit that referenced this pull request Jul 22, 2025
CLI: Fix Storybook doctor compatibility checks
(cherry picked from commit 2510bf8)
@github-actions github-actions bot mentioned this pull request Jul 22, 2025
8 tasks
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 22, 2025
@yannbf yannbf added the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 25, 2025
@ghengeveld ghengeveld removed the needs qa Indicates that this needs manual QA during the upcoming minor/major release label Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:normal cli patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange dependency compatibility warning after upgrading to [email protected]
3 participants