test(#6120): delete leased pool repos after each scenario - #7398
fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
Pool base repos were reused across leases with only a first-ensure reset, so leftover labels, PRs, branches, and config could leak to the next scenario that leased the same name. DeallocateRepo now deletes the leased base (and leftover fork) after CleanupScenario and in-scenario debug collection, and invalidates the ensure cache so the next AllocateRepo recreates from a clean auto_init commit. A delete failure is logged and does not leak the slot; the next ensure still reset+recreates. Note: pre-commit run could not fetch hook repos (HTTP 403). Local hooks were executed directly (gofmt, go vet, gitleaks, lychee, lint-docs-links, lint-interface-doc-sync). Closes #6120
|
🤖 Finished Review · ✅ Success · Started 10:36 AM UTC · Completed 10:57 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $6.39 |
Site previewPreview: https://a7d6dac5-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsRe-review: Tier 1 signals unchanged from the prior assessment (bot author, no protected/security paths, no dependency or CI changes); the only delta is a small incremental fix (3 files) addressing prior review feedback on the same well-scoped, well-tested behaviour-test infrastructure change, so the moderate score of 2 is preserved. Previous runRisk Assessment: moderate (2/5) DetailsBot-authored, well-tested, moderate-sized change confined to behaviour-test infrastructure with no protected/security-sensitive paths, no CI or dependency changes; issue scope and acceptance criteria are well matched, yielding a moderate composite score. |
|
Looks good to me Previous runReviewLow
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 10:59 AM UTC · Completed 11:09 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $1.32 |
Addresses review feedback on PR #7398: - composed.go: Finalize now best-effort deletes each reclaimed (leaked) repo via ensurer.DeleteRepo before returning it to the pool, using the same log-and-continue policy as DeallocateRepo, so an unreleased lease (missed After hook, panic, cancelled context) no longer leaves the forge repo behind until the next acquire. - composed.go: newComposedDriver now rejects a nil ensurer, removing the inconsistency where DeallocateRepo guarded against it but AllocateRepo dereferenced it unconditionally. - behaviour-testing.md: corrected two stale doc claims that this PR's diff otherwise left standing - the settle step does not skip on re-vendor (doEnsure always resets/installs/settles), and STAGE test-repo-NN repos are no longer durable across runs (only the halfsend org/mint is) now that DeallocateRepo deletes them. - Added test coverage for both composed.go changes. The CI-budget finding (behaviour-testing.md's 45-minute timeout text) was verified rather than changed: this PR's own CI run shows the behaviour job completing in 13m2s, well within the existing budget, so no timeout/doc change was warranted per the review's own guidance against pre-emptively raising it. Addresses #7398
🔧 Fix agent — iteration 1 (bot-triggered)Fixed the two composed.go findings (Finalize now deletes leaked leases; newComposedDriver rejects a nil ensurer) with new test coverage, and corrected the two stale-documentation findings in behaviour-testing.md. The CI-budget finding was verified against this PR's actual CI run (13m2s, within the 45-minute budget) rather than changed, consistent with the review's own caution against pre-emptive timeout changes. Fixed (4):
Disagreed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:11 AM UTC · Completed 11:24 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.65 |
Superseded by updated review
Summary
Leased behaviour-test pool repos (
test-repo-NN) are now ephemeral around a lease:DeallocateRepodeletes the base (and any leftover fork) after scenario cleanup, and the nextAllocateReporecreates from a cleanauto_initcommit so leftover labels, PRs, branches, workflow runs, and config cannot leak across scenarios.Related Issue
Implements the pool-repo lifecycle described in the issue (delete+recreate on acquire was already in
doEnsure; this PR closes the re-lease cache gap and adds post-scenario deletion).Changes
ensurer.DeleteRepo, which invalidates the per-lease ensure cache and reusesresetRepo(source + leftover fork, deletion wait).composedDriver.DeallocateRepodeletes the leased repo afterCleanupScenario(After hook already defers deallocation until cleanup finishes; in-scenario debug collection has already written workflow logs and agent artifacts underBEHAVIOUR_ARTIFACT_DIR).behaviour-testing.mdandbehaviour-drivers.mddescribe the ephemeral lease lifecycle and the extra create+install cost on re-lease.Testing
go test -race ./pkg/behaviourtest/drivers/install/ ./pkg/behaviourtest/suite/passes.go vetpasses;DeleteRepoandDeallocateRepoare at 100% function coverage.pre-commit runcould not fetch hook repos (HTTP 403); local equivalents were run (gofmt, go vet, gitleaks, lychee, lint-docs-links, lint-interface-doc-sync).Checklist
test(#6120): ...)Closes #6120
Post-script verification
agent/6120-ephemeral-pool-repos)99894b146f1d86c39243334fdc8fdc438719e8ee..HEAD)