← Back to Pull requests

RHOAIENG-98543: Enforce explicit informer registration #10356

Closed
unknown closed this pull request without merging on Oct 22, 2026 17:35 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 17:24 UTC
Author

https://redhat.atlassian.net/browse/RHOAIENG-98543

Problem

The manager client could silently create informers for resource types that were not explicitly registered, allowing rare and cross-namespace reads to grow the shared cache unexpectedly. Enabling strict cache reads also exposed optional-resource teardown paths that could fail when Gateway API or ConsoleLink APIs were absent.

Solution

  • Configure the manager cache to fail reads for resource types without an explicitly registered informer.

  • Route platform detection and uncached ConfigMap and Secret reads through the direct API reader.

  • Use the direct API reader for optional HTTPRoute and ConsoleLink teardown so absent APIs return the existing NoMatch result instead of a cache-registration error.

  • Preserve cached reads for explicitly watched owned resources, including Role and RoleBinding lifecycle operations.

  • Keep integration test reconcilers aligned with the production APIReader contract.
  • Evidence

  • Added a strict-cache integration regression proving unwatched reads fail without creating an informer and direct reads do not seed the shared cache.

  • Strengthened the no-Gateway teardown regression so cached optional-resource reads return ErrResourceNotCached, while direct HTTPRoute and ConsoleLink reads return NoKindMatch and teardown continues.

  • make test: passed

  • make test-integration: passed in 96.281s

  • make lint: 0 issues

  • make build: passed

  • git diff --check: passed
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Improved resource consistency by reading platform, federation, module, and cleanup data directly from the API when appropriate.
    Prevented unintended cached reads for resources without registered informers.
    Preserved existing deletion, fallback, validation, and cleanup behavior.

    Tests
    Added coverage confirming uncached resource reads fail through the shared cache while direct API access remains available.
    * Updated controller tests to verify direct API-reader behavior during reconciliation and cleanup.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 279 lines (+209 / -70) across 3 files Reviewer: lucferbux Review duration: 2891m
    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 · 279 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.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #10356"
    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.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    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%