← Back to Pull requests

test(bundle): drive /hold cancel's no-label, failed-read, failed-removal and already-gone arms through dist/index.js #326

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

Test Improvement

Adds __tests__/bundle/holdCancelArms.test.ts (new file only; imports comment, configReads, helpersFor, repo, token from ./helpers) — six cases run through the committed dist/index.js against fakeGithub, covering the cancelHold arms of src/labels/hold.ts that no bundle suite reached:

1. /hold cancel, /unhold, /remove-hold on an issue whose labels are [lgtm] → exit 0, no DELETE, requests are the config reads then GET /issues/1 (hold.ts L67–69).
2. /hold cancel with GET /issues/1 → 500 → exit 1, error carries could not get labels from issue, no DELETE (L60–61).
3. /hold cancel with DELETE …/labels/do-not-merge%2Fhold → 500 → exit 1, error carries both could not remove the hold label and the cause could not remove label do-not-merge/hold (L75–76).
4. /hold cancel with hold + do-not-merge/hold present, DELETE …/labels/hold → 404, the other → 200 → exit 0, both DELETEs sent (src/utils/labeling.ts L202–203, the benign gone-label arm).

Cluster: src/labels/hold.ts cancelHold + src/utils/labeling.ts removeLabels 404 arm. Disjoint from #293 (holdSweepSettings: configured hold.label, label present) and from bundle.test.ts's /unhold case (both labels present, writes accepted).

Measured with npm run test:coverage:e2e on main @ 3fc21f2, before → after: src/labels/hold.ts 80 % → 96 % lines, 81.81 % → 90.9 % branches; src/utils/labeling.ts 73.07 % → 76.92 % lines; bundle suite 142 → 148 tests. The remaining hold.ts line (L30, missing issue number) cannot be produced through the API.

Verified locally: npx vitest run __tests__/bundle/holdCancelArms.test.ts → 6 pass; npx eslint and npx tsc --noEmit clean.

Related Issue


Closes #325

---
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: 238 lines (+178 / -60) across 2 files Reviewer: jeefy Review duration: 5154m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 238 lines diff across 2 files
0.37
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.328
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #326"
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: 37.2% (MEDIUM) · Higher = larger blast radius
37.2%
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: 14.7% · Safe to merge
14.7%