fix: route the #124/#125 test files through tmp() #135
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:apply
scope:capture
scope:coolify-api
scope:fleet
scope:manifest
scope:secrets
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/cast#135
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/tmp-guard-offenders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mainis red.test/tmp-guard.test.tsfails on1acf172:Three test files from #124 and #125 allocate temp dirs with raw
mkdtempSyncinstead of the
tmp()helper. #117 introduced that helper — and the guard — tostop the suite leaking temp dirs (it had leaked 6731 across 68 opt-out sites),
so this is the habit the guard was written to catch, returning in the two
feature branches that were in flight when it landed.
Verified pre-existing rather than assumed: the failure reproduces on a clean
detached worktree of
origin/main, with none of the release work applied.The fix
All four sites go through
tmp(), which allocates under the per-run root thatglobal-setup.tsreaps wholesale:basic-auth-cli.test.ts— 3 sitesgithub-app-register-cli.test.ts— 1 sitegithub-app.test.ts— had its own privatetmp()shadowing the helperwith the raw call; the local definition is deleted and the helper imported, so
its 8 existing
tmp(...)call sites are unchanged and now allocate correctlyNow-unused
mkdtempSync/tmpdirimports removed with them.Verification
npm testnpm run check(biome)npx tsc --noEmittest/tmp-guard.test.tsWhy it is its own PR
It blocks the 0.2.0 release — a release PR on a red
mainis red on arrival —and it is unrelated to the release ceremony itself.
Verdict: Approve — I agree with this as-is.
Why
mainis red becausetmp-guardcatches rawmkdtempSyncundertest/; the three #124/#125 files are exactly the offenders.tmp()fromtest/helpers/tmp.ts(drop-in formkdtempSync(join(tmpdir(), prefix))); unusedmkdtempSync/tmpdirimports dropped.github-app.test.tsdeletes the private shadowtmp()so its existing call sites go through the real helper and land under the reaped run root.Nits / optional
…used raw mkdtempSync— cut off before “now go throughtmp()”). Fine if #136 rewrites the file; otherwise one more clause would help.@
bf0dfd8✅ Approved — I agree with all of this, no concerns.
Read all four sites in the diff: the three
mkdtempSynccalls inbasic-auth-cli.test.tsandgithub-app-register-cli.test.tsbecometmp()with prefixes preserved, and deleting the privatetmp()intest/github-app.test.tsin favour of the helper import is the best part of the fix — its 8 existing call sites flip to the reaped root with no textual churn. DeadmkdtempSync/tmpdirimports go with them, nothing else moves. Reproducing the failure on a cleanorigin/mainworktree before fixing is exactly the right discipline, and landing it separately so the 0.2.0 release PR arrives on a greenmainis correct scoping.— automated review by
claude-bot-andresmgsl· heavy-duty-review-botVerdict: I agree with everything and have no additional feedback. The shared tmp helper now owns every affected allocation, including the formerly shadowed helper, and the current head is clean with all checks passing.
@danmt — round 1 closed, all three bots approving. One non-blocking nit raised and addressed. Handing this over.
What it fixes
mainwas already red.test/tmp-guard.test.tsfails on1acf172: three test files from the just-merged #124 and #125 allocate temp dirs with rawmkdtempSyncinstead of thetmp()helper. #117 introduced that helper and its guard to stop the suite leaking temp dirs — it had leaked 6731 across 68 opt-out sites — so this is exactly the habit the guard exists to catch, returning via two branches that were in flight when it landed.Verified pre-existing rather than assumed: reproduced on a clean detached worktree of
origin/mainwith none of the release work applied.Four sites now go through
tmp(). The useful part isgithub-app.test.ts, which had its own privatetmp()shadowing the helper with the raw call — deleting the local definition flips its 8 existing call sites to the reaped run root with no textual churn.Round history
One round, three approvals, zero changes requested:
grok-bot-andresmgslclaude-bot-andresmgslcodex-bot-andresmgslThe nit, and what I did with it
grok noted the changelog entry stated the symptom but not the fix, adding "fine if #136 rewrites the file." That condition was not actually met — #136 left that line byte-identical, so the weaker wording would have shipped in 0.2.0.
Addressed in #136 rather than here, since #136 is where the shipped wording is decided and it rewrites the whole file two commits later:
Symptom and fix, and it carries the
(#135)ref the original lacked. Worth stating plainly: this PR's own entry keeps the weaker line for one merge, which is the path grok explicitly blessed.Verification
npm testnpm run check(biome)npx tsc --noEmitOrdering
Bottom of the cast stack:
#135 (this)→#136 docs/changelog→#137 release: 0.2.0. A release PR on a redmainis red on arrival, so this wants to land first.