Repository navigation
[quality] the status event's success path (tideOnCheckSuite → pullRequestsForSha → merge) and the missing-head-sha arm are never driven through dist/index.js #261
Description
Finding
src/run.ts routes the legacy commit status event to handleCheckSuite → tideOnCheckSuite (src/plugins/tide.ts:510-525), which reads payload.state and payload.sha instead of check_suite.conclusion / check_suite.head_sha, and looks the pull requests up by sha because a status payload has no pull_requests. docs/events.md:16,181 documents this route.
Bundle e2e coverage (__tests__/bundle/bundle.test.ts, dist/index.js against fakeGithub) on main @ c48bd6d drives only the arms that make no API call:
statuswithstate: pendingandcheck_suitewithconclusion: failure(bundle.test.ts:157-166, the hopeless-conclusion short-circuit)check_suitesuccesswith and withoutpull_requests(bundle.test.ts:1480-1520)
Never driven through the bundle:
statussuccess→pullRequestsForShalisting → pull read → binding read → merge (thepayload.sha/payload.stateread path)statussuccesswhen no open pull request has that head (listing stops, nothing else is called)statussuccessundertide.merge_on_events: false(configuration read, no listing)- the
TypeError('github context payload missing head sha: …')arm for astatuspayload withoutsha/ acheck_suitewithouthead_sha, whichrunEventHandlersmust surface as::error::error handling <event> event: …and exit 1
Evidence
- Unit:
__tests__/plugins/tide.test.ts:1000-1020(status success: looks the prs up by the payload sha,status %s: makes no api call) and__tests__/pullReqTest/handleCheckSuite.test.ts:36cover every arm in isolation.npx vitest run --coverageonmain@ c48bd6d:tide.ts 100 | 94.62 | 100 | 100(uncovered branch lines unrelated: 30, 361, 424, 543), suite-wide99.83 | 98.35 | 100 | 99.82. - E2E:
grep -n "'status'" __tests__/bundle/bundle.test.ts→ one hit, line 159 (state: 'pending'). None of the open bundle PRs (test(bundle): drive /cc /uncc /unassign /retitle /lock /reopen through dist/index.js #238–test(bundle): drive ok-to-test on pull_request synchronize and in the sweep through dist/index.js #260) add astatuspayload or a missing-sha payload. - The two suites cannot be combined at line granularity ([quality] the bundle e2e suite's coverage of src/ is never captured — runBundle.ts drops NODE_V8_COVERAGE and dist/ has no source map #235), so this is stated as unit-covered / e2e-uncovered.
Recommendation
Add __tests__/bundle/statusEvent.test.ts (new file, following #260's one-file-per-cluster layout, so it does not touch the bundle.test.ts hunks held by the open PRs) driving the four arms above through dist/index.js and asserting the exact request sequence and the merge body.
Priority
- Impact: medium — unit-covered, e2e-uncovered (priority 2 under the coverage rules); the
statusroute is the only event whose payload shape differs from the onecheck_suitetests exercise, so a regression in thepayload.sha/payload.statereads would only surface in production. - 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
github-actions commentedon Oct 1, 2026
Please add a kind label with
/kind failing-testor/kind cleanup.hivecommons-hive commentedon Oct 3, 2026
Verified on main@ec76a3b: #262 landed the
statussuccess path as anit.each(['check_suite','status'])row of the head-sha lookup case (bundle.test.ts L1557). The merge_on_events:false and missing-sha arms were cut on review as duplicates oftide.test.ts:1000-1042; closing as resolved at the scope the maintainer accepted.— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88