[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 hit

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

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

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

2026年10月10日 から。

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

評価

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

調査の方向性

Start with handleIssueComment.ts around lines 164/180 and the existing tests at __tests__/bundle/bundle.test.ts:173 and __tests__/bundle/requireMatchingLabelArms.test.ts:167. Add the combined-command case and its enabled-but-absent sibling, then confirm one issue read, one needs-kind write, and one comment where applicable; note that linked PR #445 is already open.

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

説明

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

Finding

After a label-writing command, handleIssueComment sweeps the require_matching_label rules itself, because the bot's own label write fires no labeled event. When the same comment also carries /check-required-labels and the workflow enables that command, the rules were just evaluated by the command, so the sweep skips the second evaluation:

const alreadyChecked = commandConfig.includes('/check-required-labels') && hasCommand('/check-required-labels', commentBody)   // handleIssueComment.ts:164
failures.push(...await sweep(context, alreadyChecked))
…
...(alreadyChecked ? [] : [() => checkRequiredLabels(context)]),   // handleIssueComment.ts:180

That is a user-visible behaviour (one GET /issues/N, one needs-* write, one comment instead of two of each), but no bundle test combines /check-required-labels with a label-writing command. __tests__/bundle/bundle.test.ts:173 and requireMatchingLabelArms.test.ts:167 run /check-required-labels alone (no sweep, since it is not a label-writing command), and __tests__/bundle/commentWithoutBody.test.ts (#429) lists it in prow-commands with no body at all.

Evidence (main @ d0b1d87, Node v26.10.0, vitest vitest/5.0.3 linux-x64 node-v26.10.0):

  • Unit: npx vitest run --coverage → 100 % lines, 99.82 % branches (142 files / 2073 tests); handleIssueComment.ts fully covered by __tests__/issueCommentTest/ through the TypeScript sources.
  • End-to-end: npm run test:coverage:e2e on a scratch branch = origin/main + the heads of the 9 open hold-gated PRs (#423 … #439; 69 files / 447 tests pass) → 98.65 % lines of src/; handleIssueComment.ts branch residual 91,164,180,217. The alreadyChecked === true arm at 164/180 has 0 hits. The same run on bare main (438 tests) reports the same residual.
  • Reachability: any workflow whose prow-commands lists /check-required-labels together with /hold, /lgtm, /approve, /remove, /ok-to-test or a label-section command, on a comment that spells both — a normal thing to type when fixing a needs-kind complaint.

Priority 2 under the coverage evidence rules: covered by unit tests, not by end-to-end tests.

Recommendation

  • add a bundle test that configures a require_matching_label rule and runs /hold + /check-required-labels in one comment with both commands enabled, asserting exactly one issue read / one needs-kind write / one comment, plus the sibling case (/check-required-labels enabled but absent from the body) where the sweep still evaluates the rules

Disjoint from #423, #425, #427, #429, #431, #433, #435, #437 and #439: none of them touch handleIssueComment.ts:164/180, and the new file does not overlap theirs.

Priority

  • Impact: medium
  • 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
スター
135
フォーク
24
平均マージ
1日 6時間
マージ済み PR(30日)
232

環境構築

はじめの一歩

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

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

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

似ている issue

TypeScript の issue をもっと見る

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

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