Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tmeasday
Copy link
Member

@tmeasday tmeasday commented May 27, 2025

Be very precise about the storybook version rather than try and infer it from the user's config.

What I did

Read the version directly from our own package.json (bundled in). Also add storybookVersion to context, not metadata as it is more appropriate and isn't inferred.

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 pull request has been released as version 0.0.0-pr-31577-sha-bd24b0b9. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-31577-sha-bd24b0b9
Triggered by @shilman
Repository storybookjs/storybook
Branch tom/refactor-storybookId-in-telemetry
Commit bd24b0b9
Datetime Tue May 27 14:58:10 UTC 2025 (1748357890)
Workflow run 15278701227

To request a new release of this pull request, mention the @storybookjs/core team.

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

Greptile Summary

Refactors Storybook's version tracking in telemetry to use direct version from package.json instead of inferring it from user configurations, improving accuracy and reliability of version reporting.

  • Modified code/core/src/cli/bin/index.ts to import version directly from package.json instead of using versions.storybook
  • Updated code/core/src/telemetry/telemetry.ts to include Storybook version in global telemetry context
  • Removed storybookVersion field from code/core/src/telemetry/storybook-metadata.ts
  • Enhanced scripts/event-log-checker.ts to test storybookVersion in both boot and main events

@tmeasday tmeasday requested a review from shilman May 27, 2025 10:41
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.

4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

@nx-cloud
Copy link

nx-cloud bot commented May 27, 2025

View your CI Pipeline Execution ↗ for commit 3de59b7.

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

☁️ Nx Cloud last updated this comment at 2025-05-28 05:59:11 UTC

@tmeasday tmeasday added maintenance User-facing maintenance tasks telemetry ci:normal labels May 27, 2025
@tmeasday tmeasday changed the title Use version from our package.json for context.storybookVersion Telemetry: Use version from our package.json for context.storybookVersion May 27, 2025
@shilman shilman changed the title Telemetry: Use version from our package.json for context.storybookVersion Telemetry: Use version from our package.json for storybookVersion May 27, 2025
@shilman
Copy link
Member

shilman commented May 28, 2025

Lgtm

1 similar comment
@shilman
Copy link
Member

shilman commented May 28, 2025

Lgtm

@shilman shilman merged commit 38dfef9 into next May 28, 2025
57 checks passed
@shilman shilman deleted the tom/refactor-storybookId-in-telemetry branch May 28, 2025 10:36
@github-actions github-actions bot mentioned this pull request May 28, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal maintenance User-facing maintenance tasks telemetry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants