Skip to content

🌱 consolidate Release types with operator-registry - #2771

Merged
openshift-merge-bot[bot] merged 3 commits into
operator-framework:mainfrom
rashmigottipati:consolidate-release-type
Jun 30, 2026
Merged

🌱 consolidate Release types with operator-registry#2771
openshift-merge-bot[bot] merged 3 commits into
operator-framework:mainfrom
rashmigottipati:consolidate-release-type

Conversation

@rashmigottipati

Copy link
Copy Markdown
Member

Description

Removes duplicate bundle.Release and bundle.VersionRelease type definitions in favor of using declcfg.Release and declcfg.VersionRelease from operator-registry.

This consolidates type definitions between operator-controller and operator-registry, eliminating code duplication and aligning with the vision from OPRUN-4548.

Changes:

  • Delete internal/operator-controller/bundle/versionrelease.go and the test file
  • Update all internal code to use declcfg.VersionRelease and declcfg.Release from operator-registry
  • API boundary (BundleMetadata.Release) remains *string with conversion at:
    • bundleutil.MetadataFor (declcfg -> API)
    • catalogmetadata/filter.parseInstalledBundleVersionRelease (API -> declcfg)

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

CopilotAI review requested due to automatic review settings June 16, 2026 23:50
@netlify

netlifyBot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit74c294c
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/6a3eae50e78cc90008fc2090
😎 Deploy Previewhttps://deploy-preview-2771--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changesRun an agent on this branch

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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 removes operator-controller’s duplicate bundle.Release / bundle.VersionRelease definitions and standardizes on declcfg.Release / declcfg.VersionRelease from operator-registry, keeping the API boundary (BundleMetadata.Release as *string) intact via conversion helpers.

Changes:

  • Replaced internal bundle.VersionRelease usage across resolver, catalogmetadata filtering/comparison, and tests with declcfg.VersionRelease.
  • Moved legacy registry+v1 “release-in-build-metadata” parsing logic into package-local helpers where needed, and updated metadata conversion (bundleutil.MetadataFor) accordingly.
  • Removed the now-redundant internal/operator-controller/bundle/versionrelease.go and its unit tests; updated generated CRD artifacts touched by regeneration.

Reviewed changes

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

Show a summary per file
FileDescription
manifests/experimental.yamlUpdates generated experimental manifests (includes CRD generator version annotation change for ClusterExtension CRD).
manifests/experimental-e2e.yamlUpdates generated experimental e2e manifests (includes CRD generator version annotation change for ClusterExtension CRD).
internal/operator-controller/resolve/resolver.goChanges resolver interface to return *declcfg.VersionRelease instead of the internal type.
internal/operator-controller/resolve/catalog.goPropagates declcfg.VersionRelease through catalog resolution return types.
internal/operator-controller/resolve/catalog_test.goUpdates resolver unit tests to assert against declcfg.VersionRelease.
internal/operator-controller/controllers/clusterextension_controller_test.goUpdates controller tests to use declcfg.VersionRelease in mocked resolver responses.
internal/operator-controller/catalogmetadata/filter/successors.goConverts installed bundle metadata parsing to produce *declcfg.VersionRelease, including legacy registry+v1 parsing helper.
internal/operator-controller/catalogmetadata/filter/successors_test.goAdjusts successor/filter tests to use declcfg.VersionRelease parsing helper.
internal/operator-controller/catalogmetadata/filter/bundle_predicates.goUpdates version/release predicate API to take declcfg.VersionRelease and compare via declcfg’s Compare semantics.
internal/operator-controller/catalogmetadata/compare/compare.goUpdates bundle version/release comparison to use declcfg.VersionRelease.
internal/operator-controller/bundleutil/bundle.goUpdates bundle property parsing and MetadataFor conversion to use declcfg.Release / declcfg.VersionRelease and new legacy parsing/conversion helpers.
internal/operator-controller/bundleutil/bundle_test.goUpdates bundleutil tests for declcfg.VersionRelease expectations.
internal/operator-controller/bundle/versionrelease.goDeletes the duplicated internal release/version types and logic.
internal/operator-controller/bundle/versionrelease_test.goDeletes unit tests for the removed internal release/version types.
helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yamlUpdates generated Helm base CRD for ClusterExtension (includes generator version annotation change).

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

Comment threadinternal/operator-controller/bundleutil/bundle.go Outdated
Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated
Comment threadmanifests/experimental.yaml Outdated
Comment threadmanifests/experimental-e2e.yaml Outdated
@codecov

codecovBot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.31%. Comparing base (cf0266c) to head (74c294c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #2771 +/- ##
==========================================
- Coverage 70.42% 70.31% -0.12% 
==========================================
Files 143 142 -1 Lines 10625 10577 -48 ==========================================
- Hits 7483 7437 -46 + Misses 2580 2579 -1 + Partials 562 561 -1 
FlagCoverage Δ
e2e35.14% <60.46%> (+<0.01%)⬆️
experimental-e2e52.59% <39.53%> (+0.30%)⬆️
unit59.32% <100.00%> (-0.19%)⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@rashmigottipati
rashmigottipatiforce-pushed the consolidate-release-type branch 2 times, most recently from 2865724 to ccc8f3bCompareJune 17, 2026 13:21
CopilotAI review requested due to automatic review settings June 17, 2026 13:21

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 12 out of 12 changed files in this pull request and generated 1 comment.

Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated

@tmshorttmshort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most of this is changing the namespace of an API, but there is some de-duplication that could be done.

Comment threadinternal/operator-controller/bundleutil/bundle.go Outdated
Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated
Comment threadinternal/operator-controller/bundleutil/bundle.go Outdated
Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated
@openshift-ciopenshift-ciBot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2026
CopilotAI review requested due to automatic review settings June 24, 2026 03:28
@rashmigottipati
rashmigottipatiforce-pushed the consolidate-release-type branch from ac0cad4 to e0fe939CompareJune 24, 2026 03:28
@openshift-ciopenshift-ciBot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2026
@rashmigottipati
rashmigottipatiforce-pushed the consolidate-release-type branch from e0fe939 to da8ab9cCompareJune 24, 2026 03:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 12 out of 12 changed files in this pull request and generated 2 comments.

Comment threadinternal/operator-controller/bundleutil/bundle.go
@rashmigottipati
rashmigottipatiforce-pushed the consolidate-release-type branch from da8ab9c to 21e1ef3CompareJune 24, 2026 03:34
CopilotAI review requested due to automatic review settings June 24, 2026 03:34

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 12 out of 12 changed files in this pull request and generated 1 comment.

Comment threadinternal/operator-controller/bundleutil/bundle.go
Comment threadinternal/operator-controller/bundleutil/bundle.go
CopilotAI review requested due to automatic review settings June 24, 2026 09:00
@perdasilva
perdasilvaforce-pushed the consolidate-release-type branch from 518364a to 21e1ef3CompareJune 24, 2026 09:00

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 12 out of 12 changed files in this pull request and generated no new comments.

@perdasilvaperdasilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review: Consolidate Release types with operator-registry

4 inline comments posted + 3 additional findings below.


Double JSON unmarshal in parseVersionRelease (bundleutil/bundle.go:66-76)

pkgData is unmarshalled twice: once into property.Package (line 66) and again into a helper struct (line 76) just to detect Release *string presence. Only pkg.Version is actually used from property.Package. A single struct struct{ Version string \json:"version"`; Release *string `json:"release"` }` would serve both purposes in one unmarshal pass.

SuccessorsOf double-parses installed bundle version (successors.go:57-75)

parseInstalledBundleVersionRelease (line 57) parses installedBundle.Version into a bsemver.Version, then legacySuccessor (line 75) parses the exact same string again via bsemver.Parse. The already-parsed version could be passed to legacySuccessor instead.

33 comparison test cases deleted without equivalent upstream coverage

The deleted bundle/versionrelease_test.go contained TestRelease_Compare (17 cases) and TestVersionRelease_Compare (16 cases). operator-registry v1.72.0's versionrelease_test.go has zero dedicated Compare tests — only a single equality assertion inside a round-trip test. ParseLegacyVersionRelease also has no direct unit tests (only indirect coverage through GetVersionAndRelease). Consider either adding comparison tests upstream or keeping a subset here.

Comment threadinternal/operator-controller/bundleutil/bundle.go
Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated
Comment threadinternal/operator-controller/catalogmetadata/filter/successors.go Outdated
Comment threadinternal/operator-controller/bundleutil/bundle.go Outdated
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
- Export parseExplicitRelease as ParseExplicitRelease and use it from
parseInstalledBundleVersionRelease to deduplicate logic
- Replace manual loop with slicesutil.Map in asLegacyRegistryV1Version
- Update test error message expectation
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
@perdasilva

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva

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

The pull request process is described 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

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2026
@perdasilva

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2026
@openshift-merge-bot
openshift-merge-botBot merged commit 89b2b88 into operator-framework:mainJun 30, 2026
26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@rashmigottipati@perdasilva@pedjak@tmshort@grokspawn