Repository navigation
[quality] lgtm removal no-op arms (onPrLgtm.ts:33 no-label synchronize, labels/lgtm.ts:106 /lgtm cancel without a commit binding) have 0 end-to-end hits #409
Description
Finding
Two lgtm removal arms that have nothing to unbind run only under unit tests; the shipped bundle never reaches them:
| arm | file:line | what a user does to reach it |
|---|---|---|
jobs: lgtm on a pull_request synchronize whose pull request carries no lgtm label — the labels are read and nothing is removed |
src/pullReq/onPrLgtm.ts:33 (else) |
push to any pull request that was never /lgtm'd, with jobs: lgtm in the workflow |
/lgtm cancel (or /remove-lgtm) when there is no commit binding to void: the label is removed and no prow/lgtm status is written |
src/labels/lgtm.ts:106 (else) |
lgtm.bind_to_commit: false in prow.yaml, or /lgtm cancel on a plain issue |
Evidence (main @ 20d49e7, Node v26.10.0):
- Unit:
npx vitest run --coverage→ 100 % lines, 99.82 % branches (124 files / 1994 tests). Both arms are green; the only residual branches areapprove.ts:417,505andauth.ts:259. - End-to-end:
npm run test:coverage:e2eon a scratch branch =origin/main+ the heads of all 15 open hold-gated bundle PRs (test(bundle): drive owners-label's early-return and failure arms through dist/index.js #298 … test(bundle): drive withdrawalReason's 'and N more' tail and no-withdrawer arm (approveReview.ts:105/120) through dist/index.js #408, all merge clean; 59 files / 425 tests pass) → 98.09 % lines ofsrc/. Branch hits:onPrLgtm.ts:33if=[2, 0],labels/lgtm.ts:106if=[2, 0]— the then-arms (label present / binding on) run, the else-arms never do. - No open PR claims them:
__tests__/bundle/pullReqJobsArms.test.tsdrives thelgtmjob's failed labels read;__tests__/bundle/lgtmBindingArms.test.tsdrives/lgtm cancel's failing reads and writes;bundle.test.ts:1374drivesbind_to_commit: falsefor thelabeledevent only.
Why it matters: these are the common no-op paths — every push to a pull request nobody has /lgtm'd goes through onPrLgtm.ts:33, and every repository running legacy label-only merging goes through lgtm.ts:106 on cancel. Only the unit suite (with labeling mocked) pins that they read the labels, remove nothing extra and never touch POST /statuses.
Recommendation
One deliverable — a bundle test (__tests__/bundle/lgtmRemovalNoopArms.test.ts) that drives through dist/index.js:
-
pull_requestsynchronize+jobs: lgtm, pull request labelledkind/bugonly → exit 0, noDELETE, calls = OWNERS reads, base probe,GET /issues/1 -
/lgtm cancelon a pull request underlgtm:\n bind_to_commit: false→GET /issues/1,DELETE /issues/1/labels/lgtm, config reads, then tide's sweep; noPOST /statuses/… -
/lgtm cancelon a plain issue carryinglgtm→ rootOWNERSprobe + membership reads,GET /issues/1,DELETE …/labels/lgtm, config reads; no/pulls/read, noPOST
Priority
- Impact: medium (unit-covered, no end-to-end coverage)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 20d49e7
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 9, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.