`comment.require_changes: coverage_drop` ignores the project status threshold
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start with HasEnoughRequiredChanges._check_coverage_drop in apps/worker/services/notification/notifiers/comment/conditions.py, around lines 147-159, where the threshold is read from coverage.status.project. The fix needs to look inside the named status entries such as default, not the map itself. Run the unit tests for the comment conditions, and check that a drop smaller than the configured threshold no longer posts the comment.
Written by the indexing model from the issue text.
Description
Describe the bug
The pull request comment docs say that coverage_drop "respects project status threshold, if configured (i.e. drop needs to be bigger than the configured threshold for the comment to be posted)". It does not: with a valid threshold configured, a comment is posted on any drop of more than 0.01%.
HasEnoughRequiredChanges._check_coverage_drop (conditions.py#L147-L159) reads the threshold one level too high:
project_status_config = read_yaml_field(
comparison.comparison.current_yaml, ("coverage", "status", "project"), {}
)
threshold = 0
if isinstance(project_status_config, dict):
threshold = Decimal(project_status_config.get("threshold", 0))
coverage.status.project is a map of named statuses (user_schema.py#L405-L418), so threshold lives under a status name such as default. project_status_config.get("threshold") therefore always returns the default 0. The shape the unit tests use, {"coverage": {"status": {"project": {"threshold": 10}}}}, is rejected by the validator: Error at ['coverage', 'status', 'project', 'threshold']: must be of ['dict', 'boolean'] type.
To Reproduce
-
Use this
codecov.yml(the validator accepts it and parses the condition to[6]):coverage: status: project: default: threshold: 0.5% comment: require_changes: "coverage_drop OR uncovered_patch" -
On a pull request with no existing Codecov comment and reports for both base and head, upload coverage that lowers project coverage by more than 0.01 but less than 0.5 percentage points, with no uncovered changed lines.
-
Codecov posts the comment. In umputun/remark42#2390, coverage went from 78.58% to 78.56% (-0.03%),
codecov/projectpassed,codecov/patchreported "Coverage not affected", and the comment was posted.
Expected behavior
No initial comment, because the project coverage drop is below the configured 0.5 percentage-point threshold and no changed lines are uncovered.
- Dominant language
- No language data
- Stars
- 52
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from codecov/feedback
-
Bundle analysis: `normalizePath` replaces everything after the first `-` in a file name, so different assets collidePossibly taken @ChiptenIsCool claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Docs Waiting for: Product Owner
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 4/5 1-2 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in codecov/feedback
Similar issues
-
Grok provider voice list shows 5 of xAI's 28 built-in voicesPossibly taken @hkjarral claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
hkjarral/AVA-AI-Voice-Agent-for-Asterisk#883 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPossibly taken @jgregoriorincon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opengeos/RustGIS#2621 · 1 comment ·
Maintainers usually reply within 1 day
-
area:api bug finding
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Alexa HelpIntent and exception handler format HELP_MSG using audio data instead of the skill nameOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathPossibly taken @0z5a claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloudflare/chanfana#400 ·
Maintainers usually reply within 1 day