feat(webhooks): Add live-run flag to override circuit breaker dry-run#114820
Draft
Christinarlong wants to merge 1 commit intomasterfrom
Draft
feat(webhooks): Add live-run flag to override circuit breaker dry-run#114820Christinarlong wants to merge 1 commit intomasterfrom
Christinarlong wants to merge 1 commit intomasterfrom
Conversation
…r dry-run Adds a new `organizations:sentry-app-webhook-circuit-breaker-live-run` feature flag that, when enabled for an app owner's org, overrides the global dry-run option to enable real webhook blocking and email notifications. This allows gradual rollout of circuit breaker enforcement per app-owner org while keeping dry-run observability for the rest of the population. The live-run state is computed once in `send_and_save_webhook_request` and threaded into both `_circuit_breaker_allows_request` (block path) and `_notify_webhook_disabled` (email path) to keep behavior consistent. Refs ISWF-2549 Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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
Adds a new
organizations:sentry-app-webhook-circuit-breaker-live-runFlagPole flag that, when enabled for an app owner's org, overrides the globaldry-runoption to enable real webhook blocking and email notifications. This allows gradual rollout of circuit breaker enforcement per app-owner org while keeping dry-run observability for the rest of the population.temporary.py(FLAGPOLE,api_expose=False)_circuit_breaker_allows_requestnow checks the live-run flag viaowner_context— if dry-run is on but live-run is enabled for the owner org, it blocks instead of emittingwould_block_notify_webhook_disableddoes the same check — if live-run is enabled, it sends the real email instead of loggingwould_email_notify_webhook_disabledis split so dry-run and live-run paths each guard their own dedup independently, preventing a dry-run dedup from suppressing the first real email after a flip to live-runNo FlagPole config change ships with this PR — rollout happens via
sentry-options-automatorafter merge.Refs ISWF-2549
Test plan
WebhookCircuitBreakerLiveRunTesttest class with 5 new tests:test_live_run_flag_overrides_dry_run_and_blocks— dry-run=True + live-run flag → blockstest_live_run_flag_off_with_dry_run_still_emits_metric— regression guard for dry-run pathtest_live_run_flag_sends_email_even_when_dry_run_option_true— live-run flag → real emailtest_live_run_flag_off_with_dry_run_still_logs_would_email— regression guard for email pathtest_dedup_does_not_suppress_first_email_after_flip_to_live_run— dedup ordering fixprek run -qpasses locally