Skip to content
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: Add upgrade telemetry details #20064

Merged
merged 3 commits into from
Dec 3, 2022
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Dec 2, 2022

Issue: N/A

What I did

Add extra metadata to the upgrade event:

  • Before version
  • After version
  • All of the automigrations that ran & their statuses

How to test

In the project of your choice, where sb is the locally-built version:

STORYBOOK_TELEMETRY_DEBUG=true sb upgrade --prerelease

@shilman shilman added maintenance User-facing maintenance tasks cli labels Dec 2, 2022
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

Looks great! One question that might improve it.

Comment on lines +31 to +37
// Note that this probably doesn't work in PNPM mode
export const getStorybookCoreVersion = async () => {
const coreVersions = await Promise.all(
['@storybook/core-common', '@storybook/core-server'].map(getActualPackageVersion)
);
return coreVersions.find((v) => v.version)?.version;
};
Copy link
Member

Choose a reason for hiding this comment

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

Can we reuse the code we use to check all SB versions are in sync for this (i.e. check all direct dependencies that are from the monorepo) rather than just trying a couple of packages that won't work in pnpm?

Copy link
Member Author

Choose a reason for hiding this comment

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

That code needs a lot of work. I'll leave this for now, but we should definitely invest in making this area more robust.

@shilman shilman merged commit d45c0d9 into next Dec 3, 2022
@shilman shilman deleted the shilman/add-upgrade-telemetry-details branch December 3, 2022 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants