Repository navigation
fix(sentry): stop reporting user-module esbuild failures from workflows - #926
Conversation
Inline workflow runs rethrow caller bundler errors (Build failed with … virtual:.__kody_root__/…), and Cloudflare workflow instrumentation opens Sentry issues that look like platform bugs. MCP execute already treats these as sandbox errors; filter the same signature in beforeSend.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughSentry event handling now suppresses user-module esbuild bundling failures alongside retryable D1 lock contention. The combined filter is wired into ChangesSentry filtering
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-926.kody-a99.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/worker/src/sentry-options.node.test.ts (1)
29-67: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the
event.messagecandidate path.The helper now matches both top-level
event.messageandexception.values[*].value, but this test only supplies the latter. Add a case with the full signature inmessageand no exception payload.Suggested test
+ const userModuleMessageFailure = { + message: + 'Build failed with 1 error:\nvirtual:.__kody_root__/entry.ts:11:49: ERROR: Unexpected "^"', + } + expect(filterSentryEvent(userModuleMessageFailure)).toBeNull()🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/worker/src/sentry-options.node.test.ts` around lines 29 - 67, The test should also cover the top-level event.message path handled by filterUserModuleBundlerFailureSentryEvent and filterSentryEvent. Add a user-module esbuild failure case whose complete signature is in message and that has no exception payload, then assert both filters return null while preserving the existing exception.values cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/worker/src/sentry-options.node.test.ts`:
- Around line 29-67: The test should also cover the top-level event.message path
handled by filterUserModuleBundlerFailureSentryEvent and filterSentryEvent. Add
a user-module esbuild failure case whose complete signature is in message and
that has no exception payload, then assert both filters return null while
preserving the existing exception.values cases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a4ec8ffe-86a3-417f-9872-b8ab6673842f
📒 Files selected for processing (2)
packages/worker/src/sentry-options.node.test.tspackages/worker/src/sentry-options.ts
CodeRabbit noted sentryEventMessages also reads event.message; assert that shape is dropped without an exception payload.
Summary
Fixes KODY-CLOUDFLARE-1X (
Error: Build failed with 1 error:/failureErrorWithLog).An inline Cloudflare Workflow ran caller-supplied code with a broken regex:
esbuild failed with
Unexpected "^"undervirtual:.__kody_root__/entry.ts. The workflow correctly marked the run aserroredand rethrew;Sentry.instrumentWorkflowWithSentrythen opened a Sentry issue that looks like a platform bug.MCP
executealready catches the same bundler failures and reports them as sandbox/caller errors (not Sentry). This PR adds a narrowbeforeSendfilter for the shared signature (Build failed with+.__kody_root__/) so workflow auto-capture matches that policy. Unrelated build failures without the user-module path still report.Test plan
sentry-options.node.test.tsasserts the user-module bundler signature is dropped, platform-path build failures and unrelated errors are kept, and the combined filter still drops D1 lock noisenpm run validategreenSystem recap — composes existing primitives (low risk)
Mode: recap · Base:
main@569128cb· Head:b1acae8eClassification: composes — narrow Sentry
beforeSendfilter only; no primitive contracts or workflow execution behavior changed.Primitives touched
sentry-options.tsSystem map
Inline workflow bundler failures still fail the workflow run; Sentry no longer opens a platform issue for the same caller mistake.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context.
Change flow
Summary by CodeRabbit