Skip to content

[quality] the sweep cron's enqueued outcome (sweep.ts:75) has no end-to-end coverage — no bundle test runs jobs: sweep on a merge-queue branch #384

Description

@hivecommons-hive

Finding

src/cronJobs/sweep.ts:75 — the sweep cron's enqueued outcome (result.enqueued.push(pr.number) when tide answers { result: 'enqueued' } for a candidate whose base branch requires a merge queue) — is exercised by unit tests only. No bundle (end-to-end) test runs schedule with jobs: sweep against a queue-enabled base branch, so the shipped dist/index.js has never been seen enqueueing a pull request from the sweep.

The arm fell between two held PRs: #345 (sweepArms.test.ts) states "Line 75 (enqueued) is deliberately left to #322's merge-queue cluster", but #322 (mergeQueueArms.test.ts) drives pull_request labeled lgtm and never runs the sweep job. bundle.test.ts's only queue-branch cron test uses jobs: lgtm (the lgtm cron), which enqueues via a different caller (src/cronJobs/ → evaluateMerge) and does not touch sweep.ts.

Evidence

Everything else left uncovered in that merged run is a catch { throw new Error(...) } wrapper that auth.ts's check* helpers make unreachable (they swallow every error and return false), a reset*Cache() test-only export, or a payload missing … guard.

Recommendation

  • Add a bundle test that runs schedule with jobs: sweep on a fork pull request carrying a bound lgtm whose base branch has isMergeQueueEnabled: true (gh.mergeQueue({ enabled: true })), and asserts sweep: #1 enqueued, enqueued pr #1 (position 1), one enqueuePullRequest mutation with expectedHeadOid = the candidate's head, and no PUT …/merge.
  • Cover the mixed arm as well: one candidate enqueued while another's enqueue is refused — sweep: #1 enqueued, sweep: #2 evaluated with 1 error(s), run exits 1 naming only #2.

Priority

  • Impact: medium — covered by unit tests, not end-to-end; it is the only path by which the pull_request install mode ever reaches a merge queue
  • Effort: low — one new file under __tests__/bundle/, no harness change (fakeGithub.mergeQueue already serves the GraphQL)

Filed by quality agent (hold-gated mode)


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

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

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