← Back to Pull requests

sriov: add DRA resource inspection and lifecycle helpers #1795

Open
unknown opened this pull request with 247 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 17, 2026 22:38 UTC
Author

Summary

Add the library support needed by downstream SR-IOV DRA lifecycle coverage for CORENET-7535, based on operator PR #1151.

SR-IOV lifecycle tests
  -> read DeviceAttributes / SriovResourcePolicy
  -> update policies with caller context
  -> read named DaemonSets while preserving API errors

The DRA readers use the existing generic builders and the driver's pinned API types. Fake-client tests cover reads, filtering, update behavior, cancellation, and error propagation.

Evidence

  • Before: these DRA readers, context-aware policy update and DaemonSet lookup helpers were unavailable.

  • After: go test ./pkg/sriovdra ./pkg/sriov ./pkg/daemonset passes locally on Go 1.27.4. Scoped lint passes with zero issues.

  • Cluster validation is pending and will be performed by the author. No cluster commands were executed by the assistant.

  • Rebased onto upstream main with one signed-off commit; local checks pass against the updated dependencies.
  • Merge Danger

    Door: two-way

    Additive library APIs; existing callers retain their behavior.

    Blast Radius: dependencies

    Adds the pinned driver API dependency and generated vendor content. This supplies functional test helpers; security and CI-lane provisioning are separate CORENET-7535 deliverables.

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

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

    Summary by CodeRabbit

    New Features
    Added context-aware retrieval for DaemonSets and support for updating SR-IOV policies.
    Added tools to retrieve and list SR-IOV device attributes and resource policies, including namespace and label filtering.
    Resource operations now accept caller-provided contexts, allowing cancellation and timeouts to be respected.

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

    Diff: 247 lines (+185 / -62) across 3 files Reviewer: LionelJouin Review duration: 25458m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 247 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.330
    Real PR Conversation Timeline
    1 comments
    "Review active on #1795"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.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: 38.9% (MEDIUM) · Higher = larger blast radius
    38.9%
    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: 46.7% · Lower = rushed or shallow review
    46.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: 20.7% · Safe to merge
    20.7%