Skip to content

Conversation

@camilamacedo86
Copy link
Contributor

Closes: #2009

We need first fix the deprecation leak : #2296

This PR is about the second commit: a0dc469

- stop copying install/validation errors into deprecation conditions
- base bundle deprecation on the installed bundle (Unknown when none)
- extend unit tests to cover resolver failures with catalog deprecations

Assisted-by: Cursor
- leave BundleDeprecated at Unknown/Absent when nothing installs
- flip package/channel/bundle to True/Deprecated when the catalog says so
- keep the conditions at False/NotDeprecated (empty message) when no warnings exist

Assisted-by: Cursor
@camilamacedo86 camilamacedo86 requested a review from a team as a code owner November 4, 2025 09:28
Copilot AI review requested due to automatic review settings November 4, 2025 09:28
@openshift-ci openshift-ci bot requested review from anik120 and oceanc80 November 4, 2025 09:28
@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelanford for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit a0dc469
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6909c74631807f000823693f
😎 Deploy Preview https://deploy-preview-2300--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@camilamacedo86
Copy link
Contributor Author

/hold

Until we get merged: #2296

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the deprecation condition handling in the ClusterExtension controller to prevent installation errors from leaking into deprecation conditions. The key change is deferring deprecation status updates until after installation attempts complete, ensuring that BundleDeprecated remains Unknown/Absent when no bundle is installed and accurately reflects catalog data only for successfully installed bundles.

  • Introduces a new ReasonNotDeprecated constant for non-deprecated resources
  • Refactors SetDeprecationStatus to properly handle bundle deprecation based on installation state
  • Updates deprecation message separator from semicolon to newline for better readability

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/e2e/cluster_extension_install_test.go Adds validation for deprecation conditions in E2E tests, verifying BundleDeprecated status when bundles are/aren't installed
internal/operator-controller/controllers/common_controller_test.go Updates deprecation message separator from semicolon to newline in tests
internal/operator-controller/controllers/clusterextension_controller_test.go Adds comprehensive test coverage for deprecation condition behavior during resolution and applier failures
internal/operator-controller/controllers/clusterextension_controller.go Refactors deprecation handling to use deferred updates and introduces helper functions for building deprecation info
internal/operator-controller/controllers/clusterextension_admission_test.go Updates admission test to handle multiple possible error message formats
internal/operator-controller/conditionsets/conditionsets.go Adds ReasonNotDeprecated to the list of valid condition reasons
api/v1/common_types.go Defines the new ReasonNotDeprecated constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bundleDeprecatedCond := apimeta.FindStatusCondition(clusterExtension.Status.Conditions, ocv1.TypeBundleDeprecated)
require.NotNil(ct, bundleDeprecatedCond)
require.Equal(ct, metav1.ConditionFalse, bundleDeprecatedCond.Status)
require.Equal(ct, ocv1.ReasonDeprecated, bundleDeprecatedCond.Reason)
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

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

Incorrect reason for non-deprecated bundle. When Status is ConditionFalse (bundle is not deprecated), the Reason should be ocv1.ReasonNotDeprecated, not ocv1.ReasonDeprecated. This is inconsistent with the controller logic at lines 447-448 in clusterextension_controller.go where ReasonNotDeprecated is set for non-deprecated bundles.

Suggested change
require.Equal(ct, ocv1.ReasonDeprecated, bundleDeprecatedCond.Reason)
require.Equal(ct, ocv1.ReasonNotDeprecated, bundleDeprecatedCond.Reason)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecated conditions possibly incoherent

1 participant