Skip to content

fix(roadmap): the test form check writes uv.lock in a project with none #7999

Backlog

Description

@dan-petty

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

  1. Make a folder that holds only a pyproject.toml with a [project] table.
  2. Run uv run --offline true there with uv 0.13.10.
  3. 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 -q in 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-sync option.
  • 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.lock in a checkout with no lock?: Add --no-sync to the uv run command in _form_failure. The check then skips the sync that writes uv.lock and 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.lock and 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.
  • Does --no-sync keep the project dependencies?: Yes. --no-sync skips 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_failure in src/devops_cli/roadmap/implement/implement_step.py at line 1660. [sources: src/devops_cli/roadmap/implement/implement_step.py:1660]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    priority/p2-medium
    on Dec 1, 2026
  2. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    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:

    • uv run --no-sync flag lockfile, results: 5
    • uv run creates uv.lock avoid writing lockfile, results: 5
    • uv run pytest creates uv.lock github issue, results: 5
    • astral-sh uv "no-sync" run lockfile documentation, results: 5
    • uv.lock untracked created by uv run CI, results: 5
    • uv python package manager run command frozen no-sync, results: 5
    • docs.astral.sh/uv run command options no-sync frozen locked, results: 5
    • "uv run" "uv.lock" creates lock file, results: 5
    • uv documentation lockfile frozen locked no-sync reference, results: 5
    • astral-sh uv github repository, results: 5

    Sources:

  3. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  4. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/roadmapsource/agentstatus/readytype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions