← Back to Pull requests

Register DRA reconciler with manager #1287

Closed
unknown closed this pull request without merging on Jun 17, 2026 10:21 UTC
View on GitHub
unknown unknown commented on Jun 16, 2026 15:04 UTC
Author

Register DRA reconciler with manager

Summary

Wire the existing DRA reconciler into the operator manager so that DRA Modules
are actively reconciled when the manager runs in a cluster. This adds the scheme
registration, RBAC permissions, reconciler construction, and DRA module count
metric to the existing metrics sweep.

Changes

  • cmd/manager/main.go:

  • - Add resourcev1.AddToScheme(scheme) for the DRA resource API
    - Construct and register DRAReconciler via SetupWithManager
  • internal/controllers/dra_reconciler.go:

  • - Add //+kubebuilder:rbac annotation for resource.k8s.io/deviceclasses
  • internal/metrics/metrics.go:

  • - Add SetKMMDRANum method and kmm_dra_num gauge
  • internal/controllers/device_plugin_reconciler.go:

  • - Count modules with spec.dra in the existing metrics sweep
  • config/rbac/role.yaml:

  • - Regenerated with resource.k8s.io/deviceclasses rule (all CRUD verbs)

    Testing

  • Unit tests: Extended the setKMMOMetrics DescribeTable with a dra bool parameter and a new "dra" entry. All 12 entries (including "altogether") pass.

  • Integration tests: N/A

  • Coverage: setKMMOMetrics function at 100% coverage; internal/controllers package at 89.9%
  • Acceptance Criteria

  • AC-1: resourcev1.AddToScheme(scheme) is called in cmd/manager/main.go

  • AC-2: DRAReconciler is constructed and registered via SetupWithManager(mgr) in cmd/manager/main.go

  • AC-3: ClusterRole manifest includes resource.k8s.io/deviceclasses verbs (get, list, watch, create, update, patch, delete)

  • AC-4: DRA module count is reported in existing metrics sweep

  • AC-5: All unit tests pass; no duplicate reconciler registration
  • Diff: 220 lines (+165 / -55) across 2 files Reviewer: yevgeny-shnaidman Review duration: 1156m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 220 lines diff across 2 files
    0.42
    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.323
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1287"
    general weight: 0.35
    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: 41.8% (MEDIUM) · Higher = larger blast radius
    41.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: 16.5% · Safe to merge
    16.5%