Repository navigation
fix(land): gate counts required workflows - #679
Conversation
Quest-Claim: 4101d7d991624651
The gate refused any base with a ruleset workflows rule. It now upholds it: each job of a required workflow counts as required on a PR's head, and a required workflow nothing reports keeps the PR waiting, as quest status and quest wait count it. quest wait --help and the README now promise only the workflow runs wait actually reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iled jobs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
ℹ️ No critical issues — one gap in the replacement-run match, inline.
Reviewed changes
Reviewed the full PR: the gate now upholds ruleset workflows rules instead of refusing them.
- Gate enforces required workflows —
checks()takes the sharedNeeds. It ejects a PR when any job of a required workflow fails, naming the failed jobs. It holds the PR while the workflow has no jobs, a job is pending, a job's check suite is unfinished, or a matching replacement run is unfinished. - Queue build commit unchanged —
requiredCheckspassesworkflows: [], because the build commit is not a PR head. checkSuite.statusqueried —CONTEXTSnow asks for the suite's status, so a passed job whose run is still going stays pending.- Docs narrowed — the
quest waithelp and README now promise only whatwaitreads, and the land section notes the extra run-finish wait. - Test forge and coverage — check runs can name a workflow and a running suite, the forge serves
GET /repositories/:id, and a new test covers the cases Ran, Never ran, Other workflow, Failed, Going and Replaced.
claude-opus-5-5 | 𝕏
A run's REST repository and path name where it runs, not its workflow file, so a cross-repository required workflow never matched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orkflow repositories Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found. The replacement-run gap from the last review is closed cleanly.
Reviewed changes
Reviewed the commits since 2b33653: the new replacement-run match, the refusal for unreadable workflow repositories, and the wording updates.
- Replacement runs matched by
workflow_id:checks()now collects the check suite IDs of every reported job of a required workflow from the raw contexts (all), which still include the dropped cancelled job. It maps those suites to their runs'workflow_ids and holds the PR while any unfinished run shares one. This no longer depends on RESTpathorrepository, so cross-repository required workflows are covered. An unrelated pending run does not stall the gate. - Unreadable workflow repositories refused:
resolveQueuenow throws when a required workflow key uses therepository <id>fallback. That restores a loud refusal, where before the PR would wait forever. A new test covers it. - "check or workflow" wording: the stall comment, the own queue's check summary, the ejection detail and the
Waiting.pendingdoc now name workflows too. The tests were updated to match. - Docs: the
checks()docstring and the README land section now describe the narrower "run, or a run of the same workflow replacing a cancelled one" wait. - Replaced fixture: the run's
pathnow uses another repository's@refform, so the test shows that path is no longer part of the match.
claude-opus-5-5 | 𝕏

Finishes
quest/m0/gate-required-workflows.md.Summary
resolveQueueinsrc/cli/land.ts) used to refuse any base with a rulesetworkflowsrule. It now upholds that rule.checks()takes the sharedNeedsfromrequiredOf, the same inputquest statusandquest waitread. Every job in a required workflow counts as required. If any job failed, the PR is ejected withfailed_checks, which names the workflow and its failed jobs. The PR waits if any job is pending, the workflow has no reports on the head yet, a job's check suite has not completed, or a replacing run (read after a cancelled check) has not finished.requiredChecks, used byland-queue.ts) still checks only required checks. That commit is not a PR head, and a ruleset runs its required workflows only on PRs, so requiring them there would leave the build waiting forever.waitonly sees an unfinished run when a cancelled check makes it read runs): I narrowedquest wait --helpand the README so they promise only whatwaitactually reads. I did not fetch runs on every poll.repository/pathname where it runs, not its workflow file, so a cross-repository required workflow never matched. A replacing run now counts for a required workflow when it is unfinished and shares aworkflow_idwith a run whose check suite reported one of that workflow's jobs.quest statusreads only jobs by GraphQLfile.repositoryName/path, which is correct for cross-repo workflows;quest waittreats any unfinished run as busy; neither has the gap.GET /repositories/:id.Choices made without asking
quest waitneed Actions read access, plus one extra request per poll. It would only add coverage for a run that has no jobs yet, such as one awaiting approval. Required checks and workflows that nothing reports already keepchecks:passedheld.Public API
Validation
counts every job of a required workflow, and waits on one nothing reports: a passing job lands, a head with no run waits, a job from another workflow file waits, and a failing job is ejected. The refusal test now uses anupdaterule in place ofworkflows.just checkandjust testpass.Models
Implementer: Claude Code, claude-opus-5-5, low effort (iterate, S)
Follow-ups
None.
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 0c7f7a0, named in full once no reviewer reports a finding
Base: origin/main at 2a80c90
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1d2cb-1e1f-7760-9500-00c17989efaf, round 4Score: 10/10,
The incremental changes correctly identify replacement runs by workflow ID, reject unreadable workflow repositories, and clarify workflow reporting, with no new issues found by code inspection.Rounds: 4; findings 1 (high 1): fixed 1, refuted 0, open 0
Findings: none
Reviewer: opencode, opencode-go/deepseek-v4.1-flash, high effort
Session:
ses_e2d17fec1ffeW4gsjZan5nXw2E, round 2Score: 9/10,
All four earlier findings are fixed and verified in the head; only a dead JSDoc reference remains, which does not block landing.Rounds: 4; findings 9 (high 1, medium 2, low 6): fixed 8, refuted 0, open 1
Findings, open until the next round settles them:
src/cli/land.ts:169:JSDoc links workflowKey, which land.ts does not importThe last round's findings, at f8bda11:
src/cli/land.ts:543:Any unfinished run on the commit holds every required workflow, even unrelated ones;`checks()` now derives `replaced` from the workflow ids of runs whose `check_suite_id` reported one of that workflow's jobs and only holds on an unfinished run sharing one of those ids (`src/cli/land.ts:543-557`), so an unrelated waiting deploy run with a different workflow id no longer stalls the required workflow, while the dropped cancelled job's suite still matches its replacement.src/cli/land.ts:219:A workflow rule whose repository the App cannot read becomes an indefinite wait instead of the old refusal;`resolveQueue` now throws "requires workflows from repositories the gate cannot read" when any required workflow key has the `repository <id>` fallback (`src/cli/land.ts:350-356`), restoring a loud refusal instead of an endless wait, and the new test at `test/land.test.ts:1200` covers it.src/cli/land.ts:518:The required-workflow docs say it waits for "its run" but the code waits for any unfinished run;The `checks()` docstring (`src/cli/land.ts:524-528`) and land README (`README.md:774-775`) now say a required workflow waits for its run, or a run of the same workflow replacing a cancelled one, which matches the narrowed matching.src/cli/land-serve.ts:339:Workflow keys are rendered as "the required check" in comments and queue checks;The stall comment (`src/cli/land-serve.ts:339`), the own queue's check summary (`src/cli/land-queue.ts:724`), the ejection detail (`src/cli/land.ts:454`), and the `Waiting.pending` doc all now say "required check or workflow" / "required checks or workflows", so workflow keys are no longer presented as checks.Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1d2cb-1e1f-7ef2-902e-f98317cc6a3aRounds: 1; findings 0: fixed 0, refuted 0, open 0
Settled at 0120e43: opencode low
src/cli/land.ts:169fixed (the doc spells outowner/name:path).