`comment.require_changes: coverage_drop` ignores the project status threshold
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
Bắt đầu từ HasEnoughRequiredChanges._check_coverage_drop trong apps/worker/services/notification/notifiers/comment/conditions.py, khoảng dòng 147-159, nơi ngưỡng được đọc từ coverage.status.project. Bản sửa cần xem bên trong các mục trạng thái có tên, như default, chứ không phải bản thân map. Chạy các unit test cho điều kiện của comment và kiểm tra rằng mức giảm coverage nhỏ hơn ngưỡng đã cấu hình không còn đăng comment nữa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 52
- Fork
- 25
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codecov/feedback
-
Bundle analysis: `normalizePath` replaces everything after the first `-` in a file name, so different assets collideCó thể đã có người làm @ChiptenIsCool đã nhận 16 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Docs Waiting for: Product Owner
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 42/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Tất cả issue của codecov/feedback
Issue tương tự
-
Grok provider voice list shows 5 of xAI's 28 built-in voicesCó thể đã có người làm @hkjarral đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
hkjarral/AVA-AI-Voice-Agent-for-Asterisk#883 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepCó thể đã có người làm @jgregoriorincon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
opengeos/RustGIS#2621 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:api bug finding
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Alexa HelpIntent and exception handler format HELP_MSG using audio data instead of the skill nameĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Hono path parameters with a regex pattern keep the pattern in the OpenAPI pathCó thể đã có người làm @0z5a đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
cloudflare/chanfana#400 ·
Maintainer thường phản hồi trong vòng 1 ngày