Skip to content

Add @rushstack/storybook-telemetry-stub package#5695

Closed
Copilot wants to merge 8 commits intomainfrom
copilot/add-storybook-telemetry-stub-package
Closed

Add @rushstack/storybook-telemetry-stub package#5695
Copilot wants to merge 8 commits intomainfrom
copilot/add-storybook-telemetry-stub-package

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

  • Rename folder from storybook/storybook-telemetry-stub to storybook/telemetry-stub and update rush.json
  • Rename src/index.ts to src/storybook-telemetry-stub.ts
  • Remove CHANGELOG.json and CHANGELOG.md
  • Update package.json: version 0.0.0, remove exports field, update directory
  • Fix sanitizeError to use generic type
  • Rewrite tests: use import * as, remove local expected-export objects, use proper casting
  • Run rush build -t repo-toolbox and update README
  • Move @storybook/telemetry from browser-approved-packages.json to nonbrowser-approved-packages.json
  • Use Object.entries in test loops instead of separate key lookup
  • Build and test the package (all 8 tests pass)
  • Run code review and CodeQL checks (no issues found)
  • Add Rush change file for @rushstack/storybook-telemetry-stub
  • Revert lockfiles to main and rerun rush update for minimal diff
  • Remove @storybook/telemetry-7 dependency, hardcode v7 exports in test
  • Rewrite README with better organization: problem, alternatives, how it works, usage
  • Add clarity that this primarily targets old out-of-support versions (6 and 7)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits March 10, 2026 22:47
…tests

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copy link
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

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

@copilot Since this is adding a new project, you will also need to update the readme:

rush build -t repo-toolbox
node repo-scripts/repo-toolbox/lib-commonjs/start.js readme

Commit the modified repo readme.

… remove CHANGELOG files

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot Since this is adding a new project, you will also need to update the readme:

rush build -t repo-toolbox...

Built repo-toolbox and updated README.md in 4e51f83.

…e Object.entries in tests

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
@dmichon-msft dmichon-msft marked this pull request as ready for review March 11, 2026 21:37
@dmichon-msft
Copy link
Contributor

@copilot needs a standard Rush change file (i.e. the one produced by rush change --no-fetch).

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot needs a standard Rush change file (i.e. the one produced by rush change --no-fetch).

Added the Rush change file in 7501910.

@dmichon-msft
Copy link
Contributor

@copilot The build is failing because the lockfiles contain a ton of unrelated version bumps. Revert the lockfiles to the version in main, then rerun rush update. We should expect to see the only changes be related to the newly added package.

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot The build is failing because the lockfiles contain a ton of unrelated version bumps. Revert the lockfiles to the version in main, then rerun rush update. We should expect to...

Reverted both lockfiles to main and reran rush update in 4150f44. The default lockfile diff is now limited to the new package's dependencies, and the build-tests lockfile has no changes.

@dmichon-msft
Copy link
Contributor

@copilot Since storybook 6 and 7 are officially out of support, go ahead and just hardcode the expected types for them instead of actually installing the corresponding @storybook/telemetry package version. Be sure to reset the lockfiles to the version from origin/main and regenerate them with rush update after removing the dependency.

…, reset lockfiles

Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 11, 2026

@copilot Since storybook 6 and 7 are officially out of support, go ahead and just hardcode the expected types for them instead of actually installing the corresponding @storybook/telem...

Removed the @storybook/telemetry-7 devDependency and hardcoded the expected v7 exports (verified against @storybook/telemetry@7.6.24) in the test. Also removed @storybook/telemetry and @storybook/telemetry-7 from approved packages, reset lockfiles to origin/main, and regenerated with rush update. The lockfile diff is now minimal (58 lines, only the new package's v8 dependency). All 8 tests pass in 46ac29c.


A stub replacement of `@storybook/telemetry` for use in environments that absolutely forbid outbound
network connections and want to ensure that Storybook doesn't probe outside of its project folder,
e.g. for discovering what kind of package manager the repository uses.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This README is important, since the usage and underlying motivations are not obvious from looking at the package itself. I think the README can be organized a bit better, along the lines of:

  1. The problem: Storybook makes network calls (why), mutates package.json (how? why?) during normal operation, etc. These are really separate behaviors, so let's call them out individually rather than rolling them into one sentence.
  2. Alternatives: Do certain versions of Storybook support environment variables or "off" switches? People from the Storybook community may claim that this stub is not needed for whatever reason, but maybe they are wrong in some edge cases. The README can provide a paragraph that we can use to track those details.
  3. How does it work: Explain stubbing.
  4. How do you use it? Briefly explain how somebody enables this in their Rush repo.

Copy link
Collaborator

@octogonz octogonz left a comment

Choose a reason for hiding this comment

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

Approved with comments

@dmichon-msft
Copy link
Contributor

@copilot Add clarity that this is really targeting old, out-of-support versions (6 and 7 mostly). Newer versions have more complete support for disabling the telemetry layer and not writing the root package.json.

@dmichon-msft
Copy link
Contributor

Abandoning this for now in favor of setting the right environment variables when invoking Storybook.

@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Mar 12, 2026
Copilot stopped work on behalf of dmichon-msft due to an error March 12, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants