Repository navigation
Skip the second Free Tests run when a PR lands onto a moved main (GST-3303) - #4655
Merged
Merged
Conversation
When land merges a PR onto a main that moved past it, land.merged_ci has already run Free Tests on the merged tree. Main's push run now reuses the newest dispatch run on gstack-land/<n> when it verifies with the pushed tree as its tested tree, and runs the suite otherwise. Also updates the QUEUE_LAND_MERGED_CHECKS row in the crew Captain guide for the tamper hold and the red merged_ci run. (GST-3303) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
A re-run of an older green land run restarts it, so ordering by start time could put it ahead of a later red run on the same tree. Run ids grow with creation, so the latest land attempt always wins. (GST-3303) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the land tool merges a PR whose base moved, it has already run Free Tests on the exact merged tree. Main's push run now reuses that run instead of running the whole suite again, and still runs it whenever main moved again before the merge or the newest land run wasn't green.
This also fixes the outdated
QUEUE_LAND_MERGED_CHECKSrow in the maintainers' land guide. Nothing to do: the next stale-base land showsREUSE: accepted run …on main's push run.How it decides, and why it's safe
scripts/ci-tree-reuse.ts find(main-push path): when the merged PR's head tree differs from the pushed tree, the only candidate is the newestworkflow_dispatchrun offree-tests.ymlongstack-land/<n>. It's reused only whenverifyRunaccepts it underci-reuse/free-testsand itstested-treerecord names the pushed tree.pull_requestrun, another branch, or a profile without dispatch all fall back to the full suite.landBranch()inlib/run-evidence.tsis now the one source of thegstack-land/<n>name for land and for reuse.docs/pregate.md#ci-reuse,docs/ship-policy.md#land-direct, thefree-tests.ymlheader, and theQUEUE_LAND_MERGED_CHECKSrow in the land guide (the hold-and-inspect case for files the checks changed, and the redmerged_cirun).Not verified live
No
gstack-land/*run exists yet. Two GitHub reads are untested against a deleted scratch branch: listing runs by?branch=gstack-land/<n>and reading the scratch commit's tree. If either fails, the reuse job refuses and the push run tests the tree itself, as today.Agent notes
Plan: exempt: audited-list
Tests:
test/ci-tree-reuse.test.tsadds 4 cases for the land path; each one breaks with the script change reverted. Focused files ci-tree-reuse, land-merged-ci, ci-reuse-workflow-wiring and run-evidence are green; typecheck and typecheck:test clean.Fix since round 1 (fa089ab → 3347d52): the land candidate is now the newest run by run id, not start time, so a re-run of an older land run can't outrank a later red one (one new assertion in
test/ci-tree-reuse.test.ts, one sentence indocs/pregate.md). Found by a second-model read of the decision trail; this head got the PR's round 2 of 2, a fresh full review.REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=5 fixed=0 scope=frozen dispatches=4
Gate edits: none detected (5 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Pre-Landing Review: No issues found. Review plan: gate class, full depth, round 2 of 2 on 3347d52 (batched specialist for testing, security and state machines; red team; adversarial; second-model review on openai/gpt-6.1-sol); no blockers, no fix round.
Review notes (below the blocking floor, not fixed in this PR):
scripts/ci-tree-reuse.ts:227integration: the branch-filtered run lookup after land deletesgstack-land/<n>is proven only with fakes; if GitHub stopped listing a deleted branch's runs, reuse never fires and the suite runs as before.scripts/ci-tree-reuse.ts:77consistency:windows-free-tests.yml's main push also takes the land path and refuses with a reason that suggests a land run should exist; same outcome as before plus one API call.scripts/ci-tree-reuse.ts:82ordering (adversarial): if the newest land run's own first attempt was red and a person re-runs it to green and then merges by hand past land's red-run refusal, main's push reuses the green attempt; it is green on the exact pushed tree, so nothing fails or leaks.scripts/ci-tree-reuse.ts:82consistency (adversarial): the land path orders by run id and the head path by start time; deliberate and documented.scripts/ci-tree-reuse.ts:76summary: the adversarial reader's preamble (the tree binding in verifyRun holds), recorded as a note.Coverage: 10 of 10 changed code paths have a test (Phase 2 audit map; the Step 7 coverage reader was not rerun in round 2).
Exploratory QA: smoke only,
bun test test/ci-tree-reuse.test.tsgreen, including the newest-by-id case; no required plan checks.Documentation: current (docs/, crew/docs/, README.md, AGENTS.md, CONTRIBUTING.md, ARCHITECTURE.md audited; no edits).
Tests ran: test 1735 (files, carried from CI run 44973881857/1)