Skip to content

✨ Add ReleaseVersionPriority feature gate for re-release upgrade support#2543

Open
rashmigottipati wants to merge 4 commits intooperator-framework:mainfrom
rashmigottipati:oprun-4277-implementation
Open

✨ Add ReleaseVersionPriority feature gate for re-release upgrade support#2543
rashmigottipati wants to merge 4 commits intooperator-framework:mainfrom
rashmigottipati:oprun-4277-implementation

Conversation

@rashmigottipati
Copy link
Member

Description

Adds the ReleaseVersionPriority feature gate (Alpha, disabled by default) to enable upgrades between re-released bundles with the same semantic version but different release values (e.g., 2.0.0+1 to 2.0.0+2).

Changes in the PR:

  • Added a new feature gate: ReleaseVersionPriority (Alpha, disabled by default)
  • Added a new predicate**: SameVersionHigherRelease() to identify bundles with same version but higher release
  • Modified SuccessorsOf() to conditionally include higher-release bundles as valid successors when the feature gate is enabled
  • Unit tests for SameVersionHigherRelease() predicate with edge cases
  • Unit tests for SuccessorsOf() integration with feature gate disabled (testing the default behavior)

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Link to Github Issue: #2495
Epic: #2479

Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
Copilot AI review requested due to automatic review settings March 6, 2026 16:37
@openshift-ci openshift-ci bot requested review from joelanford and perdasilva March 6, 2026 16:37
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 8dcab49
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69ab16baf5a33400089ade23
😎 Deploy Preview https://deploy-preview-2543--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.

@openshift-ci
Copy link

openshift-ci bot commented Mar 6, 2026

[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 kevinrizza for approval. For more information see the Code Review Process.

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

Details 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

Copy link
Contributor

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 introduces an alpha feature gate to allow OLMv1 upgrade resolution to treat “re-released” bundles (same semver, higher release/build value like 2.0.0+1 -> 2.0.0+2) as valid successors when explicitly enabled.

Changes:

  • Added ReleaseVersionPriority feature gate (Alpha, default disabled).
  • Added SameVersionHigherRelease() predicate and integrated it into SuccessorsOf() behind the feature gate.
  • Added unit tests for SameVersionHigherRelease() and for SuccessorsOf() with the gate disabled.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/operator-controller/features/features.go Defines the new ReleaseVersionPriority feature gate and its spec.
internal/operator-controller/catalogmetadata/filter/successors.go Conditionally expands successor matching to include same-version/higher-release bundles when gated on.
internal/operator-controller/catalogmetadata/filter/bundle_predicates.go Adds the SameVersionHigherRelease() predicate.
internal/operator-controller/catalogmetadata/filter/bundle_predicates_test.go Adds predicate unit tests including edge cases.
internal/operator-controller/catalogmetadata/filter/successors_test.go Adds a regression test to ensure default (gate-off) behavior does not accept higher-release bundles.

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

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.62%. Comparing base (a9a9b40) to head (8dcab49).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2543   +/-   ##
=======================================
  Coverage   68.62%   68.62%           
=======================================
  Files         131      131           
  Lines        9288     9298   +10     
=======================================
+ Hits         6374     6381    +7     
- Misses       2429     2432    +3     
  Partials      485      485           
Flag Coverage Δ
e2e 42.32% <16.66%> (-0.31%) ⬇️
experimental-e2e 51.79% <16.66%> (-0.08%) ⬇️
unit 53.76% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
Copilot AI review requested due to automatic review settings March 6, 2026 17:34
Copy link
Contributor

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

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


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

Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
@joelanford
Copy link
Member

If I understand this correctly, it looks like this introduces the new behavior that an explicit upgrade edge doesn't actually have to exist in the catalog to upgrade to a bundle that has the same version and a higher release. Is that the intent? (If so let's make that clear in the PR description).

Is it also the intent that we'll inherit the upgrade edges of the first release of the version?

const testPackageName = "test-package"

// Expected bundle version 2.0.0+1
expect, err := bundle.NewLegacyRegistryV1VersionRelease("2.0.0+1")
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest putting the expect value in the test case, and adding cases that start from different values. For example: from a version without a release.

Also related: do we need to add code that knows how to parse the new Release field of the olm.package property (around here:

vr, err := bundle.NewLegacyRegistryV1VersionRelease(pkg.Version)
)?

Copy link
Member

Choose a reason for hiding this comment

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

iirc, @grokspawn's design called for a specific precedence when handling both release and build metadata that we will need to account for.

Comment on lines +38 to +40
// If release version priority is enabled, also consider bundles
// with the same semantic version but higher release as valid successors.
// This allows upgrades to re-released bundles (e.g., 2.0.0+1 -> 2.0.0+2).
Copy link
Member

Choose a reason for hiding this comment

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

What if the re-release version is already in the explicit upgrade graph? In that case, should we ignore it and let its explicit channel entry take precedence? That would preserve existing behavior.

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.

3 participants