Report and enforce coverage non-regression for src Python changes

Đang mở
#4,786 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
50/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, python

Hướng nghiên cứu

Read the existing pytest CI configuration first, then inspect the coverage settings and the documented guidance in AGENTS.md and CONTRIBUTING.md. Trace how pull requests identify changes under src/**/*.py and how main pushes are handled. Done means comparable base-versus-PR reports, an unrounded non-regression check with human-controlled exceptions, retained artifacts, and updated documentation without removing the cross-platform test matrix.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

triage-can-wait

Problem

Spec Kit requires tests for behavioral changes and regression evidence for bug fixes, but CI currently runs pytest without collecting or comparing code coverage. pytest-cov and coverage configuration already exist. Without a comparable base-versus-PR measurement, coverage regressions can pass unnoticed.

Proposed policy

For pull requests that change src/**/*.py, Python code coverage must not decrease relative to the base revision. A decrease requires human intervention: restore coverage before merging, or have a maintainer explicitly review and document an exceptional decision. Agents must not waive a decrease on their own.

Pull requests that do not change src/**/*.py are exempt from the coverage comparison. Existing behavioral and regression test requirements continue to apply to executable changes elsewhere.

Implementation

  • Add one canonical coverage CI job with a fixed OS and Python version, while retaining the existing cross-platform test matrix.
  • On relevant PRs, run coverage on the base and PR revisions under comparable conditions. Report both coverage values and their covered/coverable line counts in the Actions summary; retain the reports as artifacts.
  • Compare unrounded coverage ratios rather than displayed percentages, and fail the check on a decrease. Make any exception path explicitly human-controlled and documented; do not let an agent silently skip or override the check.
  • On pushes to main, publish the coverage report without attempting a PR comparison.
  • Document the policy in AGENTS.md and the measurement and intervention procedure in CONTRIBUTING.md.

Acceptance criteria

  • In-scope PRs receive a base-versus-PR coverage report and a passing or failing non-regression check.
  • PRs without changes to src/**/*.py do not need a coverage comparison and do not fail due to a skipped comparison.
  • Coverage decreases cannot be silently accepted or waived by an agent; human intervention is required.
  • The existing cross-platform tests and positive/negative and bug-regression test requirements remain in place.

AI disclosure

Drafted with GitHub Copilot (GPT-6 Sol) in an interactive, human-supervised conversation; the requester directed the scope and revised the policy. Reasoning effort was not specified. AI assistance was limited to drafting this issue; no code changes were made.

Ngôn ngữ chính
Python
Star
149k
Fork
13.4k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
223

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/spec-kit

Tất cả issue của github/spec-kit

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.