Skip to content

[quality] evaluateMerge's merge-queue fallbacks (no entry, no position, no enqueuer) are untested in tide.ts #218

Description

@hivecommons-hive

Finding

src/plugins/tide.ts is at 100% lines but 94.62% branches. Three of the uncovered arms are real behaviour in the merge-queue path of evaluateMerge, each reached when GitHub's GraphQL answer omits something src/utils/mergeQueue.ts already parses (and unit-tests) as optional:

  • L304 — isInMergeQueue: true with mergeQueueEntry: null: the skip reason is the bare in the merge queue (no position/state).
  • L329–330 — enqueuePullRequest returns mergeQueueEntry: null: the verdict is { result: 'enqueued' } with no position, and the info line is enqueued pr #N with no suffix.
  • L361 — the entry has enqueuer: null: enqueuedByBot is false and the debug line names an unknown actor; the pr is left in the queue.

The GraphQL fixture in __tests__/testUtils.ts (mergeQueueGraphql) cannot produce any of those shapes — it always fills in an entry, a position of 3 and an enqueuer — so __tests__/plugins/tideMergeQueue.test.ts never reaches them.

Evidence

  • Unit: npm run test:coverage on main @ c48bd6d — tide.ts 100% lines / 94.62% branches; coverage-final.json (--coverage.reporter=json) lists the zero-count arms at lines 137, 138, 256, 304, 329, 330, 361, 424, 543 plus one in fetchMergeability.
  • End-to-end: the repo's only integration-style suite is __tests__/bundle/bundle.test.ts, which drives the ncc bundle in dist/ against fakeGithub.ts. It runs in the same vitest process and CI job (.github/workflows/test.yml, npm run test:coverage) but exercises dist/index.js, not src/, so its coverage is not attributable to these lines and cannot be merged with the unit data. Its fakeGithub.ts merge-queue fixture (L29, L155, L167) likewise always supplies an entry, position and enqueuer, so it does not reach these arms either. Rated as unit-only evidence for that reason.

Recommendation

  • Let MergeQueueFixture answer entry: null, entry.enqueuer: null and enqueuePosition: null.
  • Add one test per arm to __tests__/plugins/tideMergeQueue.test.ts asserting the exact verdict and log line.

The other uncovered arms (L137–138 mergeOnce non-numeric status, L256 compare.files ?? [], L424 mergeable ?? null, L543 loadTide without a base) are pure defensive fallbacks and are left out of scope.

Priority

  • Impact: medium (merge-queue path; unit-covered elsewhere, no attributable e2e evidence)
  • Effort: low

Filed by quality agent (hold-gated mode)

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

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

Activity

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