Repository navigation
fix(artifactregistry): align cleanup policies and dry run during direct migration - #13873
Conversation
…ifactRegistryRepository Add reproduction test fixture artifactregistryrepositorycleanuppolicies and record migration logs against real GCP demonstrating the takeover diff on cleanup_policies. When cleanup policy conditions omit tagState, the Terraform provider defaults tag_state to "ANY". The direct controller does not apply this default, causing a diff and triggering an unexpected PATCH during direct takeover. Issue: 13870
…ct migration Align ArtifactRegistryRepository direct controller comparison logic with Terraform controller defaults and field handling: - In populateDefaults, default tagState to ANY in cleanup policy conditions when unspecified, matching Terraform provider schema default. - For optional cleanupPolicyDryRun and cleanupPolicies, align desired state with actual when omitted from KRM spec to prevent spurious diffs on takeover. - Update migration golden logs showing clean 0-write direct takeover. Issue: 13870
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
Investigating Validate PR Release Note failureRun: 37983674588 (This report was generated by overseer) |
KCC Auto-Review Results
Detailed Findings & Action Required1. CI Presubmit Failure:
|
|
🤖 AI Factory started addressing review feedback for this pull request. |
… defaulting - Support cleanupPolicies in MockGCP UpdateRepository. - Apply cleanup policy condition defaulting to desired proto in AdapterForObject. - Remove redundant field assignment in compareRepository. - Generate MockGCP golden test files for artifactregistryrepositorycleanuppolicies. Issue: 13870
|
Thank you for the detailed review! I have addressed all the feedback points in commit 964417b:
(This comment was generated by overseer) |
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
…stry cleanup policies
Investigating unit-tests-4-of-4 failureRun: 38004870804 (This report was generated by overseer) |
|
Overall the fix looks great! Verified against live GCP that the takeover diff on Before merging, could you please make the following minor adjustments:
Once the journal file is removed and posted as a comment, this is ready to approve and merge! |
|
🤖 AI Factory started addressing review feedback for this pull request. |
|
🤖 AI Factory started addressing review feedback for this pull request. |
Thank you! I have made the requested adjustments:
Note on
|
|
An AI coding agent removed |
Refactoring Request: Store KRM Object as
|
|
🤖 AI Factory started addressing review feedback for this pull request. |
Refactored
(This comment was written by an AI coding agent) |
|
An AI coding agent refactored |
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
CI Failure in
|
055d2d6 to
a540072
Compare
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
|
An AI coding agent investigated and resolved the failure in |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: anhdle-sso The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
abb1149
Overview
This pull request fixes Terraform-to-Direct controller migration diffs for
ArtifactRegistryRepository(artifactregistry.cnrm.cloud.google.com), specifically addressing thecleanup_policiesandcleanup_policy_dry_runfields.Fixes #13870
Root Cause & Design Decisions
Cleanup Policy TagState Defaulting:
google_artifact_registry_repository,tag_statehasDefault: "ANY". WhentagStateis omitted from the KRM spec condition, the Terraform controller provisions the policy on GCP withtagState: ANY(enum value 3).tagStateinpopulateDefaults, creating a mismatch between actual GCP state (ANY) and desired proto state (nil/unset), which caused the direct controller to detect a diff oncleanup_policiesupon takeover and issue an unexpectedPATCHcall.populateDefaults, if a cleanup policy condition specifiesnilorTAG_STATE_UNSPECIFIEDforTagState, it defaults topb.CleanupPolicyCondition_ANY, achieving parity with the Terraform controller.Handling Optional CleanupPolicyDryRun & CleanupPolicies:
cleanupPolicyDryRunis optional in KRM. In direct controllerToProto,direct.ValueOf(in.CleanupPolicyDryRun)evaluated tofalsewhenCleanupPolicyDryRunwasnilin KRM spec.desiredKRMtocompareRepository. WhendesiredKRM.Spec.CleanupPolicyDryRun == nil,desired.CleanupPolicyDryRunis aligned toactual.CleanupPolicyDryRun. Similarly, whendesiredKRM.Spec.CleanupPolicies == nil,desired.CleanupPoliciesis aligned tomaskedActual.CleanupPolicies.Verification
artifactregistryrepositorycleanuppolicies.PATCHcall in Phase 3).TestMigrationToDirectagainst real GCP in Run 4:PASS(41.33s)._migration_diffs.json.GET).journal_ArtifactRegistryRepository.md.This PR was generated by the overseer agent (powered by the gemini-3.7-flash model).