Repository navigation
Description
Problem Description
The test form check of an implement step runs uv run pytest --collect-only -q (_form_failure in src/devops_cli/roadmap/implement/implement_step.py), also in a checkout that has no uv.lock. A plain uv run creates uv.lock in such a project. Since #7926 a Job passes the hooks step in such a checkout, so it can now reach this check.
Reproduction Steps
- Make a folder that holds only a
pyproject.tomlwith a[project]table. - Run
uv run --offline truethere with uv 0.13.10. - List the folder.
Expected vs Actual Behavior
Expected: no command of a Job writes a tracked or untracked lock file that the item did not ask for (#6557).
Actual: the folder holds a new uv.lock. In a Job, when the repository does not ignore uv.lock, a task names a test form and pytest resolves, the file stays untracked. The next step then can refuse the dirty worktree, and the archive commit, which runs git add -A, can add the lock to the pull request. The hook commands also change to uv run --frozen when the file exists. The Job path is read from the code and is not run.
Environment Diagnostics
uv 0.13.10, devcontainer. Neutral toolchain preset.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Source
Source: #7995
Alternatives check of 2026-12-01: none.
Tool: none found.
Reason: The searches found no separate tool. uv writes the lock, and its frozen mode needs an existing uv.lock, so the fix belongs in the test form check.
Lacks:
- Runs the project's pytest without writing a lock
- Works in a checkout that has no uv.lock
- Keeps project dependencies without a lock file
Proposed design
Problem statement
The test form check runs uv run pytest --collect-only -q. In a checkout with no uv.lock, a plain uv run writes uv.lock. The new file can make the worktree dirty, block the next step, and enter the pull request through git add -A. The check must run the project's pytest without writing a lock.
Acceptance criteria
Requirement: The check runs uv with no sync
The test form check SHALL pass --no-sync to uv run when it collects tests.
Scenario: A checkout with no lock file
- WHEN The test form check builds its uv command for a checkout that has no
uv.lock. - THEN A unit test captures the argv and asserts that it contains
run --no-sync pytest --collect-only -qin that order.
Requirement: The check does not use frozen mode without a lock
The test form check MUST NOT pass --frozen when the checkout has no uv.lock.
Scenario: No lock file
- WHEN The checkout has no
uv.lock. - THEN A unit test asserts that the captured argv contains no
--frozen.
Requirement: The check keeps the collected test result
The test form check MUST return the same collected test result after the command changes.
Scenario: Collected test output
- WHEN The pytest command prints collected test IDs with the new
--no-syncoption. - THEN A unit test with fixed pytest output asserts that the check returns the same result as before the change.
Existing Tool Considered
The alternatives check of 2026-12-01 in the issue body records verdict none and names no tool. The block states that uv writes the lock and that its frozen mode needs an existing uv.lock. No open, maintained tool covers the need. The proposal adds --no-sync to the uv run command in the existing test form check. This option skips the sync that writes uv.lock and uses the environment that the checkout already has. The change edits existing code; it builds no new code, so no written cost of a new tool applies.
Key questions
- Which uv option stops the test form check from writing
uv.lockin a checkout with no lock?: Add--no-syncto theuv runcommand in_form_failure. The check then skips the sync that writesuv.lockand uses the existing project environment. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py:1660]- Chosen: uv run --no-sync. It skips the sync step that creates
uv.lockand still runs the project's pytest. - Rejected: uv run --frozen. It needs an existing
uv.lock, and the failing checkout has none. - Rejected: uv run --no-project. It ignores the project environment and its dependencies.
- Rejected: Run pytest directly. It can use the runner's pytest and miss the project's dependencies.
- Chosen: uv run --no-sync. It skips the sync step that creates
- Does
--no-synckeep the project dependencies?: Yes.--no-syncskips the environment sync, so the command uses the environment that the checkout already has. The project's pytest and plugins stay available. [sources: src/devops_cli/roadmap/implement/implement_step.py:1660] - Where does the test form check run the uv command?: In
_form_failureinsrc/devops_cli/roadmap/implement/implement_step.pyat line 1660. [sources: src/devops_cli/roadmap/implement/implement_step.py:1660]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
fix(roadmap): run hooks in a checkout that has no uv.lock (#7995)
devops-cli-service commentedon Dec 1, 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 (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.