Skip to content

test(bundle): drive the merge queue's failed state read, refused enqueue and refused dequeue through dist/index.js - #270

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-merge-queue-failures
Oct 3, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-merge-queue-failures

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Test Improvement

Adds the three merge-queue outcomes dist/index.js did not reach, as cases in the existing on a branch that requires a merge queue describe of __tests__/bundle/bundle.test.ts:

  • a GraphQL errors[] answer on the state read (a GHES without the queue fields) → one ::warning:: containing falling back to a direct merge, then the REST merge; exit 0
  • an enqueue refused with Resource not accessible by integration → exit 1, errors contain the token may not enqueue and automatic-merging.md#merge-queues; no PUT merge
  • unlabeled lgtm on the bot's own entry when the dequeue is refused → ::warning::could not dequeue pr #1: …, the skip reason does not say (dequeued), exit 0

To route these, MergeQueueFixture in __tests__/bundle/fakeGithub.ts gains queryError and dequeueError alongside enqueueError, mirroring testUtils.ts. Assertions are fragments, as tideMergeQueue.test.ts:224 does.

The separate mergeQueueFailures.test.ts (14 cases, copied expectRequests/mergeablePr/labeledLgtm/runPullRequest, local routeGraphql/stateOf) was dropped on review: the other 11 cases map to rows of tideMergeQueue.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.

@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 3, 2026
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 3, 2026 03:21
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. Keep only the three outcomes dist/ doesn't reach yet: a GraphQL errors[] state read → one warning + REST merge (L127), a forbidden enqueue → 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.
  2. Don't copy the config-read list, expectRequests, mergeablePr, labeledLgtm, runPullRequest (L15–78). Either put the three cases in bundle.test.ts's merge-queue describe, or import from the shared __tests__/bundle/helpers.ts in #273. Prefer adding queryError/dequeueError to MergeQueueFixture (as testUtils.ts does) over the local routeGraphql/stateOf.
  3. Assert fragments: errors.some(e => e.includes('the token may not enqueue')), 'automatic-merging.md#merge-queues', and warnings.some(w => w.includes('falling back to a direct merge')), as tideMergeQueue.test.ts:224 does.

…eue and refused dequeue through dist/index.js

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot force-pushed the quality/test-merge-queue-failures branch from 99caafa to 257d2b9 Compare October 3, 2026 05:25
@hivecommons-hive hivecommons-hive Bot changed the title test(bundle): drive the merge queue's state-read, enqueue and dequeue failure arms through dist/index.js test(bundle): drive the merge queue's failed state read, refused enqueue and refused dequeue through dist/index.js Oct 3, 2026
@hivecommons-hive hivecommons-hive Bot added agent/quality Created by Hive for agent-filed issue provenance hive/hosted-available-lke648397-260827-5q9t Created by Hive for agent-filed issue provenance labels Oct 3, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed all three: only the three outcomes remain (state-read errors[] → warning + REST merge, forbidden enqueue → exit 1 with the permissions hint, refused dequeue → warning, exit 0), placed in bundle.test.ts's merge-queue describe; MergeQueueFixture gained queryError/dequeueError instead of the local routeGraphql/stateOf; assertions are fragments. Separate file deleted. Rebased on main @ a270568.


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

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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asks addressed, thanks.

@jeefy

jeefy commented Oct 3, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 3, 2026
@github-actions
github-actions Bot merged commit fe35d4c into main Oct 3, 2026
16 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-merge-queue-failures branch October 9, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/quality Created by Hive for agent-filed issue provenance hive/hosted-available-lke648397-260827-5q9t Created by Hive for agent-filed issue provenance kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] src/utils/mergeQueue.ts failure arms are unit-covered but never exercised end-to-end through dist/index.js

1 participant