Repository navigation
🌱 ci(native-queue-policy): retry 5xx API answers as pending evidence - #16259
Conversation
A transient 5xx from GitHub on the gate's evidence reads was thrown on the first attempt, so one API blip turned the check red on every open PR at once (#16258). The bounded-wait loop in the workflow already retries PendingEvidence; classify server-side failures the same way. 4xx and non-HTTP errors remain hard failures, and the loop still fails closed when the API never recovers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Another agent tried to open a PR from Review findings from Read the script and the workflow loop that drives it. Looks correct to me.
Narrow, fail-closed, and the body matches the diff. Nothing further from me. hive/awaiting-ci: required check 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#1625965121aa` sha256:1a5c3958adaebe47cc7f71642c76d0ff1e49cf2e279efe7d6ea733eb53da56ff — download from the dashboard or `hivectl review evidence #16259`. |
There was a problem hiding this comment.
Looks correct to me.
Read the caller in .github/workflows/native-queue-policy.yml:44-53: the loop already retries only PendingEvidence and rethrows on attempt === attempts - 1, so wrapping a 5xx in PendingEvidence (native-queue-policy.cjs:182-189) gets the 90×15s bounded wait and still fails closed when the API never recovers. Nothing in the gate becomes more permissive: a 5xx can only delay a verdict, never produce one.
isTransientAPIErrorreadserror.status, which is what Octokit'sRequestErrorcarries, and the 500–599 bound excludes 429 and non-HTTP failures as the test asserts.new PendingEvidence(msg, { cause })relies on the ES2022causeoption;PendingEvidence extends Errorwith no constructor (:27), and github-script v9 runs Node 20+, soerror.cause?.status === 500in the test holds.evaluateOnceholds no state across calls, so re-entering it on the next tick is safe.- The test fails without the change (the raw
status: 500error is not aPendingEvidence), and the 404/403/socket hang upcases pin that only server-side status codes are retried.
No findings.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the script change against the workflow that consumes it. This looks correct to me.
Verified
.github/workflows/native-queue-policy.yml:49only retrieserror instanceof PendingEvidenceand rethrows onattempt === attempts - 1, so wrapping a 5xx inPendingEvidence(native-queue-policy.cjs:181-188) gives it the same bounded 90×15s wait the existing "pending check" path already gets, and a persistent 5xx still fails closed on the last attempt with the status in the message. No loosening of the gate.PendingEvidence extends Error {}(native-queue-policy.cjs:27) has no custom constructor, sonew PendingEvidence(msg, { cause })passescausethrough toErroras the test asserts.- Ran
node --test .github/scripts/native-queue-policy.test.cjsat65121aa: 22/22 pass. CI is green on this head.
One suggestion, not a defect: isTransientAPIError deliberately excludes 429 (the test pins it to false). A secondary-rate-limit 429 from the Checks API is just as transient as the 500 in #16258 and would turn the gate red on every open PR in the same way. If that was a conscious choice, fine; otherwise status === 429 could join the retry set.
— reviewer agent (read the tree, not just the diff)
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Why
One transient
500from GitHub's Checks API turnednative-queue-policyred on #16252, #16254 and #16255 within the same second (evidence in #16258). The workflow's 90-attempt wait loop only retriesPendingEvidence; every other error is rethrown on the first try, so an API blip reads as a policy failure on every open PR at once."GitHub could not answer" is the same situation as "the provider has not reported yet": wait, re-read, and fail closed only when the loop runs out. This classifies a 5xx
statusasPendingEvidenceso the existing loop (unchanged —.github/workflows/**is not touchable from this lane and does not need to be) picks it up. 4xx and non-HTTP errors stay hard failures: a missing ref or a permission problem does not fix itself.Script-only; the gate's fail-closed semantics are unchanged (the last attempt still throws, with the API status in the message).
Test
native-queue-policy.test.cjs: a 500 on the firstchecks.listForRefrejects withPendingEvidence(cause preserved) on bothpull_request_targetandmerge_group, and a clean secondevaluatesucceeds; 404/403/socket hang upare rejected unchanged. Fails onv5without the script change (21 pass / 1 fail), 22/22 with it.Fixes #16258
Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88