-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(node): Add build-time opt-out for runtime channel injection #23475
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,4 +68,18 @@ describe('diagnostics-channel injection', () => { | |
| expect(registerDiagnosticsChannelInjection).toHaveBeenCalledTimes(1); | ||
| expect(detectOrchestrionSetup).toHaveBeenCalledTimes(1); | ||
| }); | ||
|
|
||
| it('does not register the injection hooks when the `__SENTRY_CHANNEL_INJECTION__` build flag is false', () => { | ||
| // Simulates the bundler plugins' `bundleSizeOptimizations.excludeChannelInjection` text-replacing the flag. | ||
| vi.stubGlobal('__SENTRY_CHANNEL_INJECTION__', false); | ||
|
|
||
| try { | ||
| init({ dsn: PUBLIC_DSN, tracesSampleRate: 1, enableOpenTelemetrySetup: false }); | ||
|
|
||
| expect(registerDiagnosticsChannelInjection).not.toHaveBeenCalled(); | ||
| expect(detectOrchestrionSetup).not.toHaveBeenCalled(); | ||
| } finally { | ||
| vi.unstubAllGlobals(); | ||
| } | ||
| }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feat PR missing integration testsMedium Severity This Additional Locations (2)Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit 68993db. Configure here. |
||
| }); | ||


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.
Missing integration test for feat
Medium Severity
Flagging per the testing conventions in the PR review guidelines: this
featonly adds a unit test that stubs__SENTRY_CHANNEL_INJECTION__. There is no integration or E2E coverage forbundleSizeOptimizations.excludeChannelInjectionwiring the define through the bundler plugins. The existingbundle-size-optimizationsfixtures underdev-packages/bundler-plugin-integration-testsalready exercise the other flags and were not extended for this one.Additional Locations (1)
packages/bundler-plugins/src/core/build-plugin-manager.ts#L337-L340Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 1d27eb4. Configure here.