← Back to Pull requests

test(bundle): drive the prow-commands alias canonicalization and unsupported-command arms through dist/index.js #357

Closed
unknown closed this pull request without merging on Oct 09, 2026 01:31 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 20:51 UTC
Author

Test Improvement

Adds __tests__/bundle/commandCanonicalization.test.ts (new file only; imports comment, helpersFor, repo, token from ./helpers, start from ./fakeGithub, runBundle from ./runBundle; no src/, dist/, helpers.ts or config change). Three issue_comment runs of the committed dist/index.js against fakeGithub reach the two prow-commands input arms of src/issueComment/handleIssueComment.ts no bundle suite drove:

| run | arm | asserts |
|---|---|---|
| prow-commands: /remove-help, comment /help | canonicalCommand alias arm L86 | exit 0, GET labels → POST issues/1/labels {help wanted}, then the configuration reads |
| prow-commands: /help /remove-help /HELP, comment /help | L86 + the Set dedup at L109 | exit 0, exactly one label write |
| prow-commands: /foo_bar, comment /foo_bar | unsupported-command arm L150 | exit 1, ::error::TypeError: error handling issue comment: Error: could not execute /foo_bar. May not be supported - please refer to docs, zero api calls |

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, @vitest/coverage-v8, npm run test:coverage:e2e):

  • src/issueComment/handleIssueComment.ts e2e lines 93.90 % → 96.34 %, statements 94.04 % → 96.42 %, branches 86.27 % → 90.19 %. Remaining lines 45 (/meow, held #244), 188 (held #293) and 207 (removeFixedLabels, held #300) are each already claimed.

  • Bundle suites overall: 77.90 % → 77.99 % lines, 70.82 % → 70.92 % branches.

  • Unit: the file is already 100/100/100/100; unit and e2e figures are reported separately (#235).
  • Disjoint from every open hold-gated bundle PR: #246 (/remove-help in the comment with /help configured, built-in /lifecycle), #343 (missing issue/pull number guards), #324 (command.ts Markdown guards), #242 (cron jobs input). None of them puts an alias or an unsupported name in the prow-commands input.

    Verified locally: npx vitest run __tests__/bundle/commandCanonicalization.test.ts → 3 passed against the committed dist/index.js; npx eslint __tests__/bundle/commandCanonicalization.test.ts and npx tsc --noEmit clean.

    Related Issue


    Closes #356

    ---
    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: 290 lines (+217 / -73) across 3 files Reviewer: jeefy Review duration: 3159m
    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 · 290 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.339
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #357"
    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: 39.9% (MEDIUM) · Higher = larger blast radius
    39.9%
    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.7% · Safe to merge
    15.7%