-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Telemetry: Fix prompting without checking isTTY #31781
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: Fix prompting without checking isTTY #31781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile
Most modules check both process.env.CI as well as process.env.stdout.isTTY before prompting the user. Telemetry was only checking process.env.CI. This caused builds in non interactive environments to fail with a success code. This commit aligns the check with the rest of storybook. Also fix a typo from SIGINIT to SIGINT Signed-off-by: Alice Khoudli <[email protected]>
dc7559a to
9e15711
Compare
This comment made it sound like it was already done, but it was not. I've now added the typo fix as requested though. |
|
Thanks for fixing this! LGTM. |
shilman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the fix. Much appreciated! 🙏
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 531 | 531 | 0 |
| Self size | 902 KB | 217 KB | 🎉 -686 KB 🎉 |
| Dependency size | 58.92 MB | 58.92 MB | 🎉 -172 B 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 131 | 131 | 0 |
| Self size | 3.07 MB | 2.39 MB | 🎉 -685 KB 🎉 |
| Dependency size | 22.30 MB | 22.30 MB | 🎉 -500 B 🎉 |
| Bundle Size Analyzer | Link | Link |
…s-tty Telemetry: Fix prompting without checking isTTY (cherry picked from commit 588b3b1)
What I did
Most modules check both process.env.CI as well as process.env.stdout.isTTY before prompting the user. Telemetry was only checking process.env.CI.
This caused builds in non interactive environments to fail with a success code.
This commit aligns the check with the rest of storybook.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam 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>Greptile Summary
Fixes telemetry prompting behavior by adding a process.stdout.isTTY check, preventing silent build failures in non-interactive environments like Docker containers without CI=true set.
code/core/src/core-server/withTelemetry.tsto align with other Storybook modules