Skip to content

fix(ci): fail-to-pass gate replay imports the head source on the base #5353

Closed

Description

@dan-petty

Problem Description

devops ci fail-to-pass runs the gate row of a changed check module on the base tree with sys.executable -c "from tests.gate.<row> import main" and cwd=<base tree> (src/devops_cli/ci/fail_to_pass.py, gate_row_argv and _run_gate_row). The interpreter is the one of the head checkout, and its editable install of devops-cli points at the src/ of the head. With -c, Python puts the current folder on sys.path, but the package is under src/, so import devops_cli reads the head source. The base replay of a gate row thus runs the head source on the manifests of the base.

A fix that changes a list in src/ and the manifest files that the list names, such as MANIFESTS_BY_STACK in src/devops_cli/commands/k8s/stack_lifecycle.py and a new file under k8s/, then fails gate cases of check modules that the fix does not change. The command reports that such a case "must be in a check module that the fix adds or changes" and exits 1, also when the real base passes those cases.

Reproduction Steps

  1. Check out the branch of fix(k8s): Open WebUI allows every CORS origin #5306 (it adds k8s/ingress/open-webui-origins.yaml and names it in MANIFESTS_BY_STACK["llm"], and changes tests/gate/k8s_checks/host_overrides.py).
  2. Run uv run devops ci fail-to-pass --base origin/main.
  3. The command exits 1: k8s gate row: 5 of 114 cases failed on base, 0 of 114 on head, and it names 4 cases of unchanged modules (deploy_stack, monitoring, network_policies, ollama_service).
  4. In a checkout of origin/main with the changed test files of the head, uv run devops ci --check --only k8s fails only the 1 changed case. With the head stack_lifecycle.py copied into that checkout, it fails the same 5 cases as the replay.

Expected vs Actual Behavior

Expected: the base replay of a gate row imports devops-cli from the src/ of the base tree, so only the changed case fails on base, and the replay proves the fix.

Actual: the base replay imports devops-cli from the head, and the command exits 1.

Environment Diagnostics

  • DevOps CLI Version: 0.126.0
  • Execution Environment: devcontainer, a worktree of devops-cli at a fix branch

Logs, Traces, or Terminal Output

k8s gate row: 5 of 114 cases failed on base, 0 of 114 on head (tests/gate/k8s_checks/host_overrides.py).
A gate case of a check module that the fix does not change fails on base (k8s deploy_stack.check_prometheus_operator_crds_install_before_every_service_monitor, k8s monitoring.check_no_plain_service_sits_in_a_helm_namespace_without_owned_exemption, k8s network_policies.check_every_network_policy_has_a_deploy_stack_path_or_an_owned_exemption, k8s ollama_service.check_llm_stack_forwards_ollama_through_a_service_deploy_stack_creates). A gate case that fails on base must be in a check module that the fix adds or changes.

Proposed Fix

Start the gate row of each tree with <tree>/src first on the import path, for example PYTHONPATH=<tree>/src in the environment of _run_gate_row, as the pytest replay gets the source of the tree it runs on. Add a test that a gate row run on the base tree imports devops_cli from the base src/.

Activity

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

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

    @dan-petty
    OwnerAuthor

    The Fail-to-Pass Check of pull request #5357 (the fix of #5306) fails on GitHub Actions for this reason: https://github.com/dan-petty/devops-cli/actions/runs/43365674691/job/131689382605

    k8s gate row: 5 of 114 cases failed on base, 0 of 114 on head (tests/gate/k8s_checks/host_overrides.py).
    A gate case of a check module that the fix does not change fails on base (k8s deploy_stack.check_prometheus_operator_crds_install_before_every_service_monitor, k8s monitoring.check_no_plain_service_sits_in_a_helm_namespace_without_owned_exemption, k8s network_policies.check_every_network_policy_has_a_deploy_stack_path_or_an_owned_exemption, k8s ollama_service.check_llm_stack_forwards_ollama_through_a_service_deploy_stack_creates). A gate case that fails on base must be in a check module that the fix adds or changes.
    

    The pytest part of the same run proves the fix: the 4 changed tests fail on base, and check_open_webui_allows_only_the_origins_of_its_ingress_hosts fails on base and passes on head. The CI runner thus shows the same fault as the devcontainer.

  5. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 13, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  7. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 06:04 UTC

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/cisource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions