Repository navigation
Description
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
- Check out the branch of fix(k8s): Open WebUI allows every CORS origin #5306 (it adds
k8s/ingress/open-webui-origins.yamland names it inMANIFESTS_BY_STACK["llm"], and changestests/gate/k8s_checks/host_overrides.py). - Run
uv run devops ci fail-to-pass --base origin/main. - 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). - In a checkout of
origin/mainwith the changed test files of the head,uv run devops ci --check --only k8sfails only the 1 changed case. With the headstack_lifecycle.pycopied 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
dan-petty commentedon Nov 13, 2026
Both are defects where head code leaks into the base replay of devops ci fail-to-pass, but #4908 fixes the tests/ tree copy while the candidate fixes the src/ import path via PYTHONPATH.dan-petty commentedon Nov 13, 2026
The
Fail-to-Pass Checkof 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/131689382605The 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_hostsfails on base and passes on head. The CI runner thus shows the same fault as the devcontainer.devops-cli-service commentedon Nov 13, 2026
Released in v0.127.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.127.0
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 06:04 UTC