ci: enforce coverage quality gates#2161
Merged
Merged
Conversation
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Contributor
📝 WalkthroughWalkthroughCoverage reporting and enforcement are tightened across Codecov configuration and the reusable test workflow. Patch and project thresholds, change requirements, and pytest coverage arguments are updated. ChangesCoverage enforcement
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Pouyanpi
force-pushed
the
pouyanpi/coverage-threshold
branch
from
July 10, 2026 14:42
f0a2ab1 to
f79a529
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change turns the existing package coverage signal into a staged quality
gate now that the full test suite consistently reports approximately 86%
coverage.
It makes the following changes:
pytest-cov's
--cov-fail-underoption.measured total and failure reason are visible directly in CI logs.
commit using
target: auto, and permits a 0.25 percentage-point tolerance.during the initial observation period.
to reduce comments that do not require contributor attention.
The absolute 85% CI floor protects against a large package-wide regression even
when no usable Codecov base report is available. The relative Codecov project
status prevents gradual erosion from the current baseline. The patch target
encourages changed code to exceed the historical package average without making
that new policy a merge gate before its behavior has been observed across
representative pull requests.
The coverage run remains limited to the existing Ubuntu/Python 3.11 matrix entry
in
.github/workflows/pr-tests.yml; this avoids repeating an equivalent coveragemeasurement across the full Python compatibility matrix.
References
Status Checks
Common Configurations
coverage_dropanduncovered_patch:Pull Request Comments
Codecov YAML
--cov-fail-underand multiple report formats:Configuration
terminal report:
Reporting
Verification
uv run --locked pre-commit run --files .github/codecov.yml .github/workflows/_test.ymlcurl --fail-with-body --silent --show-error --data-binary @.github/codecov.yml https://api.codecov.io/validateValid!and normalized the configured project and patchstatuses as expected.
make test-coverage ARGS="--cov-fail-under=85 --cov-report=term"git diff --checkResidual CI-specific behavior will be exercised by the PR's canonical Ubuntu,
Python 3.11 coverage job. The 90% patch target is intentionally informational;
promoting
codecov/patchto a required check should be a separate maintainerdecision after observing representative PRs. Repository branch protection was
not modified by this change.
Checklist
Summary by CodeRabbit
Tests
Chores