fix(notifier): migrate Sentry Event.Extra to Contexts for sentry-go v0.46#33
fix(notifier): migrate Sentry Event.Extra to Contexts for sentry-go v0.46#33
Conversation
…0.46
sentry-go v0.46 removed Event.Extra. Move the extra map to
event.Contexts["extra"] (Context is a map[string]interface{} alias,
so the payload structure is preserved) and bump the dependency to
v0.46.2.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR updates the Sentry Go client library from v0.43.0 to v0.46.2 and adapts the notifier to store extra data in ChangesSentry Event Extra Data Migration
Possibly Related PRs
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Pull request overview
Updates the Sentry notifier integration to remain compatible with github.com/getsentry/sentry-go v0.46+, which removed sentry.Event.Extra, by moving the “extra” payload into Event.Contexts.
Changes:
- Migrate Sentry “extra” data from
Event.ExtratoEvent.Contexts["extra"], only setting it when non-empty. - Update Sentry-related tests to assert against
Contexts["extra"]instead ofExtra. - Bump
github.com/getsentry/sentry-godependency to v0.46.2 (and refreshgo.sum).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| notifier/notifier.go | Moves extra payload onto event.Contexts["extra"] for sentry-go v0.46 compatibility. |
| notifier/notifier_sentry_test.go | Updates assertions to validate extra data via event.Contexts["extra"]. |
| go.mod | Bumps github.com/getsentry/sentry-go to v0.46.2. |
| go.sum | Updates checksums for the sentry-go version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Initialize event.Contexts lazily and assign the "extra" key, instead of replacing the whole map, so future contexts added before this point aren't clobbered.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
sentry-gov0.46 removedEvent.Extra. Downstream consumers that pull v0.46+ transitively fail to compile againsterrors v0.2.15withunknown field Extra in struct literal of type sentry.Event.event.Contexts["extra"](sentry.Contextis amap[string]interface{}alias, so the shape is preserved) and only set it when non-empty.github.com/getsentry/sentry-gofrom v0.43.0 to v0.46.2.Test plan
go build ./...go test -race ./...make lint(golangci-lint + govulncheck)Summary by CodeRabbit