← Back to Pull requests

test(bundle): drive tide's merge-queue skip and enqueue-refusal arms through dist/index.js #322

Closed
unknown closed this pull request without merging on Oct 09, 2026 01:25 UTC
View on GitHub
unknown unknown commented on Oct 05, 2026 07:33 UTC
Author

Test Improvement

Files: __tests__/bundle/mergeQueueArms.test.ts (new, bundle e2e; imports configReads, helpersFor, ownersProbe, queueRead, repo, token from ./helpers). Cluster: tide's merge-queue path — src/plugins/tide.ts evaluateInQueue skip and enqueue-refusal arms, src/utils/mergeQueue.ts classify/errorMessage and the pullRequest: null state-query arm — driven through dist/index.js.

Ten pull_request labeled lgtm runs on a queue-enabled base branch against fakeGithub:

1. pr already in the queue with an entry → skipping pr #1: in the merge queue (position 2, AWAITING_CHECKS), no enqueue mutation, no PUT
2. pr in the queue without an entry → skipping pr #1: in the merge queue
3. mergeable_state: dirty → skipping pr #1: not mergeable (dirty), no enqueue
4. first read unknown, re-read after the 1 s backoff at a different head → skipping pr #1: head moved during evaluation, no enqueue
5–7. enqueueError messages classified head_moved / already_queued / not_ready → each skipped, exit 0
8. an unclassified GraphQL refusal → ::error::could not enqueue pr #1: …, exit 1, no PUT
9. HTTP 500 on the mutation (no GraphQL errors array) → the transport's Server Error is reported, exit 1
10. state query answering repository.pullRequest: null → falls back to the direct PUT …/merge without the "falling back" warning

Each 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.ts e2e lines 81.02 → 86.15 % (303–304, 308, 313, 316, 335, 337, 339, 346–347 now hit); src/utils/mergeQueue.ts 84.09 → 97.72 % (only line 67, the test-only resetMergeQueueWarnings, remains). Bundle suite 6 files / 152 tests green; eslint and tsc --noEmit clean. Unit coverage unchanged (no src/ change).

Disjoint from the open hold-gated PRs: #289 (mergeGateLabels.test.ts, the missing_labels gate and labelMatch.ts), #293 (holdSweepSettings.test.ts), #310 (pullReqJobsArms.test.ts), #318 (lgtmBindingArms.test.ts) and the rest — none drives evaluateInQueue's skip arms or an enqueue refusal other than forbidden, which bundle.test.ts already 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

Diff: 312 lines (+234 / -78) across 3 files Reviewer: jeefy Review duration: 5392m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 312 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.344
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #322"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.3% (MEDIUM) · Higher = larger blast radius
40.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.9% · Safe to merge
15.9%