Repository navigation
[quality] /hold cancel's no-label, failed-read and failed-removal arms in src/labels/hold.ts are unit-only #325
Description
Finding
src/labels/hold.ts cancelHold has four arms that only the unit suite reaches; the bundle (end-to-end) suite never drives them through the committed dist/index.js:
| arm | hold.ts lines | unit | e2e |
|---|---|---|---|
| no hold label present → debug + return, no DELETE | 67–69 | covered | 0 hits |
labels read fails → could not get labels from issue |
60–61 | covered | 0 hits |
label removal fails → could not remove the hold label |
75–76 | covered | 0 hits |
| one DELETE answers 404 (label gone between read and removal) → benign, run succeeds | src/utils/labeling.ts 202–203 |
covered | 0 hits |
The only existing bundle /unhold case (__tests__/bundle/bundle.test.ts, "removes do-not-merge/hold and the legacy hold label when /hold is configured") has both labels present and every write accepted; #293's holdSweepSettings covers the configured hold.label cancel, also with the label present.
Evidence (main @ 3fc21f2, Node v26, vitest 5.0.3):
- Unit:
npx vitest run --coverage→src/labels/hold.ts100 % lines (per-file unit coverage is saturated on this SHA). - End-to-end:
npm run test:coverage:e2e→src/labels/hold.ts80 % lines (20/25), 81.81 % branches;src/utils/labeling.ts73.07 % lines. Zero-hit statements read fromcoverage-final.jsonof that run. - The two runs cannot be line-merged (different transforms, see [quality] the bundle e2e suite's coverage of src/ is never captured — runBundle.ts drops NODE_V8_COVERAGE and dist/ has no source map #235); the figures above are per-suite.
Recommendation
- Add a bundle suite (
__tests__/bundle/holdCancelArms.test.ts) that runs/hold cancel,/unholdand/remove-holdwith no hold label, withGET /issues/1→ 500, with the labelDELETE→ 500, and with oneDELETE→ 404, asserting exit status, the error cause and the exact request sequence.
Expected after the fix: src/labels/hold.ts e2e 96 % lines / 90.9 % branches — the remaining line is the missing-issue-number throw, which the API cannot produce.
Priority
- Impact: medium — covered by unit tests, not by the bundle suite (priority 2 per the coverage evidence rules)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3586e39
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 5, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 9, 2026
task-list sweep: 0 of 1 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
__tests__/bundle/holdCancelArms.test.ts) that runs/hold cancel,/unholdand/remove-holdwith no hold label, withGET /issues/1→ 500, with the labelDELETE→ 500, and with oneDELETE→ 404, asserting exit status, the error cause and the exact request sequence.Merged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.