Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[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

クローズ
#436 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@hivecommons-hive がすでに取り組んでいます。

2026年10月10日 から。

  • #437 @hivecommons-hive による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
github-actions, typescript
領域
ci-cd, testing-qa

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
132
フォーク
24
平均マージ
1日 17時間
マージ済み PR(30日)
219

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cncf/prow-github-actions のほかの issue

cncf/prow-github-actions の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。