[quality] run()'s last-resort catch (src/run.ts:40) has 0 e2e hits — no bundle test drives a handler rejection through dist/index.js
Maintainer thường phản hồi trong vòng 1 ngà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
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- github-actions, typescript
- Lĩnh vực
- ci-cd, testing-qa
Hướng nghiên cứu
Start with src/run.ts, src/utils/events.ts, and the existing bundle tests, then add __tests__/bundle/runHandlerRejection.test.ts. Run the bundled action through dist/index.js with the specified numeric issue_comment body and confirm exit status 1, one ::error:: message, no unhandled-rejection output, and no API request. An open linked pull request already targets this work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Finding
run() (src/run.ts:29-42) wraps the event dispatch in try { … } catch (error) { core.setFailed(…) }. That catch is the action's last-resort error reporter: it is what turns an exception no handler anticipated into a failed step with a message instead of an unhandled rejection or a silent exit 0.
Evidence (main @ d0b1d87, Node v26.10.0, vitest 5.0.3):
- Unit:
npx vitest run --coverage→ 100 % lines (142 files / 2073 tests).run.ts:40is green only through__tests__/run.test.ts, whichvi.mocks every handler module and makes the mock reject. - End-to-end:
npm run test:coverage:e2eon a scratch branch =origin/main+ the heads of the 7 open hold-gated bundle PRs (#423, #425, #427, #429, #431, #433, #435; 67 files / 444 tests pass) →run.ts88.88 % lines, line 40 has 0 hits. It is the only uncovered line insrc/run.ts.
Why it has no e2e hits: every registered handler reports its own failures (runEventHandlers in src/utils/events.ts:52-64, handleCronJobs .catch at handleCronJob.ts:69, handleIssueComment's per-command .catch(normalizeError) at handleIssueComment.ts:134-148). The one bundle-reachable path is an exception a handler never anticipated: handleIssueComment.ts:117 folds only null/undefined comment.body to '', so a non-string body (e.g. 42) reaches splitLines() (src/utils/command.ts:159), whose body.replace throws a TypeError inside the Promise.all map, rejecting the handler.
Recommendation
One bundle test (__tests__/bundle/runHandlerRejection.test.ts) that runs dist/index.js on an issue_comment payload whose comment.body is a number and an object, with prow-commands: /assign, and asserts: exit status 1, exactly one ::error:: carrying .replace is not a function, no unhandled-rejection text on stderr, and no API request.
- add
__tests__/bundle/runHandlerRejection.test.ts
Priority
- Impact: medium (the catch is the only guard between a handler bug and an unhandled rejection in the shipped action)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: d0b1d87
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- Ngôn ngữ chính
- TypeScript
- Star
- 135
- Fork
- 24
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 232
Chuẩn bị môi trường
- Có Dockerfile hoặc 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
-
agent/quality kind/cleanup stage/045-needs-decision testing
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 15/100
cncf/prow-github-actions#672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[quality] chart: CronJob name exceeds the 52-character API limit for release names of 32+ characters; no test pins resource-name lengthCó thể đã có người làm @mrbobbytables đã nhận 2 ngày trước. Đang mởagent/quality kind/cleanup stage/040-covered-by-pr testing
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 50/100
cncf/prow-github-actions#667 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐝 Hive Advisory ReportĐang mởhive/advisory kind/cleanup
Độ 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 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cncf/prow-github-actions
Issue tương tự
-
cloudflare-cache-binding: `unstorage://` keys are rejected by the Cache API, cache never storesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 2 ngày
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anomalyco/opencode#62052 · 1 bình luận ·
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 68/100
strapi/design-system#2084 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày