feat(webhooks): Wire new service with feature-flagged routing#115747
Merged
Christinarlong merged 8 commits intoMay 19, 2026
Conversation
…routing Wire the new webhook service into the invocation path with three feature flags controlling the rollout: - legacy-webhook-new-path ON → dispatches via new service - legacy-webhook-disable-old-path ON → skips old plugin path - Both OFF (default) → old path only, no behavior change The dry-run flag is checked at the task level, so the handler always calls send_legacy_webhooks_for_project when new-path is on. Truth table: new-path OFF, disable-old OFF → old path only (default) new-path ON, disable-old OFF → both paths (dual-write) new-path ON, disable-old ON → new path only (cutover) new-path OFF, disable-old ON → guard: old path still fires Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
…routing Wire the new webhook service into the invocation path with feature flags controlling the rollout: - legacy-webhook-new-path ON → dispatches via new service - legacy-webhook-disable-old-path ON → skips old plugin path - legacy-webhook-dry-run ON → task logs instead of sending Refactors: - build_legacy_webhook_payload accepts ActionInvocation, derives group/event/triggering_rules internally - send_legacy_webhooks_for_invocation accepts ActionInvocation - Handler logic simplified: old path runs unless disable_old is on - Tests run e2e through IssueAlertRegistryHandler with plugin enabled and self.tasks() for eager task execution Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
ca332ac to
c229ff8
Compare
…bhook_payload The event from ActionInvocation.event_data is typed as GroupEvent | Activity, but Activity lacks get_tag, message, tags, and event_id attributes. Activity events are already filtered upstream in execute_via_group_type_registry, so add an isinstance check to narrow the type for mypy. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
ceorourke
approved these changes
May 18, 2026
…handler Move feature-flagged routing from WebhookIssueAlertHandler.invoke_legacy_registry up to WebhookActionHandler.execute so the new path calls send_legacy_webhooks_for_invocation directly, bypassing the NOA registry dispatch chain. The old path still falls through to execute_via_group_type_registry when not disabled.
…ent events Legacy webhooks only apply to error events. Add an isinstance check for GroupEvent at the top of execute() so non-GroupEvent events (e.g. Activity) are skipped before reaching either the new or old path.
Move the isinstance check so it only gates the new-path call, not the entire function. Non-GroupEvent events (e.g. Activity) still reach execute_via_group_type_registry which handles them in the old path.
…en available _get_triggering_rule_name now checks AlertRuleWorkflow for a linked Rule and uses Rule.label if found, matching the old path's behavior in create_rule_instance_from_action. Falls back to workflow.name otherwise.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4a1b5fd. Configure here.
Run the old path first and catch exceptions so the new path still executes during dual-write. The new path runs second and can bubble exceptions normally since nothing depends on it.
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.

Connects the dual write flags and new service together. See table below for what the NOA will do based on the flag setup.
Context
PR 3 of the legacy webhook plugin migration. Depends on PR 2 (#115688).