[quality] approve.github_review refusal paths in src/plugins/approveReview.ts are unit-covered but never driven through dist/index.js
Maintainer thường phản hồi trong vòng 2 ngày
Một pull request liên quan đã được merge.
- #286 của @hivecommons-hive — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- build-system, testing
Hướng nghiên cứu
Start with src/plugins/approveReview.ts and the existing tests/bundle suite; run npm run test:coverage:e2e to see the current bundle coverage. Add cases that drive /approve and /approve cancel through dist/index.js, then verify each warning or ::error:: result, exit status, and that the approved label write happens first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Finding
src/plugins/approveReview.ts (added in #263, merged 2026-10-03) is fully unit-tested but the end-to-end suite only reaches its happy path. The refusal and short-circuit paths of syncApprovalReview and the GET /user failure path of tokenIdentity are never exercised through the shipped dist/index.js:
createReviewanswered 422 "not permitted to approve pull requests" →notPermittedWarning(L203–206)createReviewanswered any other 403 →forbiddenWarning(L208–210)createReviewanswered 422 "approve your own pull request" → self-approval warning (L203–205)createReviewanswered any other error →could not submit the approval review, run fails (L212–214)- token is a user who authored the PR → warning, no review attempted (L185–186)
- draft PR → no review submitted (L173)
- own review already on the head → nothing submitted (L164–165)
dismissReviewrefused on/approve cancel→could not dismiss the approval review <id>, run fails (L181–182)GET /useranswers neither 2xx nor 403/404 →could not identify the token for approve.github_review, run fails (L42)
docs/commands.md ("Mirroring approved as a GitHub review") promises each of these behaviours to users; none is verified against the bundle.
Evidence
- Unit:
npx vitest run --coverageonmain@ 3fc21f2 (Node v26.10.0, vitest 5.0.1):approveReview.ts100 % stmts / 100 % branch / 100 % funcs / 100 % lines (1648 tests). - End-to-end:
npm run test:coverage:e2eonmain@ 3fc21f2 (the config #274 added; 142 tests in__tests__/bundle):approveReview.ts64.19 % stmts / 52 % branch / 78.57 % funcs / 65.38 % lines; uncovered lines 42, 101, 111, 156–157, 164–165, 173, 181–182, 185–186, 189–190, 203–216, 222, 230 (from the run'slcov.info). - The two figures are reported separately on purpose (see #235: the vite and tsc+webpack statement maps do not line-merge); the per-line list above is the e2e one.
Recommendation
- Add a bundle suite that drives
/approveand/approve cancelthroughdist/index.jswithapprove.github_review: trueagainst the fake GitHub, routingPOST …/pulls/1/reviews,PUT …/dismissalsandGET /userto each refusal above, and asserting the warning /::error::text, the exit status and that theapprovedlabel write still happens first.
Priority
- Impact: medium (covered by unit tests, not end-to-end; feature merged today — regression risk)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- Ngôn ngữ chính
- TypeScript
- Star
- 132
- Fork
- 24
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 229
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 cncf/prow-github-actions
-
[quality] worker.ts scheduled(), queue consumer and deferViaQueue run under no test (unit excludes the file; miniflare suite only drives fetch())Có thể đã có người làm @hivecommons-hive đã nhận hôm nay. Đang mởagent/quality needs-kind stage/040-covered-by-pr testing
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
cncf/prow-github-actions#629 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[quality] Helm chart: ingress.yaml is rendered by no helm-unittest suite and by neither kind install; serviceaccount/configmap/service and the apiUrl, extraEnv, image.tag, create=false arms are unassertedCó thể đã có người làm @hivecommons-hive đã nhận 1 ngày trước. Đang mởagent/quality needs-kind stage/040-covered-by-pr testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 30/100
cncf/prow-github-actions#625 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[quality] Gate proposal: scheduled Stryker run over the whole src/ tree (five advisory shards)Đang mởagent/quality needs-human needs-kind stage/045-needs-decision testing
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
cncf/prow-github-actions#594 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
🐝 Hive Advisory ReportĐang mởhive/advisory kind/cleanup needs-human stage/045-needs-decision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
cncf/prow-github-actions#170 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của cncf/prow-github-actions
Issue tương tự
-
area: triage theme: undefined
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
jhipster/generator-jhipster#35895 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
paperclipai/paperclip#18396 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
lingdojo/kana-dojo#33380 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore other
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
alastair-smith/card-games#342 ·
Maintainer thường phản hồi trong vòng 1 ngày