Skip the second Free Tests run when a PR lands onto a moved main (GST-3303) (#4655)

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_CHECKS` row in the
maintainers' land guide. Nothing to do: the next stale-base land shows
`REUSE: accepted run …` on main's push run.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-22 02:33:20 +00:00
1 parent 6e90fa3d31
commit 7abc1949e1
9 files changed
+91 -15

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@
import { git, type QueueFailure } from '../crew/lib/ship-queue-gate';
import { repoSlug } from '../crew/lib/ship-queue-train-github';
import { MIN_POLL_MS, pollDelayMs, syncLimitEnv } from './gh-poll';
import { ghRunDeps, runProfileErrors, verifyRun, type ApiRun, type RunProfile } from './run-evidence';
import { ghRunDeps, landBranch, runProfileErrors, verifyRun, type ApiRun, type RunProfile } from './run-evidence';
import type { QueueContext } from './ship-queue';
export const CI_TIMEOUT_MS = 45 * 60_000;
@@ -33,7 +33,7 @@ export type CiResult = { ok: true; line: string } | { ok: false; red: boolean; d
/** One dispatch of `ci.workflow` on the merged commit and its verdict; red when the run itself failed, else land could not run or prove it. */
export function runMergedCi(deps: CiDeps, o: { pr: string; commit: string; tree: string; ci: MergedCi; timeoutMs?: number }): CiResult {
const branch = `gstack-land/${o.pr}`;
const branch = landBranch(o.pr);
const pushed = deps.push(o.commit, branch);
if (pushed) return { ok: false, red: false, detail: `cannot push the merged commit ${o.commit.slice(0, 12)} to ${branch}: ${pushed}` };
try {
+2
View File
@@ -105,6 +105,8 @@ const PROFILE_KEYS = ['workflow', 'events', 'jobs', 'artifact', 'max_age_hours',
const WORKFLOW_FILE = /^[A-Za-z0-9_.-]+\.ya?ml$/;
const NAME = /^[A-Za-z0-9_.\/-]{1,128}$/;
export const DEFAULT_MAX_AGE_HOURS = 24;
/** The scratch branch land.merged_ci runs CI on (lib/land-merged-ci.ts), whose run a main push of that land may reuse (scripts/ci-tree-reuse.ts). */
export const landBranch = (pr: number | string): string => `gstack-land/${pr}`;
const MAX_ARTIFACT_BYTES = 8 * 1024 * 1024;
/** Same-named artifacts one run may hold, one per attempt of the job that uploads it. */
const MAX_ARTIFACT_ATTEMPTS = 10;