Repository navigation
[quality] owners.ts truncated-tree probes (probeOwners, probeBranchOwners arms) are never driven through dist/index.js #319
Copy link
Copy link
Closed
Labels
agent/qualityCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenance
Description
Finding
src/utils/owners.ts has two fallbacks for a recursive tree listing that GitHub truncates, plus the failure arms around them, that only the unit suite reaches. The bundle e2e suite (__tests__/bundle, the only place the shipped dist/index.js is exercised) never drives them:
probeOwners(L243–268): whengit/trees/basesha(the base branch tip) answerstruncated: true,loadOwnersTreereads each candidateOWNERSpath directly viarepos.getContent(404 → skip, other error →error loading OWNERS files at basesha). No bundle test serves a truncated base tree.probeBranchOwners(L325, L331–344): the tide gate's probe of the pull request's base branch. Bundle tests only ever serve a 404 tree (62 of 69 calls) or a complete tree that carries anOWNERSblob (7). Unreached: a complete tree without an OWNERS blob (→ gate wantslgtmalone), a truncated tree without one (→ rootcontents/OWNERS?ref=masterprobe: 200 → true, 404 → false, other →error probing for a root OWNERS file at master), and a tree listing that fails other than 404 (→error listing the tree of master).repoHasOwners/defaultBranch(L282–285, L348–360): reached only from apull_request/pull_request_reviewpayload with nopull_request.base.ref, which GitHub always sends. Defensive arm; noted, not part of the deliverable.
Evidence
- Unit:
npx vitest run --coverageonmain@ 3fc21f2 (Node v26.10.0, vitest 5.0.3,@vitest/coverage-v8) — repo-wide 100 % stmts / 99.81 % branches / 100 % funcs / 100 % lines;owners.ts100 % lines. - End-to-end:
npm run test:coverage:e2eonmain@ 3fc21f2 (5 bundle files / 142 tests) —owners.ts66.96 % lines (75/112), 68.66 % branches (92/134); uncovered lines 46, 164, 197, 202–203, 229, 244–267, 283–284, 298, 302–303, 325, 331–344, 349–358. Function hits:probeOwners0,repoHasOwners0,defaultBranch0,probeBranchOwners69 (all via the 404 or OWNERS-blob arms). - The unit and e2e coverage maps cannot be line-merged ([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 / test(coverage): add test:coverage:e2e to report the bundle suite's coverage of src/ #274), so the two sources are stated separately. Priority follows the unit-covered / not-e2e-covered rule: medium.
Recommendation
- Add
__tests__/bundle/ownersProbeArms.test.tsdriving/approveby an approver on a pull request throughdist/index.jsagainstfakeGithubwith: a truncated base tree (rootOWNERS200 +sdk/OWNERS404 → approves without a blob read; a 500 probe →/approvefails, no write); and for the tide gate's base-branch probe, a complete tree without OWNERS (merges onlgtmalone), a truncated tree with and without a rootOWNERSfile, a 500 root probe, and a 500 tree listing.
Disjoint from the held bundle PRs: #283 (ownersAuth.test.ts, auth.ts OWNERS arms, complete trees only), #298 (ownersLabelArms.test.ts), #289 (mergeGateLabels.test.ts, labelMatch.ts patterns), #286 (approveReview.test.ts).
Priority
- Impact: medium — the truncated-tree fallbacks are what keeps
/approveand the tide gate correct on large repositories, and nothing exercises them end-to-end - Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent/qualityCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenanceCreated by Hive for agent-filed issue provenance
Activity
github-actions commentedon Oct 5, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.