Repository navigation
refactor(tests): share nested Git environment setup - #145259
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 5:55 PM ET / 21:55 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR shares temporary Git repository environment setup across four script-test suites while preserving their existing behavior. Merge readiness✅ Ready for maintainer review The cleanup remains useful because current main still contains the duplicate builders. No actionable correctness or security findings remain, and the maintainer-authored PR should proceed through normal review. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s script tests create temporary Git repositories to validate development checks. The shared helper prepares child-process environments so inherited Git paths do not redirect those tests into another repository. flowchart LR
A[Process environment] --> B[Shared test environment helper]
B --> C[Copy environment and clear six Git variables]
C --> D[Apply caller overrides]
D --> E[Git and script subprocesses]
E --> F[Existing test assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -58. Total -58 across 5 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one shared owner for the identical six-variable environment contract while preserving the broader scrubs used by other tests. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor, and current-main source directly confirms the duplicated setup it addresses. Is this the best way to solve the issue? Yes. Moving the identical builders into the existing helper removes duplication without changing environment timing, overrides, or assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 63de507edf6f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
Closes #145258
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Four script-test suites maintain identical environment builders for temporary Git repositories. Those copies can drift and handle inherited Git variables inconsistently.
Why This Change Was Made
The existing temporary-repository helper now owns the shared builder. Each call still creates a fresh environment copy, clears the same six Git variables, disables system Git configuration and terminal prompts, and preserves each caller's overrides. All four suites use that owner; broader environment scrubs elsewhere remain unchanged.
User Impact
Production behavior is unchanged. The refactor removes 58 net test/support lines while retaining the existing test assertions and environment behavior. No performance improvement is claimed.
Evidence
All 370 tests across the four affected suites passed. The 17 selected checks passed, including formatting, typechecking, and linting. The P2 review completed with no actionable findings, and the recorded diff check passed.
The selected gate ran with its default
origin/mainbase. A supplemental warning-only temp-creation report explicitly compared committedad439abc01eb575399fa2c9d0d892668ddb99403to itself and reported no warnings. That report covered committed-branch semantics only; it did not inspect the then-uncommitted candidate edits. The remaining 16 selected checks, focused tests, and review were reused unchanged. No assertion-safety or max-lines ratchet applies to these fivetest/**paths, and neither appeared in the saved check plan.