Skip to content

ci: enable branch coverage and upload coverage xml as artifact - #4031

Merged
dan-petty merged 2 commits into
mainfrom
ci/2163-enable-branch-coverage-and-upload-coverage
Nov 7, 2026
Merged

dan-petty merged 2 commits into
mainfrom
ci/2163-enable-branch-coverage-and-upload-coverage

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The coverage gate measures lines only, so an untested branch passes. CI writes .data/coverage.xml for diff-cover and then discards it, so a reviewer cannot see the per-file figures of a run.

This change sets branch = true in [tool.coverage.run], so coverage.py measures lines and branches. The aggregate Tests & Coverage job now uploads .data/coverage.xml as an artifact using actions/upload-artifact pinned to a commit SHA with a 7-day retention. A workflow contract test in tests/invariants/test_workflow_contracts.py verifies the step attributes, conditions, and order. CONTRIBUTING.md, docs/TESTING.md, and docs/SDLC.md are updated to state that the 85% floor measures lines and branches, and that the XML report is kept.

Closes #2163

Change: openspec/changes/archive/2026-11-07-2163-enable-branch-coverage-and-upload-coverage/

devops-cli-service Bot and others added 2 commits November 7, 2026 17:50
…2163)

Keep `.data/coverage.xml` as an artifact with a 7-day retention in the
aggregate `test` job of `ci.yml`. Add a workflow contract test in
`tests/invariants/test_workflow_contracts.py` that verifies the step
attributes and order. Update `CONTRIBUTING.md`, `docs/TESTING.md`, and
`docs/SDLC.md` to state that the 85% floor measures lines and branches,
and archive OpenSpec change 2163-enable-branch-coverage-and-upload-coverage.

Closes #2163
@dan-petty dan-petty changed the title ci: Enable branch coverage and upload coverage xml as artifact ci: enable branch coverage and upload coverage xml as artifact Nov 7, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 7, 2026 21:58
@dan-petty
dan-petty self-requested a review as a code owner November 7, 2026 21:58
@dan-petty

Copy link
Copy Markdown
Owner

Check results

Head commit: e4b04b6b69cc70a1e6da3246e1fcaaa396be49fd

Check Conclusion Link
Plan Check skipped run
Semantic PR title success run
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
Plan Check skipped run
CodeQL success run
Semantic PR title success run
Plan Check skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Analyze (actions) success run
Analyze (python) success run
DevContainer Image success run
Image Pins success run
Tests & Coverage (shard 4 of 4) success run
Tests & Coverage (shard 3 of 4) success run
Static Analysis success run
Tests & Coverage (shard 2 of 4) success run
Tests & Coverage (shard 1 of 4) success run
Docs Site Build success run
Changed-Test Independence success run
Third-Party Image Scan success run
Rule Pack Tests success run
Service Image success run
Runner Image success run
Semantic PR title success run

Skipped check: Plan Check
Skipped check: Plan Check
Skipped check: Plan Check
Skipped check: Dependency Freshness
Skipped check: Test Job Duration

@dan-petty
dan-petty merged commit 74ba76b into main Nov 7, 2026
28 checks passed
@dan-petty
dan-petty deleted the ci/2163-enable-branch-coverage-and-upload-coverage branch November 7, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(coverage): Enable branch coverage and upload coverage xml as artifact

1 participant