Skip to content

fix(alerts): let an alert be edited while a webhook secret waits to be entered again (backport 2.1 #37269) - #37428

Merged
manerow merged 1 commit into
2.1from
fix/alert-edit-with-secret-to-reenter-2.1
Nov 9, 2026
Merged

manerow merged 1 commit into
2.1from
fix/alert-edit-with-secret-to-reenter-2.1

Conversation

@manerow

@manerow manerow commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Cherry-pick of #37269 to 2.1 (no issue; it follows up #36939 directly).

What it fixes

Since #36939, which is on 2.1, a webhook secret opens only for the destination it was written for, and a value the 2.1.0 step does not carry over is reported as "must be entered again". Entering it again failed with that same message, and so did every other edit of that alert, including switching it off. The only way out was to delete the alert and create it again. This hits people upgrading to 2.1.0, since that is when such values appear.

Saving an alert now compares and counts its stored destinations without decrypting their secrets, and only sending opens a stored secret. A value that does not open is still never sent. Full explanation in #37269.

How it was tested

  • Clean cherry-pick: git patch-id --stable matches the commit on main.
  • On this branch: all 626 alerting unit tests pass, including the new ones in DestinationValidationTest, AlertLimitsTest and DestinationSecretsTest.
  • On this branch, on MySQL and Elasticsearch: WebhookSecretOwnershipIT (with the new aValueLeftToEnterAgainStopsNoEditAndDeliversOnceEntered), WebhookSecretsMigrationIT, AlertConfigLimitsIT, BoundedTestSendsIT and ProfileWebhookSecretsIT: 21 pass.

@manerow
manerow requested a review from a team as a code owner November 9, 2026 16:45
@manerow
manerow requested review from harshach and removed request for a team November 9, 2026 16:45
@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check labels Nov 9, 2026
@gitar-bot

gitar-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Separating save-time comparison from send-time decryption lets unrecoverable-secret alerts be edited; mistakes in this flow could affect webhook delivery.

Fixes alert editing when a webhook secret must be re-entered: saving now compares stored destinations without decrypting their secrets, and only sending opens a stored secret, so other edits and switching an alert off no longer fail. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 0dc8e8e into 2.1 Nov 9, 2026
22 checks passed
@manerow
manerow deleted the fix/alert-edit-with-secret-to-reenter-2.1 branch November 9, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant