Repository navigation
fix(alerts): let an alert be edited while a webhook secret waits to be entered again (backport 2.1 #37269) - #37428
Merged
Conversation
…e entered again (backport 2.1 #37269)
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. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
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.
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
git patch-id --stablematches the commit onmain.DestinationValidationTest,AlertLimitsTestandDestinationSecretsTest.WebhookSecretOwnershipIT(with the newaValueLeftToEnterAgainStopsNoEditAndDeliversOnceEntered),WebhookSecretsMigrationIT,AlertConfigLimitsIT,BoundedTestSendsITandProfileWebhookSecretsIT: 21 pass.