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: Don't count example stories towards CSF feature stats #30561

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

shilman
Copy link
Member

@shilman shilman commented Feb 18, 2025

Closes N/A

What I did

We shouldn't count example stories since they are not for "real" components

🦋 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 80.6 MB 80.6 MB 77 B 1.11 0%
initSize 80.6 MB 80.6 MB 77 B 1.11 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 0 B 0.31 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B 0.25 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.71 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 0.27 0%
buildPreviewSize 3.34 MB 3.34 MB 0 B 0.32 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 8.9s 22.8s 13.8s 0.52 60.7%
generateTime 22.6s 19.5s -3s -70ms -0.04 -15.7%
initTime 5s 5s 40ms 1.56 0.8%
buildTime 9s 11.6s 2.6s 2.9 🔺22.3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.2s 5.1s -2s -89ms -0.49 -40.7%
devManagerResponsive 5.2s 3.7s -1s -515ms -0.7 -40.5%
devManagerHeaderVisible 1s 703ms -347ms -0.72 -49.4%
devManagerIndexVisible 1.1s 787ms -318ms -0.35 -40.4%
devStoryVisibleUncached 4.5s 2.5s -1s -988ms -2 🔰-76.9%
devStoryVisible 1.1s 788ms -375ms -0.53 -47.6%
devAutodocsVisible 1s 727ms -284ms -0.44 -39.1%
devMDXVisible 991ms 750ms -241ms -0.25 -32.1%
buildManagerHeaderVisible 1s 799ms -202ms -0.22 -25.3%
buildManagerIndexVisible 1s 814ms -196ms -0.36 -24.1%
buildStoryVisible 949ms 771ms -178ms -0.23 -23.1%
buildAutodocsVisible 840ms 959ms 119ms 0.41 12.4%
buildMDXVisible 689ms 645ms -44ms 0.04 -6.8%

Greptile Summary

Modified StoryIndexGenerator to exclude example stories from feature usage statistics, ensuring more accurate metrics by only counting stories from real components.

  • Added isExampleStoryId() check in StoryIndexGenerator.ts before adding stats to summary
  • Prevents example stories from affecting feature usage metrics in summarizeIndex.ts
  • Maintains existing functionality while filtering out non-production stories
  • Improves accuracy of telemetry data by focusing on actual component usage

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

LGTM

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

Copy link
Contributor

github-actions bot commented Feb 18, 2025

Fails
🚫

Please choose only one of these labels: ["bug","maintenance"]

Generated by 🚫 dangerJS against 7cc29a4

@shilman shilman changed the title Index: Don't count example stories towards feature usage stats Telemetry: Don't count example stories towards CSF feature stats Feb 18, 2025
Copy link

nx-cloud bot commented Feb 18, 2025

View your CI Pipeline Execution ↗ for commit 7cc29a4.

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

☁️ Nx Cloud last updated this comment at 2025-02-18 03:59:35 UTC

@shilman shilman merged commit 0673b6f into next Feb 18, 2025
57 of 59 checks passed
@shilman shilman deleted the shilman/fix-csf-example-feature-usage branch February 18, 2025 05:00
shilman added a commit that referenced this pull request Feb 18, 2025
…ature-usage

Telemetry: Don't count example stories towards CSF feature stats
(cherry picked from commit 0673b6f)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 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.

1 participant