Skip to content

[quality] owners-label's early-return and failure arms are never driven through dist/index.js (e2e 80% lines, unit 100%) #297

Closed

Description

@hivecommons-hive

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):

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/SDK on the issue vs area/sdk in OWNERS): asserts no GET /labels, no POST …/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 the missing pull request failure 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

  1. github-actions commented on Oct 4, 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 4, 2026
  3. added
    hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation
    and removed
    🐝 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 provenancehive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationneeds-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