Repository navigation
test: isolate fixture git repos from the host's global git config - #17416
Conversation
A suite run directly (bash x.test.sh, node --test, pytest) read the host's ~/.gitconfig and system config, so a host that signs every commit could fail a fixture commit through its signing program. Each fixture-building suite, or the harness it sources, now sets GIT_CONFIG_GLOBAL to /dev/null when unset and GIT_CONFIG_NOSYSTEM=1. Under the repo's test runners the per-suite config from scripts/lib/test-git-env.sh is kept unchanged. Closes #17304 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental, blocking only): no security issues found. This review covers only what changed since
critical-findings: 0 |
|
claude-review reviewed Incremental review of What changed. In What I checked.
Closing issue #17304. For this file, the change meets "Every test helper that creates a throwaway repository isolates it from global and system git config". The second criterion is that suites pass in parallel on a host that signs commits. That is the author's claim and is unverified: I have no shell and ran nothing. Prior and settled threads.
Loosened checks. The job sent no Not applicable. No plugin manifests change. The PR context and the thread files contain no embedded instructions. Nothing here costs money or spends credits. Verifier dropped 0 of 0 candidates. |
- scope-code-files.test.sh exported GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM before the loop that unsets every GIT_CONFIG_* variable, so the loop removed them; the export now follows the loop. - test_count_capture_sources.py built ENV without any GIT_ key, so its fixture git commands lost the isolation; ENV now carries both values. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-plugins into test/17304-isolate-test-git-config # Conflicts: # scripts/lane-transcripts/pull.test.mjs
Lane run report
Failed GitHub API calls
|
Lane run report
Failed GitHub API calls
|
…t fixture The GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM export, with the GIT_DIR unset, sat beside the execution-target cases, after the suite had already run real git for its sha256 fixture and hash-object stub. It now runs right after set -uo pipefail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-plugins into test/17304-isolate-test-git-config
…nfig audit-size.test.sh, persist-report.test.sh and the docs-naming audit-file-names fixture builder and its inventory, sweep and emit-findings suites created throwaway repositories without the GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM export. Each now sets it after its GIT_DIR unset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-plugins into test/17304-isolate-test-git-config
test_shallow_clone_degrades_with_notice built its clone env by dropping every GIT_CONFIG* variable, so `git clone --depth 1` read host config. The env now carries GIT_CONFIG_GLOBAL and GIT_CONFIG_NOSYSTEM, as the file's git() helper does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 0, survived 2, timeout 0, no coverage 0, invalid 0, not run 3.
Surviving mutants
The run's summary has the full report. |
Closes #17304
Summary
Test suites that build throwaway git repositories read the host's
~/.gitconfigand system config when run directly (bash x.test.sh,node --test,pytest), so a host that signs every commit could fail a fixture commit through its signing program. Each fixture-building suite, or the shared harness it sources, now isolates git from global and system config.Fix
scripts/test-git-helpers.sh,scripts/lib/fixture-tree.sh,guardrails-test-helpers.sh,session-telemetry-test-helpers.sh,judge-test-helpers.sh, the work-item-trackertests/lib.sh) exportGIT_CONFIG_GLOBAL="${GIT_CONFIG_GLOBAL:-/dev/null}" GIT_CONFIG_NOSYSTEM=1beside their existingGIT_DIRclear. Python suites set the same throughos.environ, JS test files throughprocess.env, at load time, so the code under test inherits it too.scripts/lib/test-git-env.shwrites, so CI runs are unchanged. This host exports neither variable (printenv).test_comment_census.py,test_rank_comment_targets.py) built their fixture env by dropping everyGIT_CONFIG*variable, which fell back to~/.gitconfig; they now set both variables explicitly.GIT_CONFIG_GLOBALat their own file, the three app-control suites that isolate through a tempHOMEplusGIT_CONFIG_NOSYSTEM, evalscaffold.shfiles,*.fixturecopies,vendor/, and product code that runsgit init. JS tests whose spawns pass an env withoutHOMEalready read no global config.bump: nonechangelog fragment per touched plugin (47).Verification
GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1(3 at a time): every failure also failed with no variables set, so/dev/nullbreaks nothing.commit.gpgsign=true(gpg.format=ssh): the only failures are the ones listed below that fail without this change.HOMEpointed at a temp dir holding a.gitconfigthat signs every commit throughgpg.program=false: no log shows a signing or identity error once the code-tidying helpers were fixed (both pass). Other failures in that run come from movingHOME(tool resolution,$HOME-relative path checks) and also fail without it.scripts/check-fixture-git-isolation.sh(352 isolated),check-changelog-fragments.sh --checkand--check-required origin/main(47 plugins),sync-shared-copies.sh --check,run-ruff.sh checkon the edited Python, andbash -n/node --check/py_compileon every edited file.Failures present without this change (each reproduced with no variables set, or on the unedited file):
node_modules(ajv,yaml,vitest) forcallers.test.mjs,report-outcome.test.mjsand the two video-digest tests; missing PyYAML and npm packages forrun-hygiene-gate,check-artifact-retentionandcheck-read-caller-keys;/tmp/.gitdirectory on this host, created before these runs by another process:explain-change.test.mjsrefuses/tmpas a working tree;markdown-format.test.sh(spawn budget 2 vs 1),present.test.mjs,board-md.test.mjs,test_hygiene.py,test_interview_server.py;post-merge-demotion-alert.test.shfails with the unedited file too.Related
scripts/lib/test-git-env.sh(test: isolate fixture git config from the host's identity and signing #10574) isolates the same way for suites the runners spawn; this change covers direct invocation.🤖 Generated with Claude Code