Repository navigation
fix(status): judge landing and checks as they are now - #413
Conversation
Quest-Claim: c39d63ef3bcbf9a5
quest status dropped no landing-stopped line once the PR was queued again, and counted a cancelled run beside a newer passing rerun of the same check as failing. A merge-queue entry or auto-merge enabled at or after the latest exit now clears it, and status, wait, and the land gate count only each check run's newest report per name and app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Main split the check-run half of this quest into quest/m0/latest-check-runs.md (#422). Keep that quest, delete status-landing.md, which this PR completes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Complete quest/m0/latest-check-runs.md, which main split from this PR's quest in #422, and delete it. - Move the latest-run filter to src/github/checks.ts, shared by the CLI and the Worker, and key commit statuses by context and newest createdAt. - quest status derives its checks state from the latest runs instead of the rollup state, which counts superseded runs. - The Worker's job context lists only the latest runs, with a state derived from them. - Regression tests shaped after moq-dev/moq#7325 for status, wait, the land gate, and the Worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Design change: this PR now also completes quest/m0/latest-check-runs.md. moq-dev/quest#422 merged after this PR's last review and split its check-run half into that quest, with a fuller plan. This PR already implemented most of that plan, so it follows the newer plan here instead of leaving a partial overlap:
The review session restarted with (Written by Claude Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
quest land watch: the merge queue removed this pull request at 1e29db7 because it conflicts with The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs. (written by quest land watch) |
Completes quest/m0/status-landing.md and quest/m0/latest-check-runs.md, deleting both along with their links in the m0 README.
Summary
landing-stoppedclears once the PR is queued again.summarizeinsrc/cli/status.tsstill picks the latest merge-queue removal, auto-merge disable, orquest landejection from the timeline. It now drops that event when auto-merge'senabledAtor the merge-queue entry'senqueuedAtis at or after it. The comparison is>=becausequest merge --land(enqueueinsrc/cli/land.ts) disables auto-merge and enables it again, usually within the same second.src/github/checks.tsis shared by the CLI and the Worker:latestContextskeeps one report per check, in rollup order. A check run is keyed by app (checkSuite.app.databaseId) and name, and the highestdatabaseIdwins. A commit status is keyed by context, and the newestcreatedAtwins; on a tie, the one listed later. A check run and a status with the same name stay separate.contextOutcomeandchecksStateclassify those reports.quest statuscounts and lists only the latest runs. Itschecksstate is now derived from them (failure, elsepending, elsesuccess) instead of the rollup'sstate, which counts superseded runs.quest waitignores superseded runs, so they never wake it aschecks:failed.quest landgate checks only the latest runs. This reverses the "a rerun counts only once every report passes" rule from moq-dev/quest#229. A name from more than one app, or as both a run and a status, still needs every report to pass.readTargetincloudflare/src/github/service.ts) lists only the latest runs, with a state derived the same way.databaseIdandcheckSuite { app { databaseId } }on check runs, andcreatedAton statuses.README.md,cloudflare/README.md, and thequest status --helptext describe both behaviours.Decisions
Choices made without asking
latest-check-runs.md, with a fuller plan. This PR had already implemented most of that plan, so the merge oforigin/mainbrought it up to the plan rather than leave the two overlapping: the shared helper insrc/github/, deduplicating statuses, deriving thechecksstate, and the Worker. That also covers this PR's earlierreadTargetfollow-up. It is recorded in this comment.databaseId. GitHub numbers check runs as it creates them. This is simpler thanstartedAt, which is null while a run is queued.gh pr checks' key (name, workflow, event) was rejected, since its list can disagree with mergeability.cloudflare/dev/github.tsnow numbers check runs in the order they are listed (oldest first).Tests
test/checks.test.ts, new:Scopeand a failedRelease gate, superseded by passing runs, judge asSUCCESS.createdAt, the later one on a tie.test/status.test.ts:checks success passed=2although the rollup saysFAILURE.test/wait.test.ts: a cancelled required run superseded by a rerun, and the #7325 shape, never wake the wait aschecks:failed; each reportschecks:passedonce the newer run passes.test/land.test.ts: a passing rerun and the #7325 shape keep the PR queued; a newer cancelled run, or a failure from another app, ejects it.cloudflare/test/publish.test.ts: the job context lists only the latest runs, keeps another app's failure, and derives its state from them.just check,just test(1005 CLI and 506 Worker tests), andquest check --base origin/mainpass locally on1e29db7d, which mergesorigin/mainatd7ef15ec.Review
mechanical fix by quest land watch:
merged main at 66ab4fb2e492b162cd64c90f5f56b46fa3ca62c7 with the quest merge driver(head c050772)gpt-6.1-sol, medium effort), viaquest review --base origin/main(session01a19f5f, started with--newafter the design change).1e29db7d66417febf4e7345b0d939ccd8a032e94: no findings. That head mergesorigin/main(d7ef15ec). The merge hand-resolved import conflicts insrc/cli/wait.tsandcloudflare/src/github/service.ts. Its added and removed lines match9f9e217e's against the new base, but the merge needed a hand resolution, so the new head got its own review round.9f9e217ehad one finding:CheckRun.databaseIdis a 32-bit GraphQLInt, so it could be null for modern IDs, and the comparison would then keep the first run. Refuted.125683011259.databaseIdis not deprecated, andCheckRunhas nofullDatabaseId.9f9e217e, with that response: no findings.1ea6dcf5(missing query fields, fixed in3741b977) and round 2 on3741b977, with no findings.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)