Repository navigation
[quality] tide's merge-queue skip and enqueue-refusal arms are unit-covered but never driven through dist/index.js #321
Description
Finding
src/plugins/tide.ts's merge-queue path (evaluateInQueue, lines 294–348) and src/utils/mergeQueue.ts's refusal classification (classify/errorMessage, lines 164–189, plus the pullRequest: null arm at 94–96) are fully covered by the unit suites (__tests__/plugins/tide.test.ts, __tests__/utils/mergeQueue.test.ts) but only partly reached by the end-to-end bundle suite.
Unit evidence — npx vitest run --coverage on main @ 3fc21f2 (80 files / 1639 tests): src/ 100 % lines / 99.81 % branches; both files 100 % lines.
End-to-end evidence — npm run test:coverage:e2e on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8; 5 files / 142 tests): src/ 77.9 % lines. tide.ts 81.02 % lines, uncovered in the queue path: 303–304 (pr already in the queue, with/without an entry), 308 (the retryIf re-read predicate), 313 (queue-refused state), 316 (head moved during evaluation), 335/337/339 (head_moved/already_queued/not_ready refusals), 346–347 (unclassified refusal). mergeQueue.ts 84.09 % lines, uncovered: 95–96 (state query without a pull request), 167/170/173/178 (classify), 188 (errorMessage without a GraphQL errors array). bundle.test.ts's existing queue cases drive only the successful enqueue, merge_queue: off, the forbidden refusal, the state-query GraphQL error, and dequeue.
The two runs are reported separately on purpose (see vitest.e2e-coverage.config.mjs): their statement maps come from different transforms and do not line-merge, so this is stated per source, not combined.
Recommendation
Add __tests__/bundle/mergeQueueArms.test.ts driving a pull_request labeled lgtm run on a queue-enabled branch through dist/index.js against fakeGithub for each arm above: in-queue skip (entry and no entry), dirty refusal, an unknown first read whose re-read has a different head, each classified enqueueError message, an HTTP 500 on the mutation, and a state query answering pullRequest: null.
-
__tests__/bundle/mergeQueueArms.test.tslands andtide.tslines 303–347 /mergeQueue.tslines 95–188 show e2e hits undernpm run test:coverage:e2e
Priority
- Impact: medium — covered by unit tests but not end-to-end; this is the path a queue-protected branch takes on every
lgtm - Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 443e72f
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
hivecommons-hive commentedon Oct 5, 2026
/kind cleanup
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-5q9t| SHA:443e72f— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Oct 9, 2026
task-list sweep: 0 of 1 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
__tests__/bundle/mergeQueueArms.test.tslands andtide.tslines 303–347 /mergeQueue.tslines 95–188 show e2e hits undernpm run test:coverage:e2eMerged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.