feat: add HCP Operator Identity Role Set resource support #7821
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
cadenmarchese
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-nameflag) 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
OperatorIdentityRoleSettype tointernal/api/coreapiwith generated deepcopy methodsAvailableOperationsregistry for resource provider operations endpointGetMinorOpenShiftVersionutility for extracting x.y version from full version strings (e.g., "4.19" from "openshift-v4.19.0")- 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
NewSimpleVersionsListIteratortest helper for OCM mock iterators (thread-safe implementation)hcpOperatorIdentityRoleSetsClusterScopedIdentitiesConfigto provide role definitions in frontendmarshalClusterScopedIdentitiesConfigto convert config to ARM formatImplementation Details
The implementation follows the same patterns as the existing
OpenShiftVersionresource type and integrates with the Cluster Service to list available versions. The frontend uses the--azure-cluster-scoped-identities-role-set-namecommand-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 configsTestGetOperatorIdentityRoleSet- 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 configurationsE2E Tests
Added E2E tests in
test/e2e/operator_identity_rolesets.go:🤖 Generated with Claude Code