Skip to content

Revert "Add support for Orphan management policy"#929

Closed
lsviben wants to merge 1 commit intomainfrom
revert-864-add_orphan_policy
Closed

Revert "Add support for Orphan management policy"#929
lsviben wants to merge 1 commit intomainfrom
revert-864-add_orphan_policy

Conversation

@lsviben
Copy link
Contributor

@lsviben lsviben commented Feb 17, 2026

Reverts #864

Discussed with @bobh66 in Crossplane Slack. We would like to hold off on changes to management policies until we find a better aligned solution.

Ref: #930

@lsviben lsviben requested a review from a team as a code owner February 17, 2026 10:58
@lsviben lsviben requested a review from negz February 17, 2026 10:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

Removes the Orphan variant from the ManagementAction enum definition, its kubebuilder validation constraints, reconciler policy checks, and associated test cases across the codebase.

Changes

Cohort / File(s) Summary
API Definitions
apis/common/policies.go, apis/common/v1/policies.go
Removed the ManagementActionOrphan constant declaration and updated kubebuilder validation enum to exclude Orphan from allowed values.
Reconciler Logic
pkg/reconciler/managed/policies.go
Removed ManagementActionOrphan from default supported management policies and policy validation checks (ShouldCreate, ShouldUpdate, ShouldLateInitialize).
Test Suites
pkg/reconciler/managed/reconciler_legacy_test.go, pkg/reconciler/managed/reconciler_modern_test.go
Removed test cases covering orphan-related management policy scenarios across multiple test functions; deleted 260 total lines of orphan-specific test assertions and edge cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Breaking Changes ❌ Error PR removes exported constants (ManagementActionOrphan) from public API files without the required 'breaking-change' label. Add the 'breaking-change' label to acknowledge this intentional breaking change to the public API.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the change as a revert of the Orphan management policy feature and is well-aligned with the actual changeset.
Description check ✅ Passed The pull request description clearly relates to the changeset by explaining that it reverts a previous PR adding Orphan management policy support, referencing team discussion about holding off on management policy changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/reconciler/managed/policies.go (1)

126-126: Pre-existing typo: "No Crate" → "No Create".

Tiny nit — not introduced by this PR, but noticed while reviewing. Feel free to fix if you're touching this area anyway.

📝 Suggested fix
-		// No Crate and no Delete. Just update/patch the external resource.
+		// No Create and no Delete. Just update/patch the external resource.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/reconciler/managed/policies.go` at line 126, Fix the typo in the inline
comment that reads "No Crate and no Delete. Just update/patch the external
resource." — change "No Crate" to "No Create" in
pkg/reconciler/managed/policies.go (look for that exact comment near the policy
logic where update/patch behavior is described) so the comment correctly reads
"No Create and no Delete. Just update/patch the external resource."
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/reconciler/managed/reconciler_legacy_test.go`:
- Line 89: Rename the mistyped test case key
"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn" to
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan" in the test map so the
name is spelled correctly; update the key wherever referenced in
reconciler_legacy_test.go (look for the exact string
"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn") and ensure any
assertions or lookups that use that key are updated to the corrected
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan".

---

Nitpick comments:
In `@pkg/reconciler/managed/policies.go`:
- Line 126: Fix the typo in the inline comment that reads "No Crate and no
Delete. Just update/patch the external resource." — change "No Crate" to "No
Create" in pkg/reconciler/managed/policies.go (look for that exact comment near
the policy logic where update/patch behavior is described) so the comment
correctly reads "No Create and no Delete. Just update/patch the external
resource."

want: want{result: reconcile.Result{}},
},
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan": {
"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo in test case name: OrphahnOrphan.

It looks like the revert introduced a small typo in this test case key. Could you fix this? 🙂

🔤 Suggested fix
-		"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn": {
+		"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan": {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn": {
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan": {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/reconciler/managed/reconciler_legacy_test.go` at line 89, Rename the
mistyped test case key "UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn" to
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan" in the test map so the
name is spelled correctly; update the key wherever referenced in
reconciler_legacy_test.go (look for the exact string
"UnpublishConnectionDetailsDeletionPolicyDeleteOrpahn") and ensure any
assertions or lookups that use that key are updated to the corrected
"UnpublishConnectionDetailsDeletionPolicyDeleteOrphan".

@lsviben lsviben closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant