Repository navigation
Description
What happened
#2143 records the owner's rule of 2026-10-24: a test of src/ starts no program, and each real tool other than the process runner's children goes to a recorded contract suite or a devops ci row. git is the program that tests start most. The test-suite audit at df8e2ee saw 705 tests start git, with a median of 6 git starts per test and up to 37. A test that starts only git has a median time of 0.194 s, against 0.026 s for a test that starts nothing.
devops-cli has no git fake to move these tests to. git is reached two ways:
- the process runner, with
CONST_GIT_CLI(for examplecore/repo.py,git/operations.py,git/worktree.py,ai/review/runner.py,roadmap/run.py,ci/fail_to_pass.py,k8s/argocd_gate.py); - GitPython, which starts git through its own
subprocess.Popen(git/operations.py:18,commands/repos.py:70,ai/research/edges.py:244). The process fake does not see these starts.
What should happen
git is one edge with one seam, one shared fake and one contract suite:
- The fake answers each git command from a recorded transcript: the arguments, the exit code, the standard output and the standard error.
- The contract suite replays each transcript through the real seam code over the process fake, and through the git fake, and checks that both give the same result.
- A
devops cirow records the transcripts again with the real git, outside pytest, and fails when a transcript changed. git is installed on the stock runner, so the row needs no install.
Evidence
.data/agent/scratch/audit/full_list.txtof the 2026-10-24 audit, section 1.git (705 tests), and the cost summary.git grep -c -E "CONST_GIT_CLI|\[\"git\"" origin/main -- srcat b170358: 15 modules.tests/support/fakes/at b170358 holds no git fake.
Key questions
- Where is the seam? (proposed) The process runner (
core/process.py,ProcessRunner), which already owns every other program. GitPython's three users either move to the runner or reach GitPython through the same seam. The pull request picks one and records why in the## Feasibilitysection of its proposal. - Which commands are recorded? (proposed) The commands that the follow-up issues need, listed by the migrating issues. A test that needs a command with no transcript adds it with the recording row.
Acceptance criteria
- Every start of git in
src/goes through one seam.rg -n "subprocess" src/devops_clishows no start of git outside it. -
tests/support/fakes/git.pyholds the git fake. A fixture installs it through the seam. - The transcripts are files under
tests/fixtures/git/. Their paths hold no host path, user name or e-mail address (example.comonly). - The contract suite runs every transcript over the real seam code and over the fake. It starts no program.
- A
devops cirow records the transcripts with the real git and fails when one differs. The row runs on the stock runner and keeps its CI job under 5 minutes, measured in the pull request. -
tests/test_git_operations.py,tests/test_git_worktree.pyandtests/test_core_repo.pyuse the fake and start no git. -
uv run devops cipasses.
Follows ADR 0007 as #2143 amends it. Each per-package migration issue of the same audit waits for this item.
Source: #2143
Proposed design
Problem statement
Tests of src/ start real git processes. The 2026-10-24 audit found 705 tests that start git, with a median of 6 starts per test. A test that starts only git takes a median of 0.194 s, against 0.026 s for a test that starts nothing. devops-cli has no git fake in tests/support/fakes/. This issue creates one git fake, one shared seam, and one contract suite so that tests answer git commands from recorded transcripts and start no program.
Acceptance criteria
- Criterion 1: Every start of git in
src/goes through one seam.
Verification: Runrg -n "subprocess" src/devops_cli. The output shows no start of git outside the seam. - Criterion 2: The git fake lives in
tests/support/fakes/git.pyand a fixture installs it through the seam.
Verification: Opentests/support/fakes/git.py. Confirm it holds the fake. Run the test suite. Confirm the fixture installs the fake through the seam. - Criterion 3: Transcripts are files under
tests/fixtures/git/and hold no host path, user name, or e-mail address.
Verification: Listtests/fixtures/git/. Search each file for a host path, user name, or e-mail address. The only allowed e-mail domain isexample.com. - Criterion 4: The contract suite runs every transcript over the real seam code and over the fake, and starts no program.
Verification: Run the contract suite. Confirm it replays each transcript through both paths. Confirm no subprocess starts during the run. - Criterion 5: A
devops cirow records the transcripts with the real git and fails when one differs.
Verification: Runuv run devops cion the stock runner. Confirm the row records transcripts. Change a transcript and confirm the row fails. Measure the CI job time. It is under 5 minutes. - Criterion 6:
tests/test_git_operations.py,tests/test_git_worktree.py, andtests/test_core_repo.pyuse the fake and start no git.
Verification: Run these three test files. Confirm they use the fake. Confirm no git process starts during the run. - Criterion 7:
uv run devops cipasses.
Verification: Runuv run devops ci. The exit code is 0.
Key questions
- Where is the seam?: The process runner (
core/process.py,ProcessRunner). It already owns every other program and already handlesCONST_GIT_CLI. GitPython's three users either move to the runner or reach GitPython through the same seam. The pull request picks one and records why in its## Feasibilitysection. (proposed) [sources: src/devops_cli/core/process.py:406, src/devops_cli/core/process.py:335, src/devops_cli/config/constants.py:1365] - Which commands are recorded?: The commands that the follow-up issues need, listed by the migrating issues. A test that needs a command with no transcript adds it with the recording row. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 24, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate proposes changes to test infrastructure including fakes and contract suites.This change improves test performance and reliability but is not critical for immediate project needs.Improving test performance and reducing reliance on external tools benefits all developers and CI runs.Implementing a comprehensive git fake with contract suite requires significant development effort across multiple modules.Both items address test performance by using recorded results instead of real tools, but the candidate uses a git fake while item 1666 uses recorded scanner and installer results.dan-petty commentedon Oct 28, 2026
Status set to Ready at bb46660 (see proposed design in issue body).
test(git): name the user and the host in the host data tests (#2146)
test(repos): repos and branches tests use git fake (#2921)
test(k8s): use the git fake in k8s and argo cd gate tests (#4178)