Repository navigation
test: reuse immutable native PR bootstrap fixtures - #133169
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:48 AM ET / 07:48 UTC. ClawSweeper reviewWhat this changesThe PR caches immutable Git and native PR-wrapper setup templates, then copies them per test case to reduce test bootstrap time while preserving isolated mutable state. Merge readinessKeep open for the maintainer-owned merge decision: the introduced test-only refactor preserves fresh mutable Git state per case and no correctness defect was found. Priority: P3 Review scores
Verification
How this fits togetherNative PR scripts create disposable Git repositories, remotes, worktrees, and command stubs to exercise review and merge-operation behavior. These tests validate the script layer before it performs GitHub-side PR operations. flowchart LR
A[Test case] --> B[Immutable fixture template]
B --> C[Private copied repository]
C --> D[Fresh refs remotes and worktrees]
D --> E[Native PR script]
E --> F[Merge outcome or lock assertion]
Decision needed
Why: The protected maintainer label and member authorship require explicit maintainer handling, although the source audit found no discrete patch defect. Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +51. Total +51 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the isolated-template refactor after exact-head required checks complete, retaining the per-case creation of mutable Git and PR-operation state. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR changes internal test bootstrap performance rather than reporting a product defect. Is this the best way to solve the issue? Yes: reusing only immutable setup while copying each case's repository keeps the existing corruption, attribution, recovery, and worktree scenarios isolated. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c04bee452e70. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Reviewed for the maintainer-directed test-performance campaign. The latest ClawSweeper review has no actionable findings or additional pre-merge moves; its remaining maintainer decision is satisfied by this reviewed, authorized landing. Exact source 55d28b9ffa44 passed CI 33299801259, and native preparation preserved that head. No changes to the affected tests, native script closure, runner or lockfile have appeared on main since the tested base. Repeated measurements save about 7.3 seconds in all 140 merge-outcome cases and 1.7 seconds in the 18 fresh-main lock cases. The full pair passed 250 tests with the existing Linux-only skip locally; both affected groups also passed shuffled. Real repository mutation and failed-bootstrap cleanup probes, the full changed gate and required Codex autoreview passed. Production delta is zero; test cases, assertions, clocks, transport and sharding are unchanged. Proceeding through the ordinary native merge flow with GitHub enforcement intact. |
|
Merged via squash.
|
What Problem This Solves
Native PR tests repeatedly rebuild the same initial Git history and tool setup. Across 134 merge-outcome fixtures and 18 fresh-main lock cases, this adds execution time before the behavior under test begins.
Why This Change Was Made
Reuse only immutable setup, with an independent repository copy for every case. Merge-outcome fixtures cache the base commit and empty bare remote; every source commit, attribution variant, push and linked worktree remains fresh. Fresh-main lock cases cache the committed wrapper/tool prefix before any origin, fetch, worktree or failure proxy exists.
The templates use the existing lifecycle-owned temporary-directory helper. Case copies retain separate files, refs, indexes, objects, configuration and cleanup. Partial initialization remains registered for cleanup. No shared mutable fixture, object alternates or hardlinks are introduced.
Production delta: 0. Tests: +110/-59. All test cases, assertions, mocks, clocks, deadlines, process supervision, real Git transport, sharding and worker settings remain unchanged. Reusing live worktrees or parameterized source histories was rejected because it would weaken corruption, recovery and attribution coverage.
User Impact
No product behavior changes. Repeated local measurements save about nine seconds across the affected test groups. This is a focused execution-time result, not a claim about total CI duration.
Evidence
macOS, Node 26.5.0, Vitest 4.1.11; same one-worker runner settings for all measurements:
Times are elapsed file spans or the serial matrix durations, not sums across concurrent cases. The full candidate pair passed 250 tests, with the existing Linux-only zombie-process case skipped on macOS. The 18 fresh-main cases also passed shuffled with seed 93147.
Supplemental probes compare baseline/candidate trees, refs, indexes, configuration, working state, executable targets and path-bound environments. Deleting a copied source object or mutating one case's refs, config, index and proxy leaves siblings and templates unchanged. Successful and failed-bootstrap cleanup passed. Node's default copy resolves some host executable symlink aliases; the resolved executables remain identical.
node scripts/check-changed.mjs -- test/scripts/pr-merge-outcome.test.ts test/scripts/pr-operation-lock.test.tspassed locally, including test-root types and script lint. Required Codex autoreview completed with no accepted blocking findings. Hosted CI remains required before landing.The first changed-file gate on an older main failed on an unrelated stale code-mode import. Refreshing to current main picked up the canonical repair in #133155; neither that fix nor its production lines are part of this diff. The affected test files, native PR owners, test runner and dependency lockfile were unchanged across the refresh.