Repository navigation
test: reuse immutable worktree containment history - #133197
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:56 AM ET / 08:56 UTC. ClawSweeper reviewWhat this changesThe PR creates each immutable Git fixture history once and copies it into independently mutable repositories for every worktree-containment test case. Merge readiness✅ Ready for maintainer review Keep open. This is a coherent maintainer-owned, test-only performance refactor; source review found no introduced correctness or isolation defect, and it remains awaiting normal exact-head CI completion. Priority: P3 Review scores
Verification
How this fits togetherThe worktree-containment suite creates disposable Git repositories and invokes the pull-request worktree scripts against them. Each copied case then performs its own remote setup, fetches, branch changes, and worktree operations before assertions inspect containment and recovery behavior. flowchart LR
A[Immutable Git history template] --> B[Independent case repository]
B --> C[Case-specific origin and fetch]
C --> D[Worktree and review scripts]
D --> E[Containment and recovery assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +22. Total +22 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the single immutable-template pattern and merge once exact-head CI confirms the unchanged containment scenarios remain green. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR changes internal test-fixture construction rather than addressing a user-reported runtime failure. Is this the best way to solve the issue? Yes. Caching only the immutable pre-remote history and copying it before mutable Git state exists preserves the test's per-case ownership boundary more directly than sharing a repository or reusing worktrees. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 27ce8773c3ae. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer review complete for The repeated full-file measurements show a modest 2.43-second mean execution reduction with all 38 cases retained. Independent copies preserve the real per-case origin, fetch, sibling history, worktree mutations and cleanup. No production, assertion, timeout, worker, concurrency or sharding changes. Proceeding through ordinary native landing under the requested automatic-landing workflow. |
|
Merged via squash.
|
What Problem This Solves
The 38 native worktree-containment tests repeatedly rebuild the same two Git histories before each scenario. That startup work adds execution time without adding a new state transition to the tests.
Why This Change Was Made
Build each immutable history once, then copy the complete repository into an independently owned case directory. Both templates stop before origin configuration or fetching; each case retains its original origin, real fetch, sibling branch and commit, and all subsequent worktree, failure, recovery and foreign-state operations.
Templates have separate after-all cleanup, while cases retain their existing after-each cleanup. Initialization is registered before it starts, and only successful templates are cached. Full copies retain every Git object and ref without hardlinks, alternates, linked worktrees or relocated fetch metadata. This removes 414 repeated bootstrap Git launches.
User Impact
Internal tests only. Four full-file runs passed all 38 cases: before 32.244s, after 28.093s, after 30.797s, before 31.508s. Mean elapsed execution fell from 31.876s to 29.445s: about 2.43 seconds, or 7.6%. Template creation is included. This is a focused local result, not a claim about total CI duration.
Production delta is zero; test support is +27/-5. All test cases, assertions and bytes from the first scenario helper onward are unchanged. No sharding, concurrency, clocks, mocks, dependency or product changes. No changelog entry is needed for this internal test change.
Evidence
Hosted CI will be checked at the published head before ordinary native landing.