← Back to Pull requests

feat(tenant-quota): activate ci-failure-patterns extractor versions after coverage check #8294

Closed
unknown closed this pull request without merging on Nov 27, 2026 15:29 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 22:13 UTC
Author

https://redhat.atlassian.net/browse/AROSLSRE-2759

What

Follow up for https://github.com/Azure/ARO-HCP/pull/8006. Extractor-version activation for the ci-failure-patterns controller. A binary with a new cifailurepatterns.Version rebuilds results through the existing history sweep; consumers switch to it only after a coverage check passes.

  • ciFailurePatternControl table (table, JSON mapping, bicep): one row per recorded coverage check. The row with the greatest coverageCheckedAt names the active (extractorVersion, resultSchemaVersion).

  • Coverage loop (pkg/cipatterns/activation.go, started and joined in Controller.Start): a strongly consistent anti-join of raw failed inputs (ingested at least 15 min ago) against results of the compiled version.

  • - Heartbeat row: always written once the newest row names the compiled pair.
    - Activation row: only if the inputs without a result are at most floor(total/100).
    - No row on any read or submit error.
    - Checks run every interval until active, then once per completed sweep.
    - Metrics: ci_failure_patterns_{uncovered,considered}_inputs{source}, last successful check timestamp, control rows written.
  • ciFailurePatternActive() ADX function: results of the active pair, one row per resultKey; empty without control rows. Deployed from the table script with skipvalidation, like the existing functions in tables/*.kql.

  • Config: ciFailurePatterns.control (table and mapping), validated, in the schema, chart and config-dev-ci.yaml.

  • Cleanup: removes the admission gate and the version != compiled guards. Discovery and reconcile behavior is unchanged.

  • README documents activation, the metrics and the 1% rule.
  • Version stays fp-1. On first deploy the control table is empty and fp-1 is already covered, so the first check writes the activation row.

    Verification

  • go vet, go test -race -p 1 ./tooling/tenant-quota/... ./tooling/hcpctl/pkg/kusto and golangci-lint pass.

  • Unit tests cover the write rule (threshold boundary, under 100 inputs, heartbeat above threshold, other pair newest, read errors), schedule and shutdown join.

  • Emulator tests (loopback Kustainer) cover the coverage query (exact, partial, absent, other version or schema, post-cutoff rows, outdated names) and the helper (newest row wins, copies collapse, empty without rows).

  • Read-only DEV check of the coverage query for fp-1: 13,248 inputs, 0 uncovered.

  • Config validates against the schema; the chart renders the control table.
  • Not run: bicep build, live writes.

    Note: the integration tests that use the kusto emulator are not exercised by CI today. That's a follow up, tracked by https://redhat.atlassian.net/browse/AROSLSRE-2910.

    Diff: 344 lines (+258 / -86) across 4 files Reviewer: raelga Review duration: 1035m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 344 lines diff across 4 files
    0.47
    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.350
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #8294"
    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: 47.3% (MEDIUM) · Higher = larger blast radius
    47.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: 18.7% · Safe to merge
    18.7%
    Repository