Skip to content

fix(source-control): isolate the AffectedSuites git fixture from global config - #10567

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/affected-suites-fixture-isolation
Oct 28, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/affected-suites-fixture-isolation

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: flaky fixture seen by two builders on #10498 and #10558

Why

AffectedSuites in test_babysit_postmerge_quarantine.py failed git commit (exit 128) in parallel runs. The fixture inherited the machine's global git config, where commit.gpgsign=true signs through an interop script that fails under load: error: <3>WSL (...) ERROR: UtilAcceptVsock:273: accept4 failed 110 then fatal: failed to write commit object.

What changed

  • AffectedSuites.setUp patches GIT_CONFIG_GLOBAL=os.devnull and GIT_CONFIG_NOSYSTEM=1 for the class, the same values test_babysit_check_inputs.py and test_babysit_postmerge_contains.py already use.
  • Changelog fragment, bump: none.

Scope

  • In: the AffectedSuites class only. The module-level pop of GIT_DIR, GIT_WORK_TREE and GIT_CONFIG stays.
  • Out: test_babysit_lane_room.py and test_babysit_merge_skip.py also run git commit without isolating global config; not reproduced as flaky, so left alone.

Verification

  • 12 concurrent runs of the class before the fix: all 12 had at least one failure. After: 12 of 12 pass.
  • 10 sequential runs of the class: 10 of 10 pass. Before the fix, 5 sequential runs passed 5 of 5, so the failure needs parallel load.
  • babysit-prs/scripts/tests once: 3287 passed. scripts/check-fixture-git-isolation.sh: OK.

Left out: nothing

🤖 Generated with Claude Code

…al config

The fixture inherited the machine's global git config. With commit.gpgsign
on and SSH signing through an interop script, parallel runs failed
`git commit` with "failed to write commit object" (exit 128). Point
GIT_CONFIG_GLOBAL at os.devnull and set GIT_CONFIG_NOSYSTEM for the class.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a "## Summary" section. Describe what this PR changes and why, in a sentence or two.
  • Missing a "## Fix" section. State the concrete change and how it addresses the problem.
  • Missing a "## Related" section. List related PRs, ADRs, or decision-log entries this PR does not close.

Edit the body and this comment updates itself on the next run.

@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 01:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T01:22:42.461269Z 87f96b8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 87f96b85de67f88cb6fcdc0d756f266c136471cd: 0 finding(s), 0 as inline comments.

No security issues found. The change only touches test fixture setup and adds a changelog fragment.

  • AffectedSuites.setUp now patches GIT_CONFIG_GLOBAL=os.devnull and GIT_CONFIG_NOSYSTEM=1. os and mock are already imported, and addCleanup(env.stop) restores the environment. The patch only narrows which git config the test fixture reads.
  • The test file is not under any listed trusted path, and no trust control, token scope, kill switch, merge hold or plugin manifest changes.
  • The PR context is plain description text. It contains no embedded instructions.
  • Spend: none.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 87f96b85de67f88cb6fcdc0d756f266c136471cd: 0 finding(s), 0 as inline comments.

No findings. I read the full diff (2 files) and the surrounding fixture code.

  • AffectedSuites.setUp patches GIT_CONFIG_GLOBAL=os.devnull and GIT_CONFIG_NOSYSTEM=1 through mock.patch.dict on os.environ. It starts the patch before the first git call and registers env.stop with addCleanup, so the environment is restored even if setUp fails.
  • The fixture's git helper calls subprocess.run without an explicit env, so the child processes inherit the patched environment. That includes the worktree and affected_suites git calls made through pm.
  • os and mock are already imported in the file. The repo-local user.email and user.name are set after git init, so commits don't depend on the global config.
  • The changelog fragment uses bump: none, which matches a test-only change.
  • The change touches no trusted paths and no manifests. It spends no billed resources.
  • Not independently verified: the PR's claims of 12 concurrent runs failing before the fix and passing after. I did not run any tests.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit e45707f Oct 28, 2026
75 checks passed
@kyle-sexton
kyle-sexton deleted the fix/affected-suites-fixture-isolation branch October 28, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant