Skip to content

fix(ci): the local git row fails without the review extra #4997

Open

Description

@dan-petty

Current Behavior

uv run devops ci --check --only git fails in a devcontainer environment that does not have the review extra. The row records the git transcripts again with the real git and compares them with tests/fixtures/git/review_window.json. The recorded fact lizard.complexity changes from "status": "ok" with numbers to "status": "skipped" with the reason lizard is not installed: install the extra review, for example with uv sync --extra review. The row then fails with The committed git transcripts differ from git version 2.55.0.

The CI toolchain runs uv sync --locked --all-groups --all-extras (.github/actions/setup-toolchain/action.yml:55), so CI has lizard. The .venv of the devcontainer and of a new worktree do not have it. Thus each local full gate fails its git row with no change to the code that the row checks.

Expected Behavior

The local git row gives the same result as CI for the same tree. One of these:

  • the devcontainer and uv run environments install the review extra, or
  • the transcript of lizard.complexity does not depend on an optional extra, or
  • the row tells the operator to install the extra before it compares the transcripts.

Steps to Reproduce

  1. Make a new worktree from origin/main and run uv run devops ci --check --only git in it.
  2. See the failure and the diff on lizard.complexity.

Evidence

Found while building #4673 on 2026-11-12. ls .venv/bin/lizard gives "No such file or directory" in the main checkout and in the worktree. lizard comes from the extra review = ["lizard==1.24.3"] of pyproject.toml, added for devops roadmap review run (#4686).

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches returned only unrelated pages; no open tool installs the pinned lizard dependency, decouples the transcript from the review extra, or guards the row, so this stays a project pyproject, devcontainer and fixture change.

Lacks:

  • Default uv environment installs the pinned lizard dependency
  • Devcontainer setup matches the CI toolchain extras
  • Clear missing-extra message before the transcript comparison
  • Review window transcripts stable across optional extras

Proposed design

Problem statement

The local git row and three tests assume the optional review extra, but a new worktree and the devcontainer do not install it. The row then fails on the lizard.complexity fact and reports a transcript diff. The fix makes the default local uv environment install the pinned lizard dependency and gives a clear message when it is missing.

Acceptance criteria

Requirement: Default uv environment includes lizard

The default local uv environment SHALL install the pinned lizard dependency.

Scenario: Fresh worktree imports lizard

  • WHEN A developer syncs the default uv environment from the lock file in a fresh worktree.
  • THEN The command uv run --no-sync python -c "import lizard" exits 0.

Requirement: Devcontainer includes lizard

The devcontainer environment SHALL install the pinned lizard dependency during setup.

Scenario: Devcontainer import check

  • WHEN The devcontainer setup completes.
  • THEN The command uv run --no-sync python -c "import lizard" exits 0.

Requirement: Local git row matches CI

The local git row SHALL give the same result as CI for a synced default environment.

Scenario: Git row in a fresh worktree

  • WHEN A fresh worktree runs uv run devops ci --check --only git.
  • THEN The command exits 0 and prints no transcript diff for lizard.complexity.

Requirement: Review facts test passes without manual extra

The review facts test SHALL pass in the default local environment.

Scenario: Version window facts test

  • WHEN A developer runs uv run devops ci test tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window.
  • THEN The test passes and the lizard.complexity fact has status ok.

Requirement: Git contract tests pass without manual extra

The review_window git contract tests SHALL pass in the default local environment.

Scenario: Review window git contract

  • WHEN A developer runs the three review_window tests in tests/core/test_git_contract.py.
  • THEN All three tests pass and no lizard.complexity diff appears.

Requirement: Missing lizard message

The git row SHALL name the missing review extra before it compares transcripts when lizard is absent.

Scenario: Git row without lizard

  • WHEN The git row runs in an environment where import lizard fails.
  • THEN The row exits 1 with a message that names uv sync --extra review and prints no transcript diff.

Existing Tool Considered

No open, maintained tool covers the need. The alternatives check on 2026-11-15 returned none. The change edits pyproject.toml and the devcontainer setup and updates tests; it builds no new code.

Key questions

  • Why does the git row fail when the review extra is absent?: The review fact code returns status skipped when import lizard fails, and tests/fixtures/git/review_window.json expects status ok with numbers. [sources: src/devops_cli/roadmap/project_review/facts.py:213, tests/fixtures/git/review_window.json]
  • How should the default local uv environment get lizard so the git row and tests match CI?: Add the pinned lizard dependency to the default dev dependency group in pyproject.toml. uv run includes the dev group by default, so a fresh worktree installs lizard without a manual extra. Keep the review extra for installed users. (best practice) [sources: pyproject.toml, .github/actions/setup-toolchain/action.yml:55, src/devops_cli/roadmap/project_review/facts.py:213]
    • Chosen: Add lizard to the default dev dependency group. uv run installs the default dev group, so a new worktree gets lizard and the review extra stays optional for installed users.
    • Rejected: Skip the tests when lizard is missing. The git row still fails and the local result differs from CI.
    • Rejected: Compute complexity without lizard. This builds and maintains a second complexity implementation.
    • Rejected: Tell the operator to install the extra as the only fix. The local gate and the tests still fail until the operator acts.
  • What should the git row do when lizard is absent?: The row SHALL stop before the transcript comparison and name uv sync --extra review in its error. It SHALL not print a transcript diff. (best practice) [sources: src/devops_cli/roadmap/project_review/facts.py:213, tests/fixtures/git/review_window.json, tests/core/test_git_contract.py]
    • Chosen: Stop with a clear install instruction. The operator gets the cause and the command, not a misleading transcript diff.
    • Rejected: Skip the comparison with no error. A silent skip hides that the environment differs from CI.
    • Rejected: Compare and fail on the diff. This is the current behavior and it hides the missing extra.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/ci
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    The same cause also fails a test, not only the git row. In a new worktree from origin/main (050a6ef), with no review extra, uv run devops ci test tests/roadmap -n 6 gives one failure:

    • tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window: the fact lizard.complexity is skipped (importlib.util.find_spec("lizard") is None, src/devops_cli/roadmap/project_review/facts.py:213), and the test expects ok with numbers.

    /workspaces/devops-cli/.venv/bin/python -c "import lizard" gives ModuleNotFoundError in the main checkout too. Found while building #5205 on 2026-11-12. A fix of this issue must also cover the test: install the extra in the local environments, or skip the test where lizard is missing.

  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    The same cause also fails three tests of uv run devops ci test in a new worktree, not only the git row. Found while building #5341 on 2026-11-13, in a worktree at 4ef7c6f11:

    • tests/core/test_git_contract.py::test_a_scenario_over_the_process_fake_starts_the_recorded_commands_and_gives_the_result[review_window]
    • tests/core/test_git_contract.py::test_a_scenario_over_the_git_fake_gives_the_recorded_result[review_window]
    • tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window

    The diff is the same: lizard.complexity is skipped, and the test expects ok. After uv pip install lizard==1.26.0 in the worktree venv, the three tests pass. So a fix of this issue must also cover the test run, for example a skip when the extra is missing.

  6. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    One more symptom of the same cause, found while building #4851 on 2026-11-13 at origin/main 4ef7c6f: in a new worktree with a plain uv run environment, uv run devops ci test tests/roadmap fails one test, tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window. The fact lizard.complexity is skipped and not ok, because import lizard raises ModuleNotFoundError (the extra review is not installed). The test passes in CI, which runs uv sync --all-extras.

  7. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for a way to skip tests when an optional dependency is missing, and for installing a uv extra automatically in a devcontainer, returned only unrelated documentation pages, so no open tool or library covers the need. The fix is in the project's own code and configuration: install the review extra in the local devcontainer/uv run environments, or make the lizard.complexity fact and the recorded git transcripts independent of it, and cover the tests that expect ok.

    Tool: none found

    Lacks:

    • No external tool makes the local git row and the review_window.json transcript match CI when the optional review extra is missing
    • No external tool installs the review extra in the devcontainer and uv run environments
    • No external tool makes lizard.complexity independent of the extra
    • No external tool covers the tests (test_review_facts.py, test_git_contract.py) that expect lizard.complexity to be ok

    Searches run:

    • uv sync install optional extra in devcontainer automatically, results: 5
    • pytest skip test when optional dependency not installed importlib.util.find_spec, results: 5
    • pytest.importorskip skip test module missing optional dependency documentation, results: 5

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    status/ready
    and removed
    status/new
    on Nov 16, 2026
  9. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 181f85e (see proposed design in issue 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/mediumpriority/p2-mediumscope/cisource/agentstatus/readytype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions