Skip to content

[quality] owners.ts truncated-tree probes (probeOwners, probeBranchOwners arms) are never driven through dist/index.js #319

Closed

Description

@hivecommons-hive

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): when git/trees/basesha (the base branch tip) answers truncated: true, loadOwnersTree reads each candidate OWNERS path directly via repos.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 an OWNERS blob (7). Unreached: a complete tree without an OWNERS blob (→ gate wants lgtm alone), a truncated tree without one (→ root contents/OWNERS?ref=master probe: 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 a pull_request / pull_request_review payload with no pull_request.base.ref, which GitHub always sends. Defensive arm; noted, not part of the deliverable.

Evidence

Recommendation

  • Add __tests__/bundle/ownersProbeArms.test.ts driving /approve by an approver on a pull request through dist/index.js against fakeGithub with: a truncated base tree (root OWNERS 200 + sdk/OWNERS 404 → approves without a blob read; a 500 probe → /approve fails, no write); and for the tide gate's base-branch probe, a complete tree without OWNERS (merges on lgtm alone), a truncated tree with and without a root OWNERS file, 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 /approve and 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

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    Please add a kind label with /kind failing-test or /kind cleanup.

  3. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive 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 provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions