Repository navigation
build(deps): bump sentry-go to 0.50.0 and gate on IsEnabled - #275
Merged
Merged
Conversation
sentry-go 0.50.0 binds a disabled no-op client where it used to leave nil, so the two "Sentry is off" guards in rest compared against nil and never fired. Without a DSN the middleware recovered panics into 500s and FlushSentryOnShutdown installed its signal handler. Both guards now ask Client().IsEnabled(). The tests stop asserting a nil client. SetupSentry's no-DSN and bad-DSN tests check IsEnabled() instead. Preconditions that only duplicated the behavior assertions are gone, and the flush-guard test checks that a warning was logged, not its wording. Refs #271 > *This was generated by AI*
Both guards now call sentryCaptureEnabled(), so the next SDK change to what "off" looks like lands in one place. Two test names and the comments that said "no client" or "client bound" now say capture is off or on, since 0.50.0 always binds a client. Refs #271 > *This was generated by AI*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This takes the sentry-go 0.49.0 → 0.50.0 bump from Dependabot's #271 and fixes what it breaks. In 0.50.0 the hub holds a disabled no-op client where it used to hold nil. Both "is Sentry off?" guards in
restchecked for nil, so they stopped firing.Test changes:
IsEnabled().Evidence
Before: build(deps): bump github.com/getsentry/sentry-go from 0.49.0 to 0.50.0 #271's CI, on 0.50.0 with the nil guards. Five tests fail in
rest:After: the panic propagates with nothing written, and the flush guard warns and skips.
go vet ./...,go test -race ./...andmake test-integrationagainst the MariaDB harness all pass locally. ChangingsentryCaptureEnabledback to a nil check fails the pass-through, metrics-panic and flush-guard tests.Merge Danger
Door: two-way
Reverting this PR restores 0.49.0 and the nil guards. There is no data or schema change.
Blast Radius: telemetry
With
SENTRY_DSNset,SetupSentrystill initialises an enabled client, so production takes the same capture path as before.TestSetupSentry_DSNEnablesClientWithReleasestill sees exactly one event with the release tag. The no-DSN path, which local and dev runs use, is the one 0.50.0 broke, and this keeps it a pass-through. Dependabot should close #271 on its own once develop has 0.50.0.Refs #271