[quality] lgtmBinding.ts failure arms and /lgtm cancel failures are never driven through dist/index.js
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #318 @hivecommons-hive による — マージ済み
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- github-actions, typescript
- 領域
- testing
調査の方向性
Read the existing tests under __tests__/bundle and the behavior in src/plugins/lgtmBinding.ts and src/labels/lgtm.ts. Add __tests__/bundle/lgtmBindingArms.test.ts to exercise the listed failure cases through dist/index.js, then run npm run test:coverage:e2e. Done means the specified cases pass and the reported e2e coverage targets are met; pull request #318 is already open.
索引モデルが issue の本文から書いたものです。
説明
Finding
The lgtm-to-commit binding (src/plugins/lgtmBinding.ts) and the /lgtm command (src/labels/lgtm.ts) are fully covered by the unit suite, but the end-to-end bundle suite (__tests__/bundle, run against the shipped bundle with npm run test:coverage:e2e) never reaches their failure arms:
| file | e2e lines (main @ 3fc21f2) | uncovered |
|---|---|---|
src/plugins/lgtmBinding.ts |
88.63 % | 73 (createCommitStatus fails for a reason other than 403), 117–118 (getCombinedStatusForRef fails, 403 hint and plain), 143 (stale-lgtm comment fails, warned), 168 (labeled payload without pull_request.head) |
src/labels/lgtm.ts |
88.88 % | 68 (bind failure becomes a refusal), 91 (/lgtm cancel labels read fails), 103 (/lgtm cancel removal refused), 145 (refusal comment itself fails) |
These are the arms where the binding is the merge gate's safety: a status write or read that fails for an unexpected reason must fail the run (not silently merge or strip), and a failed stale-lgtm comment must not fail the run. Only dist/index.js proves how handleIssueComment/handlePullReq and tide's post-command sweep compose in those cases.
Evidence
- Unit:
npx vitest run --coverageonmain@ 3fc21f2 — 80 files / 1639 tests; both files at 100 % lines. - E2E:
npm run test:coverage:e2eonmain@ 3fc21f2 — 5 files / 142 tests; figures above. - The two runs are reported separately on purpose (see
vitest.e2e-coverage.config.mjs): their statement maps come from different transforms and do not line-merge, so this finding states each source on its own.
Recommendation
Add one bundle suite, __tests__/bundle/lgtmBindingArms.test.ts, that drives through dist/index.js:
-
/lgtmby a member reviewer whenPOST /statuses/{sha}answers 500: refused withcould not bind lgtm to …, no label applied, sweep still runs - the same when the refusal comment also fails: both errors logged, run fails
-
/lgtm cancelwhenGET /issues/1fails and whenDELETE /issues/1/labels/lgtmfails: run fails naming the step, nothing unbound -
pull_requestlabeledlgtm by a human whenGET /commits/{sha}/statusanswers 500 and 403: run fails naming the read (403 namesstatuses: write), nothing merged or stripped -
pull_requestlabeledlgtm by a bot when the stale-lgtm comment read fails: label stripped, status set pending, failure is a warning, run passes -
pull_requestlabeledlgtm whose payload has nopull_request.head: run fails, no status written
Expected result: lgtmBinding.ts 100 % e2e lines; labels/lgtm.ts 97.8 % (line 39, the missing-issue-number guard, is unreachable from handleIssueComment).
Priority
- Impact: medium — unit-covered, not e2e-covered; the arms guard the merge gate
- Effort: low — one new test file, no production or harness changes
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- 主要言語
- TypeScript
- スター
- 132
- フォーク
- 24
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 240
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cncf/prow-github-actions のほかの issue
-
hive/advisory kind/cleanup
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
cncf/prow-github-actions#170 · コメント 9 件 ·
メンテナーはふだん 1 日以内に返信
cncf/prow-github-actions の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliusBrussee/caveman#1449 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
linagora/twake-calendar-frontend#1924 ·
メンテナーはふだん 1 日以内に返信
-
Add: Class TV Modaオープンcheck:passed streams:add
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
GiganticMinecraft/seichi-playguide#183 ·
メンテナーはふだん 1 日以内に返信