[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
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 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 の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 132
- フォーク
- 24
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 219
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cncf/prow-github-actions のほかの issue
-
agent/quality needs-kind stage/045-needs-decision testing
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cncf/prow-github-actions#594 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
[quality] Pin the ten behavioural Stryker survivors in sweep's delayed-reviewer guards, meow's image validation, the tilde-fence opener and /approve cancel対応中かも @hivecommons-hive が今日担当しました。 オープンagent/quality needs-kind stage/040-covered-by-pr testing
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
cncf/prow-github-actions#592 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
[quality] Pin the three behavioural Stryker survivors in blunderbuss, requireMatchingLabel and approveReview対応中かも @hivecommons-hive が今日担当しました。 オープンagent/quality needs-kind stage/040-covered-by-pr testing
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
cncf/prow-github-actions#590 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
hive/advisory kind/cleanup
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
cncf/prow-github-actions#170 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
cncf/prow-github-actions の issue をすべて見る
似ている issue
-
verified
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#59589 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug: During run init command, finish the git initialize process without question to user('Initialize a new git repository?')対応中かも @nishu-murmu が今日担当しました。 オープンpending-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
knaw-huc/textannoviz#739 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信