Repository navigation
ci(pr-automation): retry failed automation by comment - #2103
Benoît Cortier (CBenoit) wants to merge 5 commits into
Conversation
Allow a PR author or repository writer to request a non-forced retry only for a current exact-head classification or review failure. Bind admission to the comment, failure, head, and stage with a one-hour server-time cooldown and three accepted retries per head and stage. Ambiguous dispatch errors retain the admission to avoid duplicate model work.
There was a problem hiding this comment.
🟡 Changes recommended
Dispatch is not fully bound to admitted state, definite rejections consume retries, and the new tests are absent from CI.
3 open findings
What changed in this PR
Adds trusted comment-triggered retries for failed PR classification or review automation.
Changes:
- Adds
@github-actions retryhandling with authorization and eligibility checks. - Adds cooldown, retry limits, admission receipts, tests, and documentation.
- Dispatches ordinary non-forced automation routes.
Protocol review was not applicable because no RDP protocol behavior changed.
| File | Description |
|---|---|
.github/workflows/review-pipeline.intent.md |
Documents retry workflow integration. |
.github/workflows/pr-automation-retry.yml |
Handles trusted retry comments. |
.github/pr-automation/retry-command.test.js |
Tests retry admission behavior. |
.github/pr-automation/retry-command.js |
Implements validation, receipts, and dispatch. |
.github/PR_AUTOMATION.md |
Documents retry policy and limits. |
🧠 Review effort: Balanced
There was a problem hiding this comment.
Adds a trusted comment-triggered retry workflow for failed exact-head classification/review automation: retry-command.js validates author permission, PR/comment state, strict unambiguous check-run history, admission dedup/cooldown/cap, and a receipt-before-dispatch ordering; plus tests, workflow YAML, and docs. The admission logic is sound and fails closed on ambiguity. All three validated code-compressor findings are low-severity maintainability compressions, not defects: strictRuns duplicates automation-lease's read+canonicalize pipeline (though readCanonicalRuns is not actually exported, as the specialist claimed), the review gate re-checks completed/success already guaranteed by classValid, and snapshot contains two unfireable identity guards.
Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.
Carry the admitted head and failed check through dispatch, resolution, and lease admission so a queued retry cannot run on a different revision or failure. Run the command tests in CI alongside the existing automation suites.
Normalize workflow source line endings in the retry and review-ready script fixtures so the newly enabled Windows automation suite exercises the same embedded scripts as Linux.
There was a problem hiding this comment.
The PR adds a comment-triggered, bound retry for failed exact-head classification or review automation. Independent verification of the head confirms both valid code-compressor candidates: the !classValid term in the review-stage guard (lines 148-150) is unreachable because stage === review is derived from the same unchanged classValid at line 137, and the ISO round-trip comparison in timestamp() (lines 31-32) is dead code on the sole runtime (Node/V8 in GitHub Actions), where the strict regex plus Number.isFinite already reject everything the round trip could reject. Both are low-severity maintainability simplifications; the surrounding admission/dispatch flow (fail-closed binding revalidation, receipt-before-dispatch durability, cooldown and retry limits) is internally consistent, with no additional findings.
Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.
The review stage is reachable only after classValid succeeds, so avoid checking that prerequisite a second time.
There was a problem hiding this comment.
PR 2103 adds comment-driven retry of failed automation: a trusted issue_comment workflow validates an exact-head classification/review failure, records a durable admission check run, and dispatches the ordinary pr-automation route with a bound retry binding that resolve-pr and the lease claim revalidate fail-closed. Verified both code-compressor candidates against the head: the mock's reads counter and state.onRead hook in retry-command.test.js are never exercised by any test (onRead appears only at its invocation site; assertions use readNames or afterCreate), and the quota fixture's pulls.list restub is a behavioral no-op given the base mock's identical no-op and the paginate-iterator sentinel-identity dispatch through which fork-rate-limit consumes it. Both are low-severity, test-only compressibility findings and are published as accepted. No independent production-code defects were found.
Push a commit after addressing these findings. If no code change is needed, you may resolve inline threads and comment @github-actions review-ready to request human review.
Drop unused read callbacks and a duplicate quota mock override; keep the existing unavailable-quota assertion.


Allow a PR author or repository writer to request a non-forced retry only for a current exact-head classification or review failure.
Bind admission to the comment, failure, head, and stage with a one-hour server-time cooldown and three accepted retries per head and stage. Bound dispatch revalidates the failure before lease admission; all dispatch errors, including HTTP 422, retain the admission to avoid duplicate model work.