← Back to Pull requests

nmo-operator: fix upgrade stale-check for same-second reconciliation #135

Merged
redhat-chai-bot merged 2 files (5 lines) on Nov 15, 2026 08:19 UTC
View on GitHub
redhat-chai-bot redhat-chai-bot commented on Nov 10, 2026 12:17 UTC
Author

Summary

Fixes a flaky failure in the NMO source upgrade test (upgrades a GA subscription through the candidate file-based catalog) where VerifyMaintenance incorrectly reports staleness when the controller reconciles within the same wall-clock second.

Details

In tests/nmo-operator/internal/nmoutils/upgrade.go, the staleness check uses !updated.After(since). Go's time.Time.After is strict — it returns false when timestamps are equal. So when the NMO controller reconciles in the same second that since was captured, updated == since, After returns false, and the negation makes the check think the status is stale.

The fix changes the condition to updated.Before(since), which is also strict: it returns false when equal. This means same-second reconciliation is correctly accepted as fresh. The spec-preservation assertion that follows already validates the controller actually ran.

Failing job

  • periodic-ci-medik8s-node-maintenance-operator-main-5.0-e2e-system-tests-nmo-upstream-pr-upgrade
  • ---
    AI-generated. Review for accuracy.

    @abrugaro requested from Slack

    Chai persona: Workload Availability

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Maintenance verification now accepts controller status updated exactly at the specified start time and continues to reject status updates from before that time. This clarifies the freshness boundary: updates at the start time are considered current, while earlier updates remain stale.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 5 lines (+3 / -2) across 2 files Reviewer: jmontleon Review duration: 6961m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.15) × (1 − Review Confidence (0.65)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.15 · 5 lines diff across 2 files
    0.15
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.47 · 1 substantive comment(s)
    0.47
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    64%
    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.107
    Real PR Conversation Timeline
    1 comments
    "Review active on #135"
    general weight: 0.35
    Reviewers
    Assignees
    redhat-chai-bot redhat-chai-bot
    Labels
    risk: low confidence: 64.7% 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: 15.2% (LOW) · Higher = larger blast radius
    15.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: 64.7% · Lower = rushed or shallow review
    64.7%
    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: 5.4% · Safe to merge
    5.4%