Repository navigation
fix(bin): ignore the no-mistakes mirror when teardown checks for landed work - #7820
Conversation
|
The only non-green check, Behavior portable serial 1, was cancelled by the runner (30m limit) in the shard that holds the known flaky tests/fm-supervision-host.test.sh; unrelated to this change. |
|
Speaking as Kun's firstmate: thanks @trillium, nice and narrow. What I checked (head How I'm classing it: a restore. Teardown already promises to refuse work that hasn't landed, and the mirror isn't a forge, so this puts the existing default refusal back in force. This addresses the teardown half of #7776; that issue also points at CI: 18/19 green. |
[Medium impact] The PR appears safe to merge. Reviews (3) · Last reviewed commit: "test: assert the mirror-only teardown re..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thanks @trillium. The head is still The reopen also brought a first Greptile review at 4/5. This repo's Greptile check only passes at 5/5, and its one point is fair: Waiting on you: please add that assertion and re-raise through |
d419084 to
895abcb
Compare
|
Speaking as Kun's firstmate: thank you @trillium, that's exactly the fix I asked for. What I checked (head One small thing from you (this is waiting on you): please re-raise once more through On the |
… in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed.
895abcb to
0058aea
Compare
|
I did not re-raise this branch. The dedicated I confirmed the PR is still at |
|
Speaking as Kun's firstmate: thank you @trillium, and thanks for being careful with that proof clone. No further re-raise is needed: head I've added the |
|
Speaking as Kun's firstmate: this is merged. Thank you @trillium. Teardown's landed-work check now ignores the no-mistakes mirror refs, so a worker isn't held back by its own pipeline mirror. Really appreciate you taking the time on this. |
…ed work (kunchenguid#7820) * fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed. * no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks * test: assert the mirror-only teardown refusal retains the task state
…ed work (kunchenguid#7820) * fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed. * no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks * test: assert the mirror-only teardown refusal retains the task state (cherry picked from commit ed1eb1d)
…ed work (kunchenguid#7820) * fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed. * no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks * test: assert the mirror-only teardown refusal retains the task state
…ed work (kunchenguid#7820) * fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed. * no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks * test: assert the mirror-only teardown refusal retains the task state
…ed work (kunchenguid#7820) * fix(teardown): refuse open-PR ships and ignore the no-mistakes mirror in the landed test Teardown deletes the record that merge recording depends on, so an ordinary ship whose recorded pr= is still open is refused (--force bypasses). The unpushed-commit checks also exclude the local no-mistakes mirror remote, which is not a forge, so work that only reached the mirror is no longer counted as landed. * no-mistakes(review): Exclude no-mistakes mirror from teardown unpushed checks * test: assert the mirror-only teardown refusal retains the task state
Intent
"main firstmate is down, please handle comments on kun chen firstmate PRs" (captain, 2026-10-29). This run is the existing kunchenguid/firstmate PR #7820 (teardown ignores the no-mistakes mirror): address the review comment on it. In tests/fm-teardown.test.sh, test_no_mistakes_mirror_only_branch_refuses must capture the task worktree HEAD before run_teardown and call assert_refusal_retained_task_state after the refusal, so the test proves the refusal kept the isolated copy, task branch, and task record. Nothing wider than that one comment.
What Changed
bin/fm-teardown.shleaves outno-mistakes/*remote-tracking refs (via--exclude='no-mistakes/*' --remotes) when it looks for unpushed commits, both invalidate_worktree_teardown_safetyandunpushed_patches_are_in_pr_head. A branch pushed only to the local no-mistakes mirror now counts as unlanded, so teardown refuses it. The header comment now says the mirror is not a forge.test_no_mistakes_mirror_only_branch_refusestotests/fm-teardown.test.sh. The test pushes a task branch only to a localno-mistakesbare mirror and captures the worktree HEAD before running teardown. It then checks that teardown exits 1 with aREFUSEDline, and callsassert_refusal_retained_task_stateto confirm the refusal kept the isolated copy, task branch and task record.Risk Assessment
✅ Low: The change does what the review comment asked: the mirror-only refusal test now records the worktree HEAD before teardown and calls the existing assert_refusal_retained_task_state helper (signature: case_dir, label, head). The
--exclude='no-mistakes/*' --remoteschange is applied at both sites in bin/fm-teardown.sh that compute unpushed commits (lines 1691 and 2129), and the teardown script has no other remote-reachability check.Testing
Ran the mirror-only teardown test and its two no-mistakes neighbours against the real fm-teardown CLI on throwaway git fixtures, and all passed. As adversarial checks, the new assertion failed with the right message for each of three teardowns that refuse but then delete the task record, remove the worktree, or move the branch. Against the pre-fix teardown script the test also fails (exit 0 instead of the expected refusal). This is a CLI-only change with no UI, so there are no screenshots; CLI transcripts are the evidence. No Herdr or tmux lab was needed because the refusal happens before any pane or session work. All temporary files were removed and the worktree is clean.
Evidence: Target test passes against the real teardown
Source: Target test passes against the real teardown
Evidence: New assertion catches teardowns that refuse but destroy task state
Source: New assertion catches teardowns that refuse but destroy task state
meta destroyed -> not ok - nm-mirror-only: refusal erased the durable task record wt removed -> not ok - nm-mirror-only: refusal removed the isolated copy branch reset -> not ok - nm-mirror-only: refusal moved the task branch off the unlanded commitEvidence: Test fails against the pre-fix teardown
Source: Test fails against the pre-fix teardown
not ok - nm-mirror-only: teardown should refuse mirror-only work: expected exit 1, got 0Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/.focused-mirror.sh(temporary copy of the test file's helpers that calls only test_no_mistakes_truly_unpushed_refuses, test_no_mistakes_mirror_only_branch_refuses, and test_no_mistakes_origin_remote_allows) against the real bin/fm-teardown.shThree throwaway wrapper scripts set as TEARDOWN; each calls the real bin/fm-teardown.sh and, after it refuses, deletes the task meta, removes the worktree, or resets the branch to HEAD~1The pre-fix bin/fm-teardown.sh from b83dc59e set as TEARDOWN, to confirm the test catches the original bugDeleted the temporary runner, the base-script copy and the wrapper directory;git status --shortis clean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.