Skip to content

🐛 OCPBUGS-84642: remove substitutesFor interpretation from sqlite code#1966

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:masterfrom
grokspawn:sqlite-release-leakage
May 1, 2026
Merged

🐛 OCPBUGS-84642: remove substitutesFor interpretation from sqlite code#1966
openshift-merge-bot[bot] merged 1 commit into
operator-framework:masterfrom
grokspawn:sqlite-release-leakage

Conversation

@grokspawn

@grokspawn grokspawn commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Description of the change:
Removes bundle release inference from legacy build metadata / substitutesFor annotation approach for both SQLite and FBC processing paths.

Motivation for the change:
SQLite opm index add and friends were adding multiple distinct bundle versions into catalogs: inferred release version, and without inferred release version. This made the catalog invalid due to FBC constraints on only a single bundle version property. It also failed opm validate of resulting FBC because bundles with explicit release versions must comply with bundle naming restrictions.

The underlying problem is that while it is trivial to infer the release version from legacy approach data when the CSV is processed, the resulting FBC loses any identification that the release version was inferred vs explicit set in the catalog.

Since there is no perceptible pattern in the resulting naming (and bundle names cannot be changed after they are published, as OLMv0 requires that the CSV metadata.name matches the olm.bundle FBC .name at all times, the distinction must be re-inferred from first principles.

For example, given the original FBC

name: cryostat-operator.v2.2.1-13
properties:
- type: olm.package
  value:
    packageName: cryostat-operator
    version: 2.2.1+13
- type: olm.csv.metadata
  value:
    annotations:
      olm.substitutesFor: cryostat-operator.v2.2.1-12

when processed with an inferred release version to become

name: cryostat-operator.v2.2.1-13
properties:
- type: olm.package
  value:
    packageName: cryostat-operator
    version: 2.2.1
    release: 13

has no evidence of the inference, no discernable pattern in the remaining data, and is immediately in violation of the bundle naming conventions when a release version is set.

To forgo the naming conventions, it is necessary to re-infer by evaluating:

  • bundle.CSVJSON blob (only present for SQLite --> FBC conversions)
  • bundle's olm.bundle.object property corresponding to the serialized CSV, if present
  • bundle's olm.csv.metadata property corresponding to select data from the CSV, if present

It's far easier to remove the inference and fix the bug while we continue to debate the merits.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Copilot AI review requested due to automatic review settings April 27, 2026 21:11
@openshift-ci openshift-ci Bot requested review from oceanc80 and pedjak April 27, 2026 21:11
@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.70%. Comparing base (12f8cdd) to head (92bd35a).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1966      +/-   ##
==========================================
- Coverage   57.71%   57.70%   -0.02%     
==========================================
  Files         139      139              
  Lines       13373    13360      -13     
==========================================
- Hits         7718     7709       -9     
+ Misses       4468     4465       -3     
+ Partials     1187     1186       -1     

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Moves legacy “release version from semver build metadata” interpretation out of bundle SQLite ingestion paths and into API→model property conversion so that legacy release semantics are only applied when producing/manipulating FBC.

Changes:

  • Removed build-metadata→release extraction from pkg/registry bundle parsing logic.
  • Added build-metadata→release extraction when converting olm.package properties in pkg/api API→model conversion.

Reviewed changes

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

File Description
pkg/registry/parse.go Removes legacy build-metadata release interpretation from bundle parsing/derived property generation.
pkg/api/api_to_model.go Adds backwards-compat build-metadata splitting into olm.package release during API→model property conversion.

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

Comment thread pkg/api/api_to_model.go Outdated
Comment thread pkg/api/api_to_model.go Outdated
Comment thread pkg/api/api_to_model.go Outdated
@grokspawn grokspawn changed the title relocate freshmaker interpretation from sqlite code 🐛 relocate freshmaker interpretation from sqlite code Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 21:34
@grokspawn grokspawn force-pushed the sqlite-release-leakage branch from cc9a90d to 4762b74 Compare April 27, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

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


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

Comment thread alpha/declcfg/declcfg_to_model_test.go Outdated
Comment thread alpha/declcfg/declcfg_to_model.go Outdated
Comment thread alpha/declcfg/declcfg_to_model.go Outdated
@grokspawn grokspawn changed the title 🐛 relocate freshmaker interpretation from sqlite code 🐛 OCPBUGS-84642: relocate freshmaker interpretation from sqlite code Apr 28, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@grokspawn: This pull request references Jira Issue OCPBUGS-84642, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Description of the change:
This is separated into two commits for easier review:

  1. Performs bundle release version interpretation from legacy build metadata approaches ONLY when manipulating FBC.
  2. Performs bundle metadata extraction during FBC->FBC operations, like opm render, adds unit tests (we might want to NOT handle implicit interpretation in this path, and instead add this as a new 'migration-level' -- which is how we handle optional transmogrification of the FBC formats)

Motivation for the change:
The earlier PR accidentally would create explicit release versions for bundles even in SQLite processing codepaths (for e.g. opm index add).

This PR moves this interpretation to an area safe from legacy (and deprecated) SQLite operations. An interesting note that SQLite data historically would represent bundle properties multiple times, but the implemented property deduplication scheme only recognizes properties with the same key AND value, so doesn't work to alleviate cases where duplicate properties differ by value only -- for reasons. Any change to that area could have complex and substantial side-effects with legacy code paths that are no longer supported, so this PR proposes approaches which leave historical approaches intact.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@grokspawn

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@grokspawn: This pull request references Jira Issue OCPBUGS-84642, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tmshort

tmshort commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

/approve
Do you need to address any of Copilot's comments?

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2026
@grokspawn

Copy link
Copy Markdown
Contributor Author

/hold
We want to protect FBC-to-FBC conversions to be consistent with other migration level options. Implementing that.

@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 Apr 29, 2026
@grokspawn grokspawn force-pushed the sqlite-release-leakage branch from 4762b74 to 2b7d4a5 Compare April 30, 2026 18:11
…ta in CSV

Signed-off-by: grokspawn <jordan@nimblewidget.com>
@grokspawn grokspawn force-pushed the sqlite-release-leakage branch from 2b7d4a5 to 92bd35a Compare April 30, 2026 19:28
Copilot AI review requested due to automatic review settings April 30, 2026 19:28
@grokspawn grokspawn changed the title 🐛 OCPBUGS-84642: relocate freshmaker interpretation from sqlite code 🐛 OCPBUGS-84642: remove freshmaker interpretation from sqlite code Apr 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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


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

@openshift-ci-robot

Copy link
Copy Markdown

@grokspawn: This pull request references Jira Issue OCPBUGS-84642, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Description of the change:
Removes bundle release inference from legacy build metadata / substitutesFor annotation approach for both SQLite and FBC processing paths.

Motivation for the change:
SQLite opm index add and friends were adding multiple distinct bundle versions into catalogs: inferred release version, and without inferred release version. This made the catalog invalid due to FBC constraints on only a single bundle version property. It also failed opm validate of resulting FBC because bundles with explicit release versions must comply with bundle naming restrictions.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. label Apr 30, 2026
@grokspawn grokspawn changed the title 🐛 OCPBUGS-84642: remove freshmaker interpretation from sqlite code 🐛 OCPBUGS-84642: remove substitutesFor interpretation from sqlite code Apr 30, 2026
@grokspawn

Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2026
@openshift-ci

openshift-ci Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford, tmshort

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

@joelanford

Copy link
Copy Markdown
Member

/lgtm

@openshift-merge-bot openshift-merge-bot Bot merged commit bd6255d into operator-framework:master May 1, 2026
17 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@grokspawn: Jira Issue OCPBUGS-84642: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-84642 has been moved to the MODIFIED state.

Details

In response to this:

Description of the change:
Removes bundle release inference from legacy build metadata / substitutesFor annotation approach for both SQLite and FBC processing paths.

Motivation for the change:
SQLite opm index add and friends were adding multiple distinct bundle versions into catalogs: inferred release version, and without inferred release version. This made the catalog invalid due to FBC constraints on only a single bundle version property. It also failed opm validate of resulting FBC because bundles with explicit release versions must comply with bundle naming restrictions.

The underlying problem is that while it is trivial to infer the release version from legacy approach data when the CSV is processed, the resulting FBC loses any identification that the release version was inferred vs explicit set in the catalog.

Since there is no perceptible pattern in the resulting naming (and bundle names cannot be changed after they are published, as OLMv0 requires that the CSV metadata.name matches the olm.bundle FBC .name at all times, the distinction must be re-inferred from first principles.

For example, given the original FBC

name: cryostat-operator.v2.2.1-13
properties:
- type: olm.package
 value:
   packageName: cryostat-operator
   version: 2.2.1+13
- type: olm.csv.metadata
 value:
   annotations:
     olm.substitutesFor: cryostat-operator.v2.2.1-12

when processed with an inferred release version to become

name: cryostat-operator.v2.2.1-13
properties:
- type: olm.package
 value:
   packageName: cryostat-operator
   version: 2.2.1
   release: 13

has no evidence of the inference, no discernable pattern in the remaining data, and is immediately in violation of the bundle naming conventions when a release version is set.

To forgo the naming conventions, it is necessary to re-infer by evaluating:

  • bundle.CSVJSON blob (only present for SQLite --> FBC conversions)
  • bundle's olm.bundle.object property corresponding to the serialized CSV, if present
  • bundle's olm.csv.metadata property corresponding to select data from the CSV, if present

It's far easier to remove the inference and fix the bug while we continue to debate the merits.

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.0.0-0.nightly-2026-05-07-185738

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants