Skip to content

[quality] auth.ts assertPullRequestOwner fail-closed arm (no OWNERS file covers README.md, auth.ts:426) has 0 end-to-end hits through dist/index.js #400

Closed

Description

@hivecommons-hive

Finding

assertPullRequestOwner (src/utils/auth.ts:410-440) is the pull-request arm of assertAuthorizedByOwnersOrMembership, used by /lgtm (src/labels/lgtm.ts:119), /approve (src/issueComment/approve.ts:105) and /test (src/issueComment/trigger.ts:220). When the base branch has OWNERS files but one changed file sits outside every OWNERS directory, it fails closed:

const covered = files.map((file) => {
  const owners = perFile.get(file)
  if (owners === undefined) {
    throw new Error(`no OWNERS file covers ${file}`)   // auth.ts:426
  }
  ...

The refusal is user-visible (Cannot apply the lgtm label because Error: no OWNERS file covers README.md) and it is the only thing standing between "the repository uses OWNERS" and "a reviewer of sdk/ can lgtm a change to the repository root". No bundle test reaches it.

Evidence (main @ aa6a0f8, Node v26.10.0, vitest 5.0.3):

The same function also carries the 100 %-covered is not an approver for any changed file arm (:432), already driven by __tests__/bundle/approveMembershipArms.test.ts (#355).

Recommendation

One PR, one deliverable:

  • add __tests__/bundle/ownersUncoveredFile.test.ts: /lgtm on a pull request whose base has only sdk/OWNERS and whose changed files include a root-level file, asserting exit 1, the no OWNERS file covers README.md refusal comment, no label write, no root-OWNERS read and no membership read (verified locally: auth.ts DA:426,1 under npm run test:coverage:e2e).

Priority

  • Impact: medium (covered by unit tests, not end-to-end; the arm is a security boundary of the OWNERS gate)
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: aa6a0f8

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

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

  2. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Oct 9, 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 provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions