Repository navigation
[quality] handlePullReq's jobs-input error arms are never exercised end-to-end through dist/index.js #309
Description
Finding
src/pullReq/handlePullReq.ts runs the jobs input after the registered pull-request handlers. Three of its arms are reached by no __tests__/bundle suite, so the shipped bundle's behaviour on them is unmeasured:
- lines 62-66: the
lgtmjob'scatch(anonPrLgtmfailure is returned as a value) and thedefaultarm (could not execute <job>. May not be supported) - lines 75-80: the
TypeError: error handling pull request: …rethrow and thecore.setFailedthat ends the run src/pullReq/onPrLgtm.tsline 30:could not get labels from issuewhen the labels read fails
Evidence
- Unit:
npx vitest run --coverageonmain@ 3fc21f2 —handlePullReq.ts100 / 100 / 100 / 100,onPrLgtm.ts100 / 100 / 100 / 100 (__tests__/pullReqTest/handlePullReq.test.ts,onPrLgtm.test.ts). - End-to-end:
npm run test:coverage:e2eonmain@ 3fc21f2 (Node v26.10.0, vitest 5.0.3, local run 2026-10-04) —handlePullReq.ts80.76 % lines, uncovered46,62-66,75-80;onPrLgtm.ts83.33 % lines, uncovered19,30.
Covered by unit tests but not end-to-end → medium.
Line 46 (jobs empty and no registered handlers) and onPrLgtm.ts line 19 (a pull_request payload without pull_request.number) are not reachable from a real pull_request event and are out of scope.
Recommendation
-
__tests__/bundle/pullReqJobsArms.test.ts: apull_requestsynchronizerun with an unsupportedjobsentry fails naming the job after the handlers have run; one whoselgtmjob'sGET /issues/1answers 500 fails withcould not get labels from issueand deletes nothing;jobs: lgtm <unsupported>removes the label and still fails the run
Measured with that file: handlePullReq.ts 80.76 → 96.15 % e2e lines (only 46 left), onPrLgtm.ts 83.33 → 91.66 % (only 19 left).
Priority
- Impact: medium
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 709cb6c
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
github-actions commentedon Oct 4, 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/pullReqJobsArms.test.ts: apull_requestsynchronizerun with an unsupportedjobsentry fails naming the job after the handlers have run; one whoselgtmjob'sGET /issues/1answers 500 fails withcould not get labels from issueand deletes nothing;jobs: lgtm <unsupported>removes the label and still fails the runMerged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.