Repository navigation
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard worksource/agentFiled by an agenttype/infraType infra: the build, CI, images or clustervalue/mediumValue Medium
Description
Friction
The local gate's test row spends its last seconds writing coverage reports serially, and only CI reads one of them.
Evidence
- After the last test, pytest-cov's controller makes three report passes over all 579 source files, one after another, on the critical path. Timed in one process at load 23: 17.7s in total, of which term-missing took 11.6s and xml 8.8s. In two probed gate runs at load 30-40, the phase took 55s and 98s.
- Only CI's diff-cover step reads
coverage.xml. _clean_coverage_artifactsinsrc/devops_cli/commands/ci.pyglobs.coverage*, which also deletes the combined.data/.coverageonce it is over 60s old, although its docstring says it cleans worker files only.
Remedy
- The local gate writes no XML report. CI writes it with
uv run coverage xmlwhere diff-cover reads it. - The cleanup removes only the worker data files.
- The 90% threshold and the term report stay.
Acceptance criteria
- Tests first: the cleanup keeps the combined data file, and the local gate's pytest command carries no XML report.
- CI's diff-cover step still gets
coverage.xml. - The test row's time after the last test drops by the XML pass, measured before and after.
-
uv run devops cipasses.
Proposed design
Problem statement
The local CI gate writes a coverage XML report that only the CI pipeline reads, adding roughly 9 seconds (up to 55-98 seconds under load) to the critical path. The coverage artifact cleanup also deletes the combined .data/.coverage file when it is older than 60 seconds, contradicting its stated purpose of cleaning only worker files.
Acceptance criteria
- Criterion 1: The local gate's pytest command carries no --cov-report=xml flag.
Verification: Inspect the output of _resolve_pytest_cmd() in src/devops_cli/commands/ci.py and confirm the list contains no 'xml' entry. - Criterion 2: The cleanup function preserves the combined .data/.coverage file while still removing worker files.
Verification: Run the test that creates a .data/.coverage file and a .data/.coverage.host.pid worker file, call _clean_coverage_artifacts, and assert the combined file still exists while the worker file is gone. - Criterion 3: CI's diff-cover step still receives coverage.xml.
Verification: The CI workflow file contains a step that runs 'uv run coverage xml' before the diff-cover step, and diff-cover references coverage.xml. - Criterion 4: The test row's time after the last test drops by the XML report pass duration.
Verification: Measure 'uv run devops ci --only test' before and after the change; the after time is lower by approximately the XML generation time (about 9 seconds at load 23). - Criterion 5: uv run devops ci passes with all checks green.
Verification: Run 'uv run devops ci' and confirm exit code 0 and all checks show pass.
Key questions
- What glob pattern matches only worker files and not the combined .coverage data file?: Worker files are named .coverage.., so the pattern .coverage.* (with a literal dot before the wildcard) matches them. The bare .coverage file does not match because it has no character after the dot. [sources: src/devops_cli/commands/ci.py:414]
- Where in the CI workflow does diff-cover read coverage.xml?: The issue body states that only CI's diff-cover step reads coverage.xml. The exact workflow file is not in the provided context, but the remedy specifies that CI writes it with 'uv run coverage xml' in the step before diff-cover. [sources: src/devops_cli/commands/ci.py]
- Should the coverage.xml deletion in _clean_coverage_artifacts stay?: Yes. The local gate no longer generates coverage.xml, so a stale one from a prior run is safe to remove. CI generates its own copy in its own step. (proposed)
- Does the 90% coverage threshold and the term-missing report stay in the local gate?: Yes. The remedy explicitly states the 90% threshold and the term report stay. Only the XML report is removed from the local gate. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard worksource/agentFiled by an agenttype/infraType infra: the build, CI, images or clustervalue/mediumValue Medium
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 20, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate improves CI performance by changing how coverage reports are handled.This change addresses a performance issue in the CI pipeline that impacts developer productivity and build times.Improving CI speed benefits all developers and reduces build time overhead, but it's not critical to core functionality or security.Requires modifying both local gate and CI configurations to change coverage reporting behavior and cleanup logic.dan-petty commentedon Oct 28, 2026
Status set to Ready at 4da1e34 (see proposed design in issue body).
chore(main): release 0.13.0 (#2581)