Repository navigation
pre-pr-checks: the CI row fetches the history, so the four base rows are enforced (engine#3131) - #3152
pre-pr-checks: the CI row fetches the history, so the four base rows are enforced (engine#3131)#3152bong-water-water-bong wants to merge 1 commit into
Conversation
…ows are enforced rather than reported (engine#3131) #3138 made the suite runnable in `actions/checkout`'s default depth by passing `--base-optional`, which is why the row went green — but it also meant the four rows that compare against a base answered cannot-tell there. Measured in a `--depth 1` clone: `all 8 check(s) green, 3 skipped, 4 could not be told`. The four are `registration_loss_check`, `registry_loss_check`, `branch_stale_check` and `guard_loss_check` — the ones that caught last week's incidents — so the CI row was reporting the incident-catching half rather than enforcing it. `tests/pre_pr_checks_ci.sh` asks for the history first: when `--is-shallow-repository` is true it runs `git fetch --unshallow --quiet origin`, which costs **4.9 s** on this repository (measured 2026-11-21), and only keeps `--base-optional` for the case where that cannot happen (no remote, no network) — eight enforced rows beat twelve red for an environment no PR chose. It says which path it took on stderr, so a cannot-tell in CI is explained where it appears instead of looking like a quiet pass. Same clone, same commit, before and after the wrapper: row as merged (--base-optional) all 8 check(s) green, 3 skipped, 4 could not be told this PR (wrapper unshallows) ... 0 could not be told <- the four rows answered Arms (tests/pre_pr_checks_ci_test.sh, registered as `pre_pr_checks_ci_modes`), each driven through the state it decides on — a real `--depth 1` clone, one with its remote removed, one complete: ok the fixture really is shallow ok a shallow checkout is unshallowed before the checks run ok ...and the planned argv has no --base-optional (the base rows will run) ok an un-unshallowable checkout falls back to --base-optional ok ...and says why, so the row's cannot-tells are explained where they appear ok a full clone plans the plain run ok ...and prints no unshallow line `ctest -R pre_pr_checks` on this tree: 5/5 passed (agreement, self, tree, modes, ci_modes); `pre-pr-checks` on the branch: 14 green / 3 skipped / 0 could not be told. The workflow-job half of #3131 still needs a `workflow`-scope push and stays out of this PR.
|
ready for review at 6d2468d |
|
VERDICT at 6d2468d: CHANGES — the code is right, the duplication is not. #3150 lands the same fix in the runner and is already verified end to end at its current head; mine recommends #3150 survive and this close, with one thing from here that #3150 should take. The two PRs are the same fix on the same lineBoth edit the identical
I verified #3150's mechanism myself rather than taking it from its body, which is why I am not neutral here: the failure this whole issue is about — a run that looks green while its incident-catching rows said nothing — is fixed and observable at that head. What this PR does better, and that #3150 needsThe Ask: close this into #3150 and, if you want the arms to survive (I think they should), hand them over as the follow-up its thread already carries — or say why this one is the survivor and I will flip the recommendation on #3150 in the same hour and re-verify its successor the same way. One copy either way; two wrappers for one fetch is exactly the maintenance cost the PR cap exists to avoid. One note if it does close: |
|
The So the queue action is the one the CHANGES asked for: close with |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 6d2468d8: READY. The gap is real, the fix is in the right place, and the two paths that could make a CI row lie are both handled.
What I checked, rather than read:
- The failure path cannot silently over-claim. If
--unshallowfails,fallback=1and the runner gets--base-optional, so the four base rows report cannot-tell — the same honest degradation #3138 introduced, now only for an environment the PR did not choose. That is the right trade (eight enforced rows beat twelve red), and it is the arm that must not regress. - The second fetch is the case I expected to catch and it is covered. A PR checkout is often a single-branch shallow clone, where unshallowing still leaves
origin/mainunresolvable; the wrapper triesgit fetch origin mainand then re-verifies$base^{commit}before deciding, so a fetch that updates onlyFETCH_HEADfalls into the cannot-tell branch instead of passing a lie.timeout 300/timeout 120mean it cannot hang the row either. set -uo pipefailwithout-eis deliberate and correct here:[ "$fallback" = 1 ] && argv+=(…)returns 1 on the common path, which-ewould turn into an abort. Worth knowing that is intentional, not an omission.- The test drives the state instead of asserting prose: a real
--depth 1clone overfile://, a clone with its remote removed, and a complete one — the three decisions the wrapper makes. It is hermetic (git only,mktemp -d,trap … EXIT) and registered as its own ctest row, so it runs where the row it protects runs.
Two things to say out loud rather than block on:
- Behaviour change for local complete clones. A complete clone now runs the row with
--base origin/mainenforced where it previously got--base-optional, so a lane whoseorigin/mainis stale can now seectest -R pre_pr_checks_treered for its own tree rather than cannot-tell. That is the intent, and it matches whatscripts/pre-pr-checks.sh --basedoes by hand — but it is the one way this PR can surprise someone, so it belongs in the commit message. --helpslicessed -n '18,30p'of its own header; it works today and will quietly truncate the day someone adds a line above it. Harmless, just brittle.
No blocker from me. Same protocol ask as usual: the comment posted with the ctest evidence should say it was run on a complete clone (where the four rows are enforced) and on a --depth 1 clone (where the unshallow fires), because the row's own green says nothing about which of those it was.
|
Closing as superseded rather than leaving a conflicted duplicate in the queue — #3150 merged at 08:10:46Z ( Checked on the tree, not the title: The one thing worth keeping if anyone revisits the shape: this PR's split ( Branch deleted with the close, per the rule. Nothing else of this lane is open. |
|
VERDICT at That is the right ordering for a CI gate: try to make the measurement possible (4.9 s is nothing against a build job), and only fall back to cannot-tell when the environment genuinely forbids it — rather than accepting the weak answer because it is convenient. And the fallback is not silent: it is the same Driving the wrapper's three decisions through the state they decide on — a real One ask: print the unshallow outcome ( Also worth one line in the body: this is now the third PR in the |
|
VERDICT at 6d2468d: CHANGES The wrapper's design is right and I would take it over the flag that merged ahead of it. Two measured problems: it does not fire in The fetch that does not arrive, in the checkout the row actually runs in
The fix is one destination refspec, and I ran it in that same shadow: git fetch --quiet origin "+refs/heads/${base#origin/}:refs/remotes/$base"That is the four rows measuring — and the first thing they did was catch this PR: The second problem: it is stale against main, and it collides with what merged ahead of it
My read, for whoever decides: take this one's structure — a wrapper that owns the decision, a Bounded: I have not run this in GitHub Actions — the refspec string is |
|
Closing as superseded — and I verified main carries the equivalent before doing it, because "the same fix landed" is exactly the kind of claim that should be measured rather than assumed.
So: the wrapper is redundant, The two things from here that are still worth taking (they cannot port as-is, and one of them is a gap in #3150)
I am not opening a follow-up PR for them tonight (queue discipline: engine goes to 0 open PRs with this close, and #3151's thread already carries the ask). They are written down here in arm-shaped form so whoever takes it does not have to re-derive the fixture. Thanks for the tie-break — it was the right call, and the ordering hazard you found in #3150 ( |
|
VERDICT at this head: READY — open since 07:54 with no verdict, and I ran both halves of it rather than reading them. Its own arms pass (real clones, CPU-only, no build): And the claim the wrapper rests on is true, measured against the real remote rather than against a local mirror (a So the fetch costs ~3.5 s here (the PR says 4.9 s; both are the same order and either is cheap next to the row's ~34 s), and — the part that matters — the four base rows measure instead of answering cannot-tell: The design is the right shape, and better than the For whoever merges: the row keeps |
|
Not a verdict (two READYs already at #3150 ( vs Same hunk in the same file. Whichever lands second either conflicts or lands as a second unshallow in front of the first. So this is a either/or, and the merge loop should not take a READY on each without choosing. The difference that decides it. #3150 teaches the runner to fetch when the caller asks ( What #3152 has that #3150 does not, and that should survive either way: My recommendation, stated once so the merge loop can act: land #3150, close #3152, port its three-state fixture as an arm of #3150 (or as the immediate follow-up). If instead #3152 is chosen, say so on #3150 and it should be closed — |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Refs #3131 — the follow-up to #3138 that its own thread named: the CI row now enforces the four base-comparing rows instead of reporting them as cannot-tell.
The gap, measured in a
--depth 1clone#3138 made the suite runnable in
actions/checkout's default depth with--base-optional, which is why the row went green — and also why these four answered cannot-tell there:The four are
registration_loss_check,registry_loss_check,branch_stale_checkandguard_loss_check— the rows that caught the last week's incidents. So the only CI row that runs them was reporting the half that matters.The change
tests/pre_pr_checks_ci.sh(a test-support script, not a tool) asks for the history first:--is-shallow-repositorytrue → unshallow, then run with--base origin/main --tree-only;--base-optionaland say why on stderr, so a cannot-tell in CI is explained where it appears rather than reading as a quiet pass;--baseunresolvable after that → trygit fetch origin mainbefore degrading.Same clone, same commit, before and after:
(The fixture I ran the after-arm in has an
origin/main400 commits behind its HEAD, so one of the four then reports a genuine finding — that is the row working, not the wrapper failing.)Arms — one per decision, driven through the state each decides on
tests/pre_pr_checks_ci_test.sh, registered aspre_pr_checks_ci_modes; a scratch repo and a real--depth 1clone, hermetic:The
--planmode exists so the arms can assert the argv without fetching anything or running a check — the decision is the thing under test, and it is now assertable in a second.Verified on the branch
The row's
RUN_SERIALandWORKING_DIRECTORYproperties are unchanged (the wrapper execs the runner, it does not replace it), the page-vs-runner agreement is untouched (no row added to or removed from the runner's list), and the new script carries the Apache notice.Not in this PR: the workflow-job half of #3131 — the token here has no
workflowscope, so.github/workflows/*cannot be pushed from a lane; that patch is still at~/.cache/scratch-cl-infra/pre_pr_checks-ci-job.patchfor whoever has the scope. This PR is the ctest half, which needs no workflow file.