test(bundle): drive tide's merge-queue skip and enqueue-refusal arms through dist/index.js - #322
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…through dist/index.js Adds __tests__/bundle/mergeQueueArms.test.ts: on a queue-enabled base branch, a pull_request labeled lgtm run is driven through the committed bundle against fakeGithub for the arms bundle.test.ts does not reach — a pr already in the queue (with and without an entry), a dirty pr the queue would refuse, a head that moves while mergeability is computed, each classified enqueue refusal (head_moved, already_queued, not_ready, other, and a transport 500), and a state query that answers without a pull request. Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/plugins/tide.ts e2e lines 81.02 % -> 86.15 %, src/utils/mergeQueue.ts 84.09 % -> 97.72 %. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <quality@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Test Improvement
Files:
__tests__/bundle/mergeQueueArms.test.ts(new, bundle e2e; importsconfigReads,helpersFor,ownersProbe,queueRead,repo,tokenfrom./helpers). Cluster: tide's merge-queue path —src/plugins/tide.tsevaluateInQueueskip and enqueue-refusal arms,src/utils/mergeQueue.tsclassify/errorMessageand thepullRequest: nullstate-query arm — driven throughdist/index.js.Ten
pull_request labeled lgtmruns on a queue-enabled base branch againstfakeGithub:skipping pr #1: in the merge queue (position 2, AWAITING_CHECKS), no enqueue mutation, noPUTskipping pr #1: in the merge queuemergeable_state: dirty→skipping pr #1: not mergeable (dirty), no enqueueunknown, re-read after the 1 s backoff at a different head →skipping pr #1: head moved during evaluation, no enqueue5–7.
enqueueErrormessages classifiedhead_moved/already_queued/not_ready→ each skipped, exit 0::error::could not enqueue pr #1: …, exit 1, noPUTerrorsarray) → the transport'sServer Erroris reported, exit 1repository.pullRequest: null→ falls back to the directPUT …/mergewithout the "falling back" warningEach case asserts the exact request sequence (
bind, pullRead, ownersProbe, bindingRead, graphql[, graphql | pullRead | merge]).Evidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3,npm run test:coverage:e2e):src/plugins/tide.tse2e lines 81.02 → 86.15 % (303–304, 308, 313, 316, 335, 337, 339, 346–347 now hit);src/utils/mergeQueue.ts84.09 → 97.72 % (only line 67, the test-onlyresetMergeQueueWarnings, remains). Bundle suite 6 files / 152 tests green;eslintandtsc --noEmitclean. Unit coverage unchanged (nosrc/change).Disjoint from the open hold-gated PRs: #289 (
mergeGateLabels.test.ts, themissing_labelsgate andlabelMatch.ts), #293 (holdSweepSettings.test.ts), #310 (pullReqJobsArms.test.ts), #318 (lgtmBindingArms.test.ts) and the rest — none drivesevaluateInQueue's skip arms or an enqueue refusal other thanforbidden, whichbundle.test.tsalready covers.Related Issue
Closes #321
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88