[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
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, testing-qa
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 132
- Forks
- 23
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 155
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/prow-github-actions
-
[quality] checkOrgMember's missing payload.repository guard (auth.ts:43-45) is reached by no bundle testPossibly taken @hivecommons-hive claimed this 1 day ago. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cncf/prow-github-actions#446 · 1 comment ·
Maintainers usually reply within 2 days
-
[quality] handleIssueComment.ts:164/180 — the sweep's alreadyChecked skip (a comment carrying both /check-required-labels and a label command) has no end-to-end hitPossibly taken @hivecommons-hive claimed this 1 day ago. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 1/5 Under an hour Newbie friendliness 35/100
cncf/prow-github-actions#444 · 1 comment ·
Maintainers usually reply within 2 days
-
[quality] pullRequestOwners.load's null-field folds (pullRequestOwners.ts:92-97: user, requested_reviewers, assignees, labels) never run from dist/index.jsPossibly taken @hivecommons-hive claimed this 1 day ago. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
cncf/prow-github-actions#438 · 1 comment ·
Maintainers usually reply within 2 days
-
[quality] labelSync drift never sees a null label description through dist/index.js (labelSync.ts:133 `current.description ?? ''` arm)Possibly taken @hivecommons-hive claimed this 1 day ago. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 1/5 1-3 hours Newbie friendliness 30/100
cncf/prow-github-actions#434 · 1 comment ·
Maintainers usually reply within 2 days
-
[quality] getCurrentLabels' bare-string label arm (labeling.ts:148) is unit-only; no bundle test serves a non-object labelPossibly taken @hivecommons-hive claimed this 2 days ago. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
cncf/prow-github-actions#432 · 1 comment ·
Maintainers usually reply within 2 days
All issues in cncf/prow-github-actions
Similar issues
-
area:deploy task
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wilanis/wilanis-js#1017 ·
Maintainers usually reply within 1 day
-
documentation v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/servers#5133 ·
Maintainers usually reply within 1 day
-
budget bug feature frontend good-issue medium needs-review OSCI'26 payments
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
SatyamPandey-07/WorkSphere#5990 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lugassawan/swe-workbench#799 ·
Maintainers usually reply within 1 day
-
bug good first issue javascript
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yukikotani231/sqlsift#326 ·
Maintainers usually reply within 1 day