Greenfield: Implement direct KRM types, identity, and generate.sh for BackupDRBackup #13979
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.45) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 424 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.362
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #13979"
general
weight: 0.35
seans3
This PR implements direct KRM types, identity, references, and
generate.shconfiguration for the greenfield resourceBackupDRBackup(backupdr.cnrm.cloud.google.com/v1alpha1).Key Changes
1. Types & CRD (
apis/backupdr/v1alpha1/backupdrbackup_types.go):- Added KRM types for
BackupDRBackupSpec,BackupDRBackupStatus, andBackupDRBackupObservedState.- Labeled with
cnrm.cloud.google.com/stability-level=alpha.- All scalar primitive fields across spec and status are pointers, including
Location string.- Parent and resource dependencies use KRM reference types:
ProjectRef,BackupVaultRef(backupdrv1beta1.BackupVaultRef), andDataSourceRef(DataSourceRef).- Used
ObservedStatestructs for output-only properties (DiskBackupPropertiesObservedState,Backup_GcpBackupPlanInfoObservedState).- Enforced acronym naming conventions in
Scheduling(MinNodeCPUs,LocalSSDRecoveryTimeout).2. Inline External Reference & Cycle Resolution (
apis/backupdr/v1alpha1/backupdrbackup_reference.go):- Defined external-only
DataSourceRefandDataSourceIdentityinline inbackupdrbackup_reference.goto avoid naming violations.- Resolved circular import between
v1alpha1andv1beta1by havingBackupDRBackupPlanSpecandBackupDRBackupPlanAssociationSpecinv1beta1use packagev1beta1's ownParentstruct.3. Identity (
apis/backupdr/v1alpha1/backupdrbackup_identity.go):- Implemented
BackupIdentitywith formatprojects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}.- Implemented
BackupRefdelegating normalization strictly torefs.Normalize.- Added unit tests in
backupdrbackup_identity_test.gocoveringBackupIdentity,DataSourceIdentity, andgetIdentityFromBackupSpec.4. Mappers (
pkg/controller/direct/backupdr/backup_mappers.go):- Implemented complete, non-empty mappers including
AccessConfig_v1alpha1_ToProto(mappingin.ExternalIPtoNatIP,Type,NetworkTier, etc.),AttachedDiskObservedState_v1alpha1_ToProto,ComputeInstanceBackupPropertiesObservedState_v1alpha1_ToProto,DiskBackupPropertiesObservedState_v1alpha1_ToProto,GuestOSFeature_v1alpha1_ToProto,Metadata_v1alpha1_FromProto/ToProto,Scheduling_v1alpha1_FromProto/ToProto, andNetworkInterfaceObservedState_v1alpha1_FromProto/ToProto.KCC Auto-Review Results
Trigger criteria matched: Yes
API Version Check: Pass -
backupdr.cnrm.cloud.google.com/v1alpha1Go Type Pointers: Pass - All scalar primitive types are pointers, including
LocationstringCompleteness & Heuristics: Pass - 100% proto field coverage between
google.cloud.backupdr.v1.Backupand KRM types1:1 Kind to Proto Mapping: Pass -
BackupDRBackupstrictly maps 1:1 togoogle.cloud.backupdr.v1.BackupReferences/Identity: Pass -
ProjectRef,BackupVaultRef, andDataSourceRefproperly referenced and canonical identity implementedException Files: Pass - Only
tests/apichecks/testdata/exceptions/alpha-missingfields.txtupdated``
release-note
``Implement direct KRM types, identity, and generate.sh for BackupDRBackup (v1alpha1)
Fixes #11717
***
This pull request was generated by an AI coding agent.
<!-- factory:task-output kind=Change task=recipe-fix-20261014-033415-739d -->