Repository navigation
[quality] owners.ts repoHasOwners/defaultBranch fallback (approve.ts:504, tide.ts:543) has no end-to-end coverage #368
Description
Finding
src/utils/owners.ts repoHasOwners → defaultBranch (lines 282–284, 348–359) is the arm /approve and the tide gate take when no base branch is in scope:
src/plugins/approve.ts:504—pull_request/pull_request_reviewpayload whosepull_request.base.refis not a string →repoHasOwners(octokit, context)src/plugins/tide.ts:543—loadTide(octokit, context, base)withbase === undefined(thepulls.getread ingetPullreturned nobase.ref) →repoHasOwners(octokit, context)
defaultBranch then has three arms of its own: the payload's repository.default_branch, a repos.get fallback when the payload names none, and the could not read the default branch: … throw when that read fails.
The unit suite covers every one of those lines (npx vitest run --coverage on main @ 3fc21f2 → 100 % lines, __tests__/utils/owners.test.ts), but the bundle (end-to-end) suite never reaches them:
$ npx vitest run --coverage --coverage.reporter=lcovonly --config vitest.e2e-coverage.config.mjs __tests__/bundle
# main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, 142 tests
src/utils/owners.ts LF:112 LH:75 DA:283,0 DA:284,0 DA:349,0 DA:350,0 DA:351,0 DA:354,0 DA:355,0 DA:358,0
src/plugins/approve.ts BRDA:504,79,1,0 # the repoHasOwners arm
src/plugins/tide.ts BRDA:543,86,0,0 BRDA:543,174,0,0 # the base === undefined arm
Held PR #320 (ownersProbeArms.test.ts) covers every other probeBranchOwners arm and says in its body that it deliberately leaves "the no-base.ref repoHasOwners/defaultBranch path" out; #366 notes the same 0-hit path as out of scope. No open PR claims it.
Unit and e2e evidence are stated separately: as recorded in #235, the two runs' maps come from different transforms and are not combined.
Recommendation
One new bundle test file, __tests__/bundle/defaultBranchFallback.test.ts, driving the committed dist/index.js against fakeGithub:
-
pull_requestsynchronizewithpull_request.base.refremoved: approve probesgit/trees/<repository.default_branch>with norepos.get; withrepository.default_branchremoved too, it readsGET /repos/Codertocat/Hello-Worldand probes the branch it names; a 500 on that read fails the run withcould not read the default branchand probes no branch tree -
pull_requestlabeled lgtmwhereGET …/pulls/1returns nobase.ref: tide reads the default branch the same three ways, merging in the first two and failing the merge (noPUT) in the third
Expected: owners.ts e2e lines 75 → 82 / 112; approve.ts:504 and tide.ts:543 fallback arms 0 → hit.
Priority
- Impact: medium (covered by unit tests but not end-to-end; both production call sites)
- 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
Activity
github-actions commentedon Oct 7, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 9, 2026
task-list sweep: 0 of 2 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
pull_requestsynchronizewithpull_request.base.refremoved: approve probesgit/trees/<repository.default_branch>with norepos.get; withrepository.default_branchremoved too, it readsGET /repos/Codertocat/Hello-Worldand probes the branch it names; a 500 on that read fails the run withcould not read the default branchand probes no branch treepull_requestlabeled lgtmwhereGET …/pulls/1returns nobase.ref: tide reads the default branch the same three ways, merging in the first two and failing the merge (noPUT) in the thirdMerged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.