Repository navigation
[quality] tide's verdict arms (unknown-retry exhaustion, moved head, 405/409 refusals, merged/closed/locked, check_suite guards) never run through dist/index.js #346
Description
Finding
src/plugins/tide.ts is the merge path every event, the comment sweep and both cron jobs funnel through, and its verdict arms — what evaluateMerge does when GitHub does not simply answer clean and merge — are exercised only by the unit suite. The shipped bundle never reaches them.
Unit evidence — npx vitest run --coverage on main @ 3fc21f2 (Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8): src/plugins/tide.ts 100 % statements / 100 % branches / 100 % functions / 100 % lines.
End-to-end evidence — npm run test:coverage:e2e (the source-mapped __tests__/bundle run from #274) on the same revision: src/plugins/tide.ts 158/195 lines (81.02 %), 74.3 % branches. To separate open ground from ground the held bundle PRs already claim, the diffs of all 33 open __tests__/bundle/* PRs (#242–#345) were applied onto main and the run repeated: tide.ts rises to 89.23 % lines, and these lines stay uncovered by every one of them:
| lines | arm |
|---|---|
| 99, 108–111 | fetchMergeability: mergeability still unknown after the 1 s / 2 s / 4 s retries → not mergeable (unknown) |
| 175 | evaluateMerge once: the second cron job (sweep + lgtm in one run) skips a pull request as already evaluated in this run |
| 208 | head moved while mergeability was computed |
| 219 | merge refused with 405 because a concurrent event merged first → merged concurrently |
| 223 | merge refused with 409 → base branch moved / head moved |
| 399, 402, 405 | blockedReason: already merged, closed, locked |
| 439 | isMerged re-read after a refused merge fails → the refusal is reported as is |
| 496–497 | tideOnComment on a closed pull request |
| 520 | tideOnCheckSuite with no head_sha / sha in the payload |
| 564–565 | tideOnCheckSuite naming no pull request, listing finding none |
(96 is the never-used retryIf default; 236–237 is the test-only resetTideWarnings; 489 is unreachable through the dispatcher — every command throws on a missing issue first, see #343.)
Provenance: local runs, main @ 3fc21f2, 2026-10-06; lcov from npx vitest run --coverage --config vitest.e2e-coverage.config.mjs --coverage.reporter=lcovonly __tests__/bundle.
Recommendation
- add
__tests__/bundle/tideVerdictArms.test.tsdriving each arm above throughdist/index.jsagainst the fake GitHub:check_suitewithpull_requests: [{ number: 1 }]reaches tide alone, so the recorded traffic is tide's;schedulewithjobs: 'sweep lgtm'for theoncearm;issue_comment/holdon a closed pull request fortideOnComment
Done means npm run test:coverage:e2e reports every line in the table as covered by __tests__/bundle alone.
Priority
- Impact: medium — unit-covered, e2e-uncovered (coverage-gap maximum is priority 2)
- Effort: low — one new bundle test file, no production or harness change
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
Activity
github-actions commentedon Oct 6, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.