fix(gate): defer the screenshot-table close on a capture-pipeline blip instead of treating it as missing evidence - #9207
Merged
Conversation
…p instead of treating it as missing evidence Visual capture failing outright (browserless down, a timeout, a GitHub hiccup fetching a token) looked identical to "capture concluded normally and found no visual evidence" -- both left visualCaptureSatisfiedSha unset, so the very next maintenance pass could close a legitimate visual PR purely because an internal service blipped. The same gap applied to a preview still building (previewPending), which already self-heals via a scheduled recapture but never suppressed the close on the pass that discovered it. visualCaptureRetryPendingSha now marks the exact head a bounded recapture retry is scheduled for -- set only while a retry chance remains (MAX_PREVIEW_POLL_ATTEMPTS), so the screenshot-table gate's close defers for exactly as long as that chance exists and never indefinitely. The deferral itself is audited (github_app.screenshot_table_close_deferred_capture_retry), not silent.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9207 +/- ##
==========================================
- Coverage 93.94% 93.94% -0.01%
==========================================
Files 821 821
Lines 81601 81614 +13
Branches 24769 24774 +5
==========================================
+ Hits 76662 76672 +10
- Misses 3556 3557 +1
- Partials 1383 1385 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This was referenced Jul 27, 2026
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
Visual capture failing outright (browserless down, a timeout, a GitHub hiccup fetching a token) looked identical to "capture concluded normally and found no visual evidence" — both left
visualCaptureSatisfiedShaunset, so the very next maintenance pass could close a legitimate visual PR purely because an internal service blipped.missing before/after screenshot tablewas the single most common close reason in the 2026-07-26 ledger, so any false-positive rate here is expensive.The same gap applied to a preview still building (
previewPending) — it already self-heals via a scheduled recapture retry, but never suppressed the close on the very pass that discovered the preview wasn't ready yet.visualCaptureRetryPendingSha(new column, migration 0190) marks the exact head SHA a bounded recapture retry is currently scheduled/in-flight for — set only while a retry chance genuinely remains (MAX_PREVIEW_POLL_ATTEMPTS), so the screenshot-table gate's close action defers for exactly as long as that chance exists and never indefinitely. Once the budget is exhausted, the marker is deliberately left unset and the gate falls through to its normal, accurate evaluation on the final attempt.github_app.screenshot_table_close_deferred_capture_retry), not silent.markPullRequestVisualCaptureSatisfied).Test plan
npx tsc --noEmit -p tsconfig.json --incremental false— cleannpm run db:migrations:check/npm run db:schema-drift:check/npm run branding-drift:check— all oknpx vitest run test/unit/queue-3.test.ts test/unit/queue-4.test.ts test/unit/queue.test.ts test/unit/queue-2.test.ts test/unit/queue-5.test.ts test/unit/queue-lifecycle-guards.test.ts test/unit/visual-capture.test.ts— 1161 passedmainafter landing (picked up orb(review): public-surface publish runs outside the per-PR mutex — duplicate gate check-runs and placeholder overwriting a real verdict #9013/fix(review): serialize public-surface publish under the per-PR actuation lock (#9013) #9181's actuation-lock change to the same function, fix(review): finalize CI-stuck silence, post a waiting placeholder, and name every silent AI-review skip #9180, fix(test,docs): resync installation-health fixtures and self-host docs with the #9169 required-events expansion #9203 — auto-merged cleanly, re-verified)Closes #9030