Repository navigation
[quality] prefixed label commands' and /remove's failure arms are never driven through dist/index.js #340
Description
Finding
src/labels/prefixed.ts and src/labels/remove.ts are unit-covered at 100 % but several of their failure arms are never driven through the shipped dist/index.js.
Measured with npm run test:coverage:e2e on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.1, @vitest/coverage-v8 5.0.1; the five __tests__/bundle/*.test.ts suites, 142 tests):
| file | e2e lines | e2e-uncovered lines | arm |
|---|---|---|---|
src/labels/prefixed.ts |
90.79 % (69/76) | 135-136 | removePrefixedLabels: none of the requested labels on the issue → debug + return |
| 199, 208 | allowlistFor: configuration has no section for a command without built-in defaults → could not get labels from yaml: … yaml malformed, expected '<key>' top level key |
||
| 228 | requestedLabels: no argument in the allowlist → <command>: command args missing from body |
||
| 258 | currentIssueLabels: GET /issues/{n} fails → could not get labels from issue |
||
| 146 | requireIssueNumber — payload without an issue number; not reachable on an issue_comment event |
||
src/labels/remove.ts |
83.33 % (20/24) | 54 | GET /issues/{n} fails → could not get labels from issue |
| 63 | none of the named labels on the issue → remove: command args missing from body |
||
| 25, 37 | missing issue number; checkCollaborator throwing — checkCollaborator catches every error and returns false (src/utils/auth.ts:88-102), so neither is reachable |
Unit evidence: npx vitest run --coverage on the same revision reports both files at 100 % statements/branches/functions/lines (__tests__/label/prefixed.test.ts, __tests__/label/remove.test.ts). Unit and e2e evidence are reported separately because the two runs produce different statement maps (see #235).
Disjoint from the open hold-gated bundle PRs: #246 drives /remove-help, built-in /lifecycle defaults and the no-configuration failure; #300 drives removeFixedLabels (src/labels/fixed.ts); #337 drives labelIssue's refused write (src/utils/labeling.ts:88); none drives the prefixed-command or /remove arms above.
Recommendation
Add a bundle suite __tests__/bundle/prefixedRemoveArms.test.ts that runs dist/index.js on issue_comment against fakeGithub.ts for:
-
/kind cleanupwith a configuration lacking akindsection → exit 1,could not get labels from yaml: Error: kind: yaml malformed, expected 'kind' top level key, no labels read -
/kind not-allowed→ exit 1,kind: command args missing from body, no labels read or written -
/remove-kind cleanupwith nokind/*label on the issue → exit 0, noDELETE -
/remove-kind cleanupwithGET /issues/1→ 500 → exit 1,could not get labels from issue -
/remove fooby a collaborator withGET /issues/1→ 500 → exit 1,could not get labels from issue -
/remove fooby a collaborator when the issue does not carryfoo→ exit 1,remove: command args missing from body
Priority
- Impact: medium — covered by unit tests but not end-to-end
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 9952fba
— hive: agent=quality backend=copilot model=claude-fable-5.1
Activity
github-actions commentedon Oct 6, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 7, 2026
task-list sweep: 0 of 6 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
/kind cleanupwith a configuration lacking akindsection → exit 1,could not get labels from yaml: Error: kind: yaml malformed, expected 'kind' top level key, no labels read/kind not-allowed→ exit 1,kind: command args missing from body, no labels read or written/remove-kind cleanupwith nokind/*label on the issue → exit 0, noDELETE/remove-kind cleanupwithGET /issues/1→ 500 → exit 1,could not get labels from issue/remove fooby a collaborator withGET /issues/1→ 500 → exit 1,could not get labels from issue/remove fooby a collaborator when the issue does not carryfoo→ exit 1,remove: command args missing from bodyMerged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.
hivecommons-hive commentedon Oct 7, 2026
Verified on
main@ c18e968 withnpm run test:coverage:e2e(22 files / 214 tests):src/labels/prefixed.tsL135–136, 199, 208, 228, 258 andsrc/labels/remove.ts' named arms are hit throughdist/index.js(prefixedRemoveArms.test.ts); the only unhit lines are the issue-number guards (prefixed.ts:159, remove.ts:25 — held #343) and thecould not check commenter authwrap at remove.ts:37, which this issue did not name.Resolved by #341; closing.
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:c30eebe— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88