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

Telemetry: Disable save-from-controls logs for example stories #28870

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented Aug 13, 2024

Closes N/A

What I did

Save-from-controls telemetry from example stories are distorting usage metrics. Let's not record them at all.

Checklist for Contributors

Manual testing

In a sandbox:

STORYBOOK_TELEMETRY_DEBUG=1 yarn storybook
  1. Complete onboarding experience (or edit a Button story with SfC) and verify that no telemetry is sent
  2. Create a new story file (or just update the title) and edit a story with SfC and verify that telemetry is sent
  3. Do the above both for creating a new story as well as for editing an existing story.

Documentation

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

🦋 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>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.3 MB 76.3 MB 0 B 3.66 0%
initSize 167 MB 167 MB 498 B -0.29 0%
diffSize 91.1 MB 91.1 MB 498 B -0.33 0%
buildSize 7.42 MB 7.42 MB 0 B 0.9 0%
buildSbAddonsSize 1.61 MB 1.61 MB 0 B -0.9 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.29 MB 2.29 MB 0 B 0.9 0%
buildSbPreviewSize 351 kB 351 kB 0 B -0.9 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.45 MB 4.45 MB 0 B 0.9 0%
buildPreviewSize 2.97 MB 2.97 MB 0 B -0.9 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 19.7s 25.5s 5.8s 1.24 🔺22.7%
generateTime 19.2s 21.2s 2s 0.02 9.4%
initTime 16.3s 17.9s 1.5s 0.13 8.9%
buildTime 12s 11.7s -343ms -0.24 -2.9%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 10.4s 7.6s -2s -803ms -0.76 -36.6%
devManagerResponsive 6.4s 4.7s -1s -729ms -0.83 -36.7%
devManagerHeaderVisible 1s 765ms -243ms -0.6 -31.8%
devManagerIndexVisible 1s 790ms -264ms -0.63 -33.4%
devStoryVisibleUncached 1.2s 1.2s 44ms -0.11 3.4%
devStoryVisible 1s 800ms -276ms -0.72 -34.5%
devAutodocsVisible 870ms 744ms -126ms -0.1 -16.9%
devMDXVisible 819ms 636ms -183ms -1.4 🔰-28.8%
buildManagerHeaderVisible 917ms 733ms -184ms -0.41 -25.1%
buildManagerIndexVisible 918ms 734ms -184ms -0.44 -25.1%
buildStoryVisible 957ms 778ms -179ms -0.42 -23%
buildAutodocsVisible 805ms 654ms -151ms -0.61 -23.1%
buildMDXVisible 754ms 696ms -58ms 0.15 -8.3%

Greptile Summary

This pull request introduces a change to prevent telemetry data collection for CLI example stories in Storybook's save-story functionality.

  • Added IS_CLI_EXAMPLE regex in code/core/src/core-server/utils/save-story/save-story.ts to identify CLI example stories
  • Modified telemetry logic in initializeSaveStory function to skip data collection for CLI example stories
  • Aims to improve accuracy of usage metrics by excluding example stories from telemetry data

@shilman shilman added maintenance User-facing maintenance tasks patch:yes Bugfix & documentation PR that need to be picked to main branch telemetry labels Aug 13, 2024
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.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

code/core/src/core-server/utils/save-story/save-story.ts Outdated Show resolved Hide resolved
Copy link

nx-cloud bot commented Aug 13, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c64542e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@shilman shilman force-pushed the shilman/fix-save-from-controls-telemetry branch from 31e8701 to c64542e Compare August 13, 2024 03:54
@shilman shilman changed the title Telemetry: Disable save-from-controls telemetry for example stories Telemetry: Disable save-from-controls logging for example stories Aug 13, 2024
@shilman shilman merged commit a177fce into next Aug 13, 2024
54 checks passed
@shilman shilman deleted the shilman/fix-save-from-controls-telemetry branch August 13, 2024 04:18
@shilman shilman changed the title Telemetry: Disable save-from-controls logging for example stories Telemetry: Disable save-from-controls logs for example stories Aug 13, 2024
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Aug 16, 2024
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 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 telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants