Repository navigation
Description
Split from #3885.
Problem: devops ci --force with a matching cache entry has no test, and the warning that _try_save_ci_cache prints when the tree changed during a run has no test. The old test patched _run_all_checks_async. run_subprocess_async starts real child processes unless subprocess.run is patched, so no process fake answers the checks of devops ci (#1333). A probe in a temporary tree started a real uv, and the floor refused it. Why deferred: this part waits on #1333, which removes the async reroute. Acceptance criteria: after #1333, a CLI test of devops ci --force over the process fake and the git fake SHALL show that --force skips a matching cache entry. A CLI test SHALL show that a tree changed during a run prints MESSAGES.ci.cache_tree_changed and leaves the cache file as it was.
Proposed design
Problem statement
No test covers devops ci --force when the cache holds a matching entry. No test covers the warning that _try_save_ci_cache prints when the tree changes during a run. The old test patched _run_all_checks_async. run_subprocess_async starts real child processes unless subprocess.run is patched, so no process fake answers the checks of devops ci (#1333). Issue #1333 removes this async reroute. The two CLI tests then run over the process fake and the git fake.
Acceptance criteria
Requirement: Force skips a matching cache entry
The devops ci --force command SHALL run the checks even when the cache holds an entry that matches the tree.
Scenario: Force with a matching cache entry
- WHEN A CLI test seeds a matching cache entry over the git fake and runs
devops ci --forceover the process fake. - THEN The process fake records the check commands, which shows that the cache entry did not skip the run.
Requirement: Changed tree prints the warning and keeps the cache
The devops ci command SHALL print MESSAGES.ci.cache_tree_changed and SHALL leave the cache file as it was when the tree changes during a run.
Scenario: Tree changes during the run
- WHEN A CLI test runs
devops ciover the process fake and the git fake, and the fake changes the tree fingerprint while the checks run. - THEN The output contains
MESSAGES.ci.cache_tree_changedand the cache file has the same content as before the run.
Existing Tool Considered
No check has run. pytest and the project fakes cover the need: tests/support/fakes/process.py answers child processes and tests/support/fakes/git.py answers git. No new tool or library is required. pytest lacks a fake that answers the checks of devops ci until #1333 lands. The change adds two test functions, so the cost is about one short session to write and check them.
Key questions
- Why do the tests wait on test(cli): Use edge fakes and real git; drop test rebind hooks #1333?:
run_subprocess_asyncstarts real child processes and reroutes to the sync path only whensubprocess.runis patched. A probe ofdevops ci --forcestarted a realuv, and the floor refused it. Issue test(cli): Use edge fakes and real git; drop test rebind hooks #1333 removes this reroute, so the fakes can then answer the checks. [sources: src/devops_cli/core/process.py, src/devops_cli/commands/ci.py, openspec/changes/archive/2026-11-07-3746-roadmap-tests-install-store-hook/proposal.md] - Which layer do the tests drive?: The tests run the CLI command over the process fake and the git fake. They do not patch
_run_all_checks_asyncor_try_save_ci_cache. (best practice) [sources: openspec/changes/archive/2026-11-08-4087-ci-and-test-selection-command-tests-on-edge-fakes/design.md]- Chosen: CLI test over the edge fakes. It checks the behavior that a user sees and follows the project rule to fake only at the edge.
- Rejected: Patch
_run_all_checks_asyncand_try_save_ci_cache. The earlier design rejected it: it proves that the command calls a function, not that a verdict is kept.
- How does the test seed a matching cache entry?: The test runs
devops cionce over the fakes, so that the realrecord_passing_runwrites the verdict, and then runsdevops ci --force. (best practice) [sources: openspec/changes/archive/2026-11-08-4087-ci-and-test-selection-command-tests-on-edge-fakes/design.md]- Chosen: Run the gate once over the fakes. The real cache writes the verdict, so the test reads a real matching entry.
- Rejected: Write the cache file by hand. A hand-written file can differ from the shape that the real cache writes.
- How does the test change the tree fingerprint during the run?: The process fake answers one check command with a callable that edits a file in the tree, so the fingerprint that the gate reads after the run differs. (best practice) [sources: tests/support/fakes/process.py]
- Chosen: A process-fake answer edits a file during a check.
ProcessAnswer.side_effecttakes a callable, so the fake changes the tree with no patch of adevops_cliname. - Rejected: Patch
compute_workspace_fingerprint. It is adevops_cliname, and the project rule forbids a patch of one.
- Chosen: A process-fake answer edits a file during a check.
Fit
Fits in one pull request.
Suspected block
None.
Activity
devops-cli-service commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(ci)scope of the title gives the scope.The item adds test coverage and waits on #1333.The tests protect the --force cache path and the tree-changed warning.Two CLI tests need the process fake, the git fake and the #1333 change.Both add CI test coverage, but #3885 adds missing seams and this item adds two CLI tests.devops-cli-service commentedon Nov 9, 2026
Refine cannot set this item to Ready at 6121d09 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/core/process.py.devops-cli-service commentedon Nov 10, 2026
Refine cannot set this item to Ready at 1ca0133. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.
missing_pathat existing_tool: The plan names two fake files. The inputfileshas no entry for them, and no task creates them. Evidence: "pytest and the project fakes cover the need:tests/support/fakes/process.pyanswers child processes andtests/support/fakes/git.pyanswers git."