Repository navigation
Description
Problem
Two cases of tests/core/test_git_contract.py fail in the devcontainer and pass in CI on the same commit (29e3a03, Tests & Coverage green on 2026-11-19):
test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window]: the code startsgit -C <project> for-each-ref --format=%(refname:short)%09%(creatordate:unix) refs/tags/v*where the recording expectsgit -C <project> cat-file blob 4c12ae57...:a.py.test_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window]: the result differs from the recorded result.
The failure stays with an empty HOME and XDG_* directories, without DEVOPS_CLI_CONFIG, without the GIT_CONFIG_* variables of the devcontainer, and with TZ=UTC. The scenario (review_window in tests/support/git_scenarios.py) fixes now. The difference left is git: the devcontainer has git 2.55.0, and the CI runner has git 2.56.1. The owner rule is that every test passes in the devcontainer and on a stock runner.
Expected
- Find the cause and fix it at its source: the code or the scenario must not depend on the git version (for example how
creatordatereads a lightweight tag), or the recording records what both versions give. - Both cases pass in the devcontainer and in CI.
- The devtools image work (one image for the devcontainer and the Job images) gives one git version to both; this item does not wait for it.
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches returned no open, maintained tool or library for a repository-internal git contract test; the fix changes the project's own git_read and transcript, and adds no library.
Lacks:
- No tool to record the review_window transcript
- No tool to make tag dates version-independent
- No external library fits an in-repo contract test
Proposed design
Problem statement
Fix the test environment and not read_tags. A local venv holds no lizard from the optional review extra, and the git version is not the cause. Two review_window contract cases and one review-facts case then fail, and they pass in CI. The fix declares lizard in the dev dependency group of pyproject.toml and adds a guard test. The read_tags change is dropped.
Acceptance criteria
Requirement: The dev group declares the review package
The dev dependency group in pyproject.toml SHALL declare lizard, so that a plain uv run installs it.
Scenario: A plain sync installs lizard
- WHEN
uv run python -c "import lizard"runs in a fresh clone with no extra flag. - THEN The command exits 0.
Requirement: A guard names the missing extra
A test in tests/invariants/ SHALL fail with a message that names uv sync --all-extras when the test environment holds no lizard.
Scenario: The guard gives the sync command in its message
- WHEN
uv run pytest tests/invariants/test_review_extra_present.pyruns, and one case replacesimportlib.util.find_specwith a function that returnsNoneforlizard. - THEN The case asserts that the guard raises
AssertionErrorwith a message that holdsuv sync --all-extras, and it passes.
Requirement: The review_window cases pass in a new worktree
The two review_window contract cases and the review-facts case SHALL pass under a plain uv run pytest in a new worktree.
Scenario: No case fails in a new worktree
- WHEN
uv run pytest tests/core/test_git_contract.py tests/roadmap/project_review/test_review_facts.py -k 'review_window or test_the_facts_of_a_version_window'runs in a fresh worktree with a new.venv. - THEN The run reports 0 failed cases.
Requirement: The git row matches in a new worktree
The git row of devops ci SHALL report no difference for review_window in a new worktree venv.
Scenario: The git row matches
- WHEN
uv run devops ci --check --only gitruns in a fresh worktree with a new.venv. - THEN The row reports that the git transcripts match and exits 0.
Existing Tool Considered
The alternatives check in the issue body (2026-11-19) records verdict none with no tool; that block holds its Lacks: list. The change adds no library. It declares the existing lizard package in the dev dependency group of pyproject.toml, which the review extra already names, and it adds one pytest guard. Written cost of the guard: about 5k tokens to write, 1k per later fix, and 30 minutes elapsed.
Key questions
- Why do the
review_windowcontract cases fail in a local venv and pass in CI?: The venv holds nolizard, which thereviewextra ofpyproject.tomlinstalls._complexityinfacts.pyseesfind_spec("lizard") is None, setslizard.complexitytoskipped, and reads no blob. The replay then meetsfor-each-refwhere the recording holdscat-file blob. [sources: pyproject.toml, src/devops_cli/roadmap/project_review/facts.py, tests/support/git_scenarios.py, tests/core/test_git_contract.py] - Does the git version cause the failure?: No. The contract suite starts no program, because the
no_program_startsfixture refuses every start. The recording row passes with git 2.55.0, so the two git versions give the same transcript. [sources: tests/core/test_git_contract.py, tests/core/test_git_recording.py] - How does the test environment get
lizardin the devcontainer, a new worktree and CI?: Declarelizardin thedevdependency group ofpyproject.toml. A plainuv runsyncs the default groups, so the devcontainer and a new worktree get the package. CI syncs all groups and all extras, so it keeps the package. (best practice) [sources: pyproject.toml, AGENTS.md]- Chosen: Declare lizard in the dev dependency group. A plain
uv runsyncs the default groups, so every test environment gets the package that the recording needs. - Rejected: Skip the cases when lizard is absent. The cases would not pass in the devcontainer, and the
gitrow would still show a difference there. - Rejected: Read the tag date with
git log -1 --format=%ct. The git version is not the cause, and the contract suite starts no real git. - Rejected: Record the transcript in a venv without the extra. CI installs the extra, so its recording would differ from the committed one.
- Chosen: Declare lizard in the dev dependency group. A plain
- Which check stops the failure from returning?: One test in
tests/invariants/asserts that the test environment holdslizard. Its message namesuv sync --all-extras. A second case givesfind_specaNoneresult and asserts that message. (best practice) [sources: AGENTS.md, tests/invariants/test_hermetic_floor.py]- Chosen: A pytest guard in tests/invariants/. AGENTS.md rule 11 asks for a check that fails if the problem returns.
- Rejected: A note in docs/TESTING.md. A document does not fail a check.
- Rejected: No guard. The same failure returns with no signal.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both target the review_window scenario in test_git_contract.py, but #4865 fixed a transcript mismatch and this candidate fixes a git 2.55 vs 2.56 behavioural difference.devops-cli-service commentedon Nov 19, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (6)
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 20, 2026
The problem is still on main at 165463c (2026-11-20) in the devcontainer:
uv run pytest tests/core/test_git_contract.py tests/roadmap/project_review/test_review_facts.pygives 3 failures, the tworeview_windowcases andtest_the_facts_of_a_version_window. The process fake seesgit for-each-ref --format=%(refname:short)%09%(creatordate:unix) refs/tags/v*where the recording holdsgit cat-file blob <sha>:a.py.dan-petty commentedon Nov 21, 2026
The cause is not git 2.55. It is the missing
reviewextra (lizard) in a local venv.Evidence, on main e01bf84 with git 2.55.0 in a new worktree:
uv run python -c "import lizard"givesModuleNotFoundError. A plainuv runsyncs no extra, andlizardis in the extrareviewofpyproject.toml.lizard,_complexityinroadmap/project_review/facts.pygiveslizard.complexitythe statusskipped(find_spec("lizard") is None) and reads no blob. So the replay ofreview_windowmeetsfor-each-ref ... refs/tags/v*where the recording expects thecat-file blob ...:a.pyof lizard.tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window(lizard.complexityisskipped, and the test expectsokwith 3 files).uv run --extra review pytest tests/core/test_git_contract.py tests/roadmap/project_review/test_review_facts.py -k 'review_window or test_the_facts_of_a_version_window'gives 4 passed with git 2.55.0.CI runs
uv sync --all-groups --all-extras, so it haslizard. A fix at the source: the tests that needlizardskip with a reason when the extra is missing, or the local setup syncs the extra.1 remaining item
dan-petty commentedon Nov 25, 2026
Returning to
New: this item cannot be built as specified because the premise in its Proposed design is disproven by command output, and the proposed change does not fix the real failure.Evidence (checked at
origin/mainda9753e40,git version 2.55.0)uv run devops ci --check --only gitpasses in the devcontainer withgit version 2.55.0(The 22 git transcripts match git version 2.55.0.), provinggit 2.55.0and CIgitproduce identical transcripts forfor-each-ref creatordate.uv run pytest -n 0 tests/core/test_git_contract.py tests/core/test_git_recording.pypasses (96 passed in 1.59s), including all 3review_windowcases.tests/core/test_git_contract.pyforbids spawning realgit(no_program_startsfixture), sogit 2.55.0vs2.56.1cannot cause the contract replay failure. As the prior comment on this issue also showed, the mismatch occurs when a worktree venv lacks the optionalreviewextra (lizard), causingcomplexity_fact(src/devops_cli/roadmap/project_review/facts.py:221) to skipcat-file blobexchanges and jump directly tofor-each-ref.for-each-ref creatordateinread_tagswith per-taggit log -1 --format=%ctcalls would add N+1 subprocesses without fixing a missinglizardenvironment.Needs re-refinement to target the missing
lizard(reviewextra) setup or test skip condition instead ofread_tags.devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(main): release 0.219.0 (#7177)
devops-cli-service commentedon Nov 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC