fix(review-evasion): bounded retry + audit visibility for every one-shot close's explanation comment#8814
Merged
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…hot close's explanation comment (#8802) All 7 close-enforcement guards posted the contributor's ONLY explanation via a swallowed, never-retried createIssueComment — a secondary-rate-limit/5xx left a permanently closed one-shot PR with zero visible reason, forever (no sweep backfills a missing explanation on a closed PR). - postCloseExplanation: three spaced attempts (0/400/1600ms — a transient window rarely spans them), still fail-safe toward the close, with a LOUD level:error residue log (close_explanation_post_failed) when exhausted so the structured-log Sentry forwarder surfaces any remaining gap. - Every guard's audit row now records explanationPosted (true / false / null = the repo opted out of the comment), so an operator can enumerate unexplained closes directly from the audit trail — the evidence that decides whether a marker-based backfill sweep is ever actually needed.
JSONbored
force-pushed
the
fix/unexplained-close-backfill
branch
from
July 26, 2026 07:33
fe1bc7b to
771d5ab
Compare
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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
Round-2 audit fix (#8802): all 7 one-shot close-enforcement guards posted the contributor's only explanation via
createIssueComment(...).catch(() => undefined)— a transient failure left a permanently closed PR with no visible reason and nothing ever backfilled it.Changes
postCloseExplanation(exported, review-evasion.ts): bounded in-handler retry — three spaced attempts (0/400/1600ms) — still fail-safe toward the close itself; exhaustion emits alevel:errorclose_explanation_post_failedlog (reaches the Sentry forwarder).explanationPosted:true/false/null(repo opted out of the comment — the five settings-gated sites hoist a tri-state so opt-out is distinguishable from delivery failure). An operator can now enumerate any unexplained close straight fromaudit_events.Test plan
npm run typecheck— cleanexplanationPosted: truein the audit metadata — 226/226 + queue-2 greenCloses #8802