Repository navigation
test(bundle): drive the merge queue's failed state read, refused enqueue and refused dequeue through dist/index.js - #270
Conversation
|
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 |
jeefy
left a comment
There was a problem hiding this comment.
11 of the 14 tests repeat rows already in tideMergeQueue.test.ts / mergeQueue.test.ts (and three make the same requests as existing bundle.test.ts tests), the file copies bundle.test.ts's helpers, and it pins full strings with toEqual.
- Keep only the three outcomes
dist/doesn't reach yet: a GraphQLerrors[]state read → one warning + REST merge (L127), aforbiddenenqueue → exit 1 with the permissions hint (L215), and a refused dequeue → warning, exit 0 (L270). Drop the rest (L112, L142, L155, L194–208, L230, L242, L255, L285, L301); each maps to an existing unit test row. - Don't copy the config-read list,
expectRequests,mergeablePr,labeledLgtm,runPullRequest(L15–78). Either put the three cases inbundle.test.ts's merge-queuedescribe, or import from the shared__tests__/bundle/helpers.tsin #273. Prefer addingqueryError/dequeueErrortoMergeQueueFixture(astestUtils.tsdoes) over the localrouteGraphql/stateOf. - Assert fragments:
errors.some(e => e.includes('the token may not enqueue')),'automatic-merging.md#merge-queues', andwarnings.some(w => w.includes('falling back to a direct merge')), astideMergeQueue.test.ts:224does.
…eue and refused dequeue through dist/index.js Signed-off-by: quality <quality@hive.kubestellar.io>
99caafa to
257d2b9
Compare
|
Addressed all three: only the three outcomes remain (state-read 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Adds the three merge-queue outcomes
dist/index.jsdid not reach, as cases in the existingon a branch that requires a merge queuedescribe of__tests__/bundle/bundle.test.ts:errors[]answer on the state read (a GHES without the queue fields) → one::warning::containingfalling back to a direct merge, then the REST merge; exit 0Resource not accessible by integration→ exit 1, errors containthe token may not enqueueandautomatic-merging.md#merge-queues; noPUT mergeunlabeled lgtmon the bot's own entry when the dequeue is refused →::warning::could not dequeue pr #1: …, the skip reason does not say(dequeued), exit 0To route these,
MergeQueueFixturein__tests__/bundle/fakeGithub.tsgainsqueryErroranddequeueErroralongsideenqueueError, mirroringtestUtils.ts. Assertions are fragments, astideMergeQueue.test.ts:224does.The separate
mergeQueueFailures.test.ts(14 cases, copiedexpectRequests/mergeablePr/labeledLgtm/runPullRequest, localrouteGraphql/stateOf) was dropped on review: the other 11 cases map to rows oftideMergeQueue.test.ts/mergeQueue.test.ts.Verification on
main@ a270568:npx eslint,npx tsc --noEmit,npx vitest run __tests__/bundle/bundle.test.ts -t "merge queue"— 9 pass (6 existing + 3).Related Issue
Closes #269
Filed by quality agent (hold-gated mode). Human review required.