Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
force-pushed
the
review-gate-reconcile
branch
2 times, most recently
from
August 12, 2026 08:25
2a881c6 to
8d3b20c
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
The approval event is one-shot: if review-clear's run dies, the gate stays pending forever and only a human noticing recovers it. During the 2026-08-06 GitHub Actions incident the workflow failed in 'Set up job' (Failed to resolve action download info: Service Unavailable) before any script ran, and #4750 sat blocked on an approval it already had. Add a 15-minute clear-only sweep to review-clear.yml, sharing the exact same clearOne() as the event path so recovery can never drift from the live path. It considers an open PR unresolved when the needs:code-review label is present OR the review-required status is pending, and clears only when an entitled ENGOWNER has approved -- it can remove a gate an approval already satisfied, never create one, so it is safe unattended. Also add workflow_dispatch for an immediate sweep, and document that a human cannot hand-clear this gate: branch protection requires the review-required context from the GitHub Actions app, so a status posted with a personal token greens the rollup without satisfying the requirement.
cixzhang
force-pushed
the
review-gate-reconcile
branch
from
August 12, 2026 15:55
8d3b20c to
4d14de4
Compare
This branch was successfully deployed
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.
The failure
PR #4750 was approved by an entitled code owner at 16:11Z and still sat
BLOCKEDan hour later. The approval firedreview-clear.ymlas designed — andthat run died in "Set up job":
It never reached a line of script. GitHub Actions was in a major incident.
Another PR (#4752) hit the same flake ten minutes later, got a retry on the
download, and cleared normally — so the clear logic is fine. The bug is that
the approval event is one-shot: nothing re-fires it, nothing alerts, and the
gate stays pending indefinitely. Any transient failure has this shape — a
dropped webhook, a cancelled run, a job that times out in the queue.
Worth knowing, because it makes manual recovery a trap: branch protection
requires the
review-requiredcontext from the GitHub Actions app(
app_id15368). Posting that status with a personal token turns the PR'srollup green while the merge stays blocked, because the bot's
pendingis whatthe requirement actually reads. Only a workflow run can truly clear this gate,
so the recovery path has to be automated.
Changes
review-clear.ymlgains a 15-minute clear-only sweep (schedule), plus aworkflow_dispatchfor an immediate one.clearOne()— theexisting body is refactored into a function and the event path is unchanged,
so recovery can't drift from the live path.
needs:code-reviewlabel is present orthe
review-requiredstatus is pending — a half-applied recovery leaves onewithout the other.
REVIEW_GATE.mddocuments the sweep and the app-id trap.Why this is safe to run unattended: the sweep only ever removes a gate an
entitled
ENGOWNERalready approved away. It cannot create one, cannot lower agate nobody approved, and still fails closed when the owner list is
empty/unset — the same reasoning that already lets the event path skip risk
detection. A fully-cleared PR is not touched, so there's no 15-minute status
churn.
Test plan
The script is embedded in YAML, so I exercised it the way
actions/github-scriptdoes — compiled the body with
AsyncFunctionand ran it against a stubbedOctokit recording every write. 12/12 assertions pass:
head_branchENGOWNERSempty/unsetAlso:
python3 -c "yaml.safe_load(...)"parses the workflow, andpnpm check:changesetspasses (CI-only change ships no package, so nochangeset).
Happy to hand over the harness if it's worth landing as a real test — I left it
out rather than add a YAML-string-eval test to CI unprompted.
One thing I noticed but did not touch
REVIEW_GATE.mdsays the gate is backed by "+ 1 required approving review(native)", but live branch protection has
required_approving_review_count: 0—review-requiredis carrying the whole gate on its own. That may well bedeliberate; flagging it rather than changing it.