Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[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

Open
#436 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@hivecommons-hive is already working on this.

Since Oct 10, 2026.

  • #437 by @hivecommons-hive — open

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

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing

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:40 is green only through __tests__/run.test.ts, which vi.mocks every handler module and makes the mock reject.
  • End-to-end: npm run test:coverage:e2e on 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.ts 88.88 % lines, line 40 has 0 hits. It is the only uncovered line in src/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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/prow-github-actions

All issues in cncf/prow-github-actions

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.