← Back to Pull requests

test(bundle): drive parseProwConfig's empty-document arm (config.ts:373) through dist/index.js #395

Closed
unknown closed this pull request without merging on Oct 09, 2026 18:00 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 18:40 UTC
Author

Test Improvement

Adds __tests__/bundle/emptyConfigDocument.test.ts, driving the empty-document arm of parseProwConfig (src/utils/config.ts:373, return {} when the loaded yaml is undefined/null) through dist/index.js.

For each of a blank .github/prow.yaml and a bare --- document:

  • /lifecycle stale → exit 0, lifecycle: using built-in labels frozen,stale,rotten, exactly one POST /issues/1/labels with lifecycle/stale, and the configuration reads stop at .github/prow.yaml (the empty file is a found source, so no prow configuration found is never raised)

  • /kind cleanup → exit 1, kind: yaml malformed, expected 'kind' top level key, no no prow configuration found, no label write
  • Evidence on main @ aa6a0f8: npm run test:coverage:e2e on origin/main + the heads of all 35 open hold-gated bundle PRs (#283 … #392) left config.ts:373 at 0 hits; with this file it gets 4. Unit coverage already reached the arm via __tests__/utils/config.test.ts:420-426.

    Files / functions claimed: __tests__/bundle/emptyConfigDocument.test.ts (new) only; parseProwConfig empty-document arm. Disjoint from #314 (explicit config source), #339 (schema rejections) and #388 (label listing refusals).

    A comment-only file belongs in the same table but currently throws YAMLException: expected a document, but the input is empty through the bundle — that is a production defect in the trim() guard, filed as #393 for a maintainer; the test names it and leaves that row out until it is fixed.

    Related Issue


    Closes #394

    ---
    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: 214 lines (+160 / -54) across 2 files Reviewer: jeefy Review duration: 1399m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 214 lines diff across 2 files
    0.60
    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.321
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #395"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 59.8% (MEDIUM) · Higher = larger blast radius
    59.8%
    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: 23.6% · Safe to merge
    23.6%