Repository navigation
[quality] owners-label's early-return and failure arms are never driven through dist/index.js (e2e 80% lines, unit 100%) #297
Description
Finding
src/plugins/ownersLabel.ts is the pull_request owners-label plugin. The unit suite covers it fully, but the end-to-end bundle suite (__tests__/bundle, the only place the shipped dist/index.js runs) only reaches its happy path — adding a declared label the pull request lacks. The arms that stop short of a write are never driven through the bundle:
| lines | arm |
|---|---|
| 61-62 | the pull request already carries every declared label (case-insensitive compare) → no repo-labels read, no write |
| 70 | GET /repos/…/labels fails → could not list the repository labels: … rethrown, run fails |
| 77-78, 81 | a declared label the repository does not have → owners-label: skipping label … (run label-sync) info line, nothing written |
| 30 | pull_request payload without pull_request → github context payload missing pull request: … |
Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8 5.0.3):
- Unit:
npx vitest run --coverage(81 files / 1644 tests) →ownersLabel.ts100 % lines / 100 % branches / 100 % functions. - End-to-end:
npm run test:coverage:e2e(vitest.e2e-coverage.config.mjs,__tests__/bundle, 5 files / 142 tests) →ownersLabel.ts80 % lines / 73.33 % branches, uncovered lines30, 61-62, 70, 77-78, 81. - The two sources are analysed separately: their statement maps come from different transforms and do not line-merge ([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).
Covered by unit but not end-to-end → priority 2 (medium) under the coverage evidence rules.
Recommendation
Add __tests__/bundle/ownersLabelArms.test.ts driving dist/index.js on pull_request synchronize (so require-matching-label, blunderbuss and tide stay out of the call list) against fakeGithub:
- already-carrying case (
Area/SDKon the issue vsarea/sdkin OWNERS): asserts noGET /labels, noPOST …/labels - every declared label unknown to the repository: asserts both
skipping label …info lines and no write - mixed known/unknown: asserts only the known one is posted, in the OWNERS spelling
-
GET /labels→ 500: asserts::error::error handling pull_request event: could not list the repository labels: …and that approve's probe still runs after it - payload without
pull_request: asserts themissing pull requestfailure with no API calls
Disjoint from every open hold-gated bundle PR (#242 cron jobs input, #244 /meow, #246 fixed/prefixed labels + helpers.ts, #283 OWNERS authorization, #286 approve.github_review, #289 tide merge gate, #291 blunderbuss, #293 hold/sweep, #296 close/milestone): none drives owners-label's non-write arms, and helpers.ts is not touched.
Priority
- Impact: medium
- Effort: low
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
Activity
github-actions commentedon Oct 4, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.