`comment.require_changes: coverage_drop` ignores the project status threshold
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 62/100
Direzione di ricerca
Inizia da HasEnoughRequiredChanges._check_coverage_drop in apps/worker/services/notification/notifiers/comment/conditions.py, intorno alle righe 147-159, dove la soglia viene letta da coverage.status.project. La correzione deve guardare dentro le voci di stato con nome, come default, e non nella mappa stessa. Esegui i test unitari per le condizioni del commento e verifica che un calo di copertura inferiore alla soglia configurata non pubblichi più il commento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 52
- Fork
- 25
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codecov/feedback
-
Bundle analysis: `normalizePath` replaces everything after the first `-` in a file name, so different assets collideForse già presa @ChiptenIsCool l’ha presa 16 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Docs Waiting for: Product Owner
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Tutte le issue di codecov/feedback
Issue simili
-
Grok provider voice list shows 5 of xAI's 28 built-in voicesForse già presa @hkjarral l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
hkjarral/AVA-AI-Voice-Agent-for-Asterisk#883 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepForse già presa @jgregoriorincon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opengeos/RustGIS#2621 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:api bug finding
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Alexa HelpIntent and exception handler format HELP_MSG using audio data instead of the skill nameAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathForse già presa @0z5a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
cloudflare/chanfana#400 ·
I maintainer di solito rispondono entro 1 giorno