← Back to Pull requests

feat: add HCP Operator Identity Role Set resource support #7821

Closed
unknown closed this pull request without merging on Nov 05, 2026 18:53 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 18:52 UTC
Author

Summary

Jira: ARO-30306 - Implement ARO-HCP frontend for hcpOperatorIdentityRoleSet

Add support for the HcpOperatorIdentityRoleSet resource type, which provides managed identity role requirements for OpenShift operators. This resource is location-scoped and returns role definitions needed for both control plane and data plane operators at different OpenShift versions.

The implementation uses the ClusterScopedIdentitiesConfig (configured via the --azure-cluster-scoped-identities-role-set-name flag) as the source of operator identity role definitions, rather than querying the Cluster Service. This allows the role definitions to vary by environment (dev vs public) while still using the Cluster Service as the source of truth for available OpenShift versions.

Changes

  • Add OperatorIdentityRoleSet type to internal/api/coreapi with generated deepcopy methods

  • Add to AvailableOperations registry for resource provider operations endpoint

  • Add GetMinorOpenShiftVersion utility for extracting x.y version from full version strings (e.g., "4.19" from "openshift-v4.19.0")

  • Add marshaling support for all API versions (v20240610preview through v20261001)

  • - According to the ARM API specification, this resource type has been present since the initial API version, so this retrofits support across all existing versions
  • Add NewSimpleVersionsListIterator test helper for OCM mock iterators (thread-safe implementation)

  • Add GET and LIST endpoints for hcpOperatorIdentityRoleSets

  • Use ClusterScopedIdentitiesConfig to provide role definitions in frontend

  • Add marshalClusterScopedIdentitiesConfig to convert config to ARM format

  • Wire up routes and path segments for the new resource

  • Add comprehensive unit test coverage

  • Add E2E tests for both LIST and GET operations
  • Implementation Details

    The implementation follows the same patterns as the existing OpenShiftVersion resource type and integrates with the Cluster Service to list available versions. The frontend uses the --azure-cluster-scoped-identities-role-set-name command-line option (already present in the backend) to select between "dev" and "public" role definition sets.

    The changes are organized into 7 logical commits:
    1. Add to AvailableOperations
    2. Add core API types and registry integration
    3. Add API version marshaling (retrofitting to all versions per ARM spec)
    4. Add OCM test iterator helper with thread-safe implementation
    5. Add GetMinorOpenShiftVersion utility function
    6. Add frontend implementation with full unit test coverage
    7. Add E2E tests for LIST and GET operations

    Testing

    Unit Tests

    Added comprehensive unit tests in frontend_operatoridentityroleset_test.go:

  • TestArmResourceListOperatorIdentityRoleSets - tests the LIST endpoint with dev and public configs

  • TestGetOperatorIdentityRoleSet - tests the GET endpoint with positive and negative cases (invalid version, valid version, version not in catalog)

  • TestMarshalClusterScopedIdentitiesConfig - tests the core marshaling logic for multiple versions and configurations
  • E2E Tests

    Added E2E tests in test/e2e/operator_identity_rolesets.go:

  • "should be able to list available HCP Operator Identity Role Sets and validate response content" - validates LIST operation and response structure

  • "should be able to get a specific HCP Operator Identity Role Set by version" - validates GET operation for a specific version
  • 🤖 Generated with Claude Code

    Diff: 450 lines (+337 / -113) across 5 files Reviewer: cadenmarchese Review duration: 11520m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 450 lines diff across 5 files
    0.45
    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.366
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7821"
    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: 45.4% (MEDIUM) · Higher = larger blast radius
    45.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: 17.9% · Safe to merge
    17.9%
    Repository