Skip to content

fix(land): gate counts required workflows - #679

Merged
kixelated merged 7 commits into
mainfrom
quest/m0/gate-required-workflows
Nov 13, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m0/gate-required-workflows

Conversation

@kixelated

@kixelated kixelated commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/gate-required-workflows.md.

Summary

  • The gate (resolveQueue in src/cli/land.ts) used to refuse any base with a ruleset workflows rule. It now upholds that rule. checks() takes the shared Needs from requiredOf, the same input quest status and quest wait read. Every job in a required workflow counts as required. If any job failed, the PR is ejected with failed_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.
  • The queue's own build commit (requiredChecks, used by land-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.
  • CodeRabbit's out-of-diff finding on fix(checks): ignore checks from superseded workflow runs #674 (wait only sees an unfinished run when a cancelled check makes it read runs): I narrowed quest wait --help and the README so they promise only what wait actually reads. I did not fetch runs on every poll.
  • Replacement runs (Pullfrog r4559239138): a run's REST repository/path name 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 a workflow_id with a run whose check suite reported one of that workflow's jobs. quest status reads only jobs by GraphQL file.repositoryName/path, which is correct for cross-repo workflows; quest wait treats any unfinished run as busy; neither has the gap.
  • A workflows rule naming a repository the token cannot read is refused at planning, not left waiting forever. Stall comments, queue checks and ejections say "check or workflow".
  • Test forge: check runs can name their workflow file, and it serves GET /repositories/:id.

Choices made without asking

  • Narrowed the docs instead of fetching runs on every poll. Fetching every poll would make every quest wait need 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 keep checks:passed held.
  • Required workflows are not asked of the queue build commit, for the reason above.

Public API

  • Behavior: the gate now accepts bases whose rulesets require workflows, and enforces those workflows on each PR head. No breaking changes.

Validation

  • New test (cases "Going" and "Replaced" added after review round 1) 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 an update rule in place of workflows.
  • just check and just test pass.

Models

  • Claude Opus 5.5: implementation
    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 review after 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 4

  • Score: 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 2

  • Score: 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:

    • Low, src/cli/land.ts:169: JSDoc links workflowKey, which land.ts does not import
  • The last round's findings, at f8bda11:

    • Fixed: medium, 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.
    • Fixed: medium, 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.
    • Fixed: low, 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.
    • Fixed: low, 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-f98317cc6a3a

  • Rounds: 1; findings 0: fixed 0, refuted 0, open 0

  • Settled at 0120e43: opencode low src/cli/land.ts:169 fixed (the doc spells out owner/name:path).

kixelated and others added 2 commits November 12, 2026 18:37
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>
@kixelated kixelated changed the title Gate counts required workflows fix(land): gate counts required workflows Nov 13, 2026
kixelated and others added 2 commits November 12, 2026 19:06
…iled jobs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 13, 2026 03:11
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 444cc475-1f9f-4e86-b764-deaf6275fca6
Commits

Reviewing files that changed from the base of the PR and between 6fa6610 and 0120e43.

Files selected for processing: 8

  • README.md
  • quest/m0/gate-required-workflows.md
  • src/cli/land-queue.ts
  • src/cli/land-serve.ts
  • src/cli/land.ts
  • src/cli/main.ts
  • test/github.ts
  • test/land.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 shared Needs. 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 — requiredChecks passes workflows: [], because the build commit is not a PR head.
  • checkSuite.status queried — CONTEXTS now asks for the suite's status, so a passed job whose run is still going stays pending.
  • Docs narrowed — the quest wait help and README now promise only what wait reads, 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread src/cli/land.ts Resolved
kixelated and others added 3 commits November 12, 2026 19:16
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>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 REST path or repository, so cross-repository required workflows are covered. An unrelated pending run does not stall the gate.
  • Unreadable workflow repositories refused: resolveQueue now throws when a required workflow key uses the repository <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.pending doc 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 path now uses another repository's @ref form, so the test shows that path is no longer part of the match.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 58a733e Nov 13, 2026
19 checks passed
@kixelated
kixelated deleted the quest/m0/gate-required-workflows branch November 13, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant