← Back to Pull requests

nhc-operator: enable snr operand in suite precondition #150

Closed
unknown closed this pull request without merging on Dec 01, 2026 19:06 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 22:33 UTC
Author

What

Adds a suite-level precondition to the NHC suite that enables the NHC and SNR operands of the WorkloadAvailabilityConfig singleton and waits for both to report Available, before the first spec.

Why

Most NHC specs use SNR as their remediator — they create a NodeHealthCheck referencing a SelfNodeRemediationTemplate and assert on the SelfNodeRemediation CRs created from it. Under WAO every operand CRD is installed with the operator regardless of enablement, so the existing CRD check in the remediation specs cannot tell an enabled SNR manager from a disabled one. On the install-wao-nhc-daily-aws job, where only the nhc component is enabled, three specs fail (4 of 13 total failures in run 2127281675946692608):

  • NHC stays Disabled with RemediationTemplateNotFound because self-node-remediation-automatic-strategy-template does not exist (selector-update and missing-namespace specs)

  • the escalation webhook-validation spec fails around template lookups
  • With the precondition enabling both operands, the suite no longer depends on the CI step having enabled snr out of band.

    Design notes

    Follows the precondition contract in docs/TESTCASES/AGENTS.md:

  • Idempotent — no patch when both operands are already enabled and Available; a cluster that is already correct is not touched.

  • Pre-WAO fallback — when the WorkloadAvailabilityConfig singleton is IsNotFound, the precondition changes nothing and the per-operator checks each spec already performs remain the gate.

  • Leaves operands enabled — enabling is an installation step, not state a spec created, so there is no disable in cleanup.

  • Enables only nhc + snr, not WAOAllComponents.
  • The remaining failure in that job's analysis (webhook denied duplicate template kind MultiTemplateRemediationTemplate) is an RBAC gap in the WAO operator, not addressed here.

    Note: #123 also rewrites tests/nhc-operator/README.md; the paragraph added here sits in the Prerequisites section and may need a small rebase over it.

    Verification

  • go build ./tests/nhc-operator/...

  • make fmt, golangci-lint run tests/nhc-operator/... (0 issues), go vet

  • CI dry-run gate: ECO_DRY_RUN=true KUBECONFIG=/dev/null ginkgo run -r --dry-run ./tests/nhc-operator/ — 28/28 specs, PASS
  • 🤖 Generated with Claude Code

    Diff: 318 lines (+238 / -80) across 3 files Reviewer: jwmatthews Review duration: 1233m
    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 · 318 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.345
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #150"
    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.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    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: 16.0% · Safe to merge
    16.0%