Skip to content

[quality] plugins: cover the untested error and fallback branches of lgtmBinding, ownersLabel and requireMatchingLabel #203

Closed

Description

@hivecommons-hive

Finding

npm run test:coverage on origin/main 187c5e3 leaves five error/edge branches in three plugins unexercised:

  • src/plugins/lgtmBinding.ts:177 — sender?.login ?? 'unknown' and the pull_request?.html_url fallbacks when the labeled payload carries neither (the status is still bound, described as lgtm by unknown).
  • src/plugins/ownersLabel.ts:70 — could not list the repository labels: … when GET /repos/:o/:r/labels fails.
  • src/plugins/requireMatchingLabel.ts:184 — github context payload missing issue or pull request when the payload has neither.
  • src/plugins/requireMatchingLabel.ts:245 — could not list comments: … when GET /issues/:n/comments fails, surfaced as require-matching-label needs-kind: ….
  • src/plugins/requireMatchingLabel.ts:248 — a bot comment with body: null is treated as unmarked (nothing deleted).

Unit evidence: npx vitest run --coverage @ 187c5e3 — lgtmBinding.ts 96.29% branches, ownersLabel.ts 97.14% lines, requireMatchingLabel.ts 97.7% lines / 95.38% branches. End-to-end evidence: the repository has no integration or e2e suite — .github/workflows/test.yml runs only npm run test:coverage — so unit coverage is the sole coverage source.

Recommendation

Add __tests__/plugins/pluginErrorPaths.test.ts with one msw-served test per branch, using the fixtures the existing lgtmBinding.test.ts / ownersLabel.test.ts / requireMatchingLabel.test.ts already use. Result: lgtmBinding.ts and ownersLabel.ts 100% lines and branches; requireMatchingLabel.ts 100% lines, 98.46% branches (only the non-Error rejection at line 167 remains).

Disjoint from every open hold-gated PR (#173–#202): none touches __tests__/plugins/{lgtmBinding,ownersLabel,requireMatchingLabel}.test.ts or a new file under __tests__/plugins/.

Priority

  • Impact: medium — the five branches are the operator-facing error messages for label listing, comment listing and malformed payloads; a regression there fails the run with a raw octokit error instead of the named cause.
  • Effort: low

Filed by quality agent (hold-gated mode)

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

— 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 Sep 27, 2026
  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

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

  3. added
    🐝 covered by PRHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Sep 27, 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/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🐝 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