Skip to content

test(git): isolate nested repository fixtures - #190085

Merged
RomneyDa merged 1 commit into
mainfrom
tideclaw/rri-56-nested-git-env
Nov 2, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
tideclaw/rri-56-nested-git-env

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 1, 2026

Copy link
Copy Markdown
Member

Problem

RRI-56: nested fresh-checkout tests can inherit the release controller or outer process Git context. createNestedGitEnv() already removed several repository-routing variables, but retained counted GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n entries and the caller global Git config. That can redirect or contaminate Git operations intended for an isolated fixture.

Solution

  • Remove the remaining repository-routing variables used by linked/common Git contexts.
  • Reset counted configuration and remove inherited indexed key/value entries.
  • Isolate global and system Git configuration while retaining noninteractive Git behavior.
  • Preserve the existing caller contract: callers can still overlay deliberate Git configuration after createNestedGitEnv().

Evidence

  • Reproduced inherited counted/global configuration in the current helper.
  • New direct regression passes.
  • Representative nested-repository and release-tooling consumers: 100/100 tests passed.
  • Tooling typecheck passed.
  • Changed-file formatting and type-aware lint passed.
  • git diff --check passed.
  • Independent P0-P2 review found no issues and verified post-helper configuration overlays remain effective.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR clears additional inherited Git routing and counted configuration variables and disables global configuration for temporary repository fixtures.

Example: A test process inherits GIT_CONFIG_COUNT=1, GIT_CONFIG_KEY_0=openclaw.fixture, and GIT_CONFIG_VALUE_0=caller-value.

  • Before: Git subprocesses using the helper inherit openclaw.fixture=caller-value.
  • After: The helper returns GIT_CONFIG_COUNT=0 and removes the inherited indexed entries.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with no actionable findings; supplied validation is test-based rather than independently inspectable Git subprocess traces under contaminated input.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-support repair is outside the ordinary contributor proof gate; supplied evidence consists of the environment regression and reported representative consumer validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors running nested repository tests can encounter failures caused by inherited outer-process Git settings.
Reason: The maintainer-authored change addresses a concrete fixture-isolation defect through the existing shared owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused repair to nested Git fixture isolation; no introduced correctness or security defect was found.

Priority: P3
Reviewed head: 7d27f736d8a5d602bf4b2d1d439c2f44e69929fc

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared test helper turns the parent process environment into an environment for Git subprocesses in temporary repositories; callers can then overlay intentional fixture settings.

flowchart LR
 A[Parent process environment] --> B[Shared fixture environment helper]
 B --> C[Remove inherited Git context]
 C --> D[Caller fixture overrides]
 D --> E[Git subprocess in temporary repository]
Loading

Technical review

Best possible solution:

Keep the isolation repair in the existing shared helper while preserving explicit caller overrides.

Do we have a high-confidence way to reproduce the issue?

Source shows inherited counted and global configuration surviving the main helper; the added regression exercises that environment contract, but no tests were executed during this read-only review.

Is this the best way to solve the issue?

The patch repairs the existing environment owner directly, adds no parallel mechanism, and leaves post-helper overrides effective.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 03aec1b175a6.

Provenance checked

  • Shared nested Git environment construction changes intended behavior with a stated reason (6fade53: The consolidation in refactor(tests): share nested Git environment setup #145259 removed duplicated environment builders while preserving their behavior and caller overrides; earlier caller-origin searches encountered unavailable historical blobs.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned introduced patch: The introduced patch changes only the shared fixture helper and its direct regression; it adds no production runtime path or persisted state. (test/helpers/temp-repo.ts:17, 7d27f736d8a5)
  • Current main retains the defect: The fetched main helper copies process.env, clears six routing variables, and disables system configuration and prompts, but retains counted configuration, global configuration, and GIT_COMMON_DIR. (test/helpers/temp-repo.ts:14, 03aec1b175a6)
  • Existing owner and caller contract: The shared owner was consolidated in refactor(tests): share nested Git environment setup #145259 to prevent environment-policy drift while preserving caller overrides; current callers apply custom global configuration and identity settings after spreading the helper result. (test/scripts/crabbox-source-capsule.test.ts:57, 7d27f736d8a5)
  • Discussion and validation: The full body reports a direct regression, 100 passing representative consumer tests, typechecking, formatting, and linting; comments contain only review-status messages. GitHub reports the reviewed head mergeable with a clean merge state, and supplied check context has no failed checks. (7d27f736d8a5)
  • Policy and history coverage: Read root, test, and test/helpers AGENTS.md files and applied simplification and test-value guidance; no maintainer-notes directory exists. Helper history and consolidation rationale were available, while extended searches through older caller blobs encountered unavailable promisor objects. (test/helpers/AGENTS.md:1, 7d27f736d8a5)

Likely related people:

  • Peter Steinberger: Raw commit 6fade53 adds test/helpers/temp-repo.ts:17 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6fade53ed122; files: test/helpers/temp-repo.ts)

PR surface

Tests +41. Total +41 across 2 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 41 0 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 41 0 +41

Labels

Label changes:

  • add P3: The repair improves test-fixture reliability without changing shipped application behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: The repair improves test-fixture reliability without changing shipped application behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 1, 2026, 12:41 AM ET / 04:41 UTC.

@RomneyDa
RomneyDa merged commit c578000 into main Nov 2, 2026
110 checks passed
@RomneyDa
RomneyDa deleted the tideclaw/rri-56-nested-git-env branch November 2, 2026 00:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants