Skip to content

Add CSV metadata minification migration - #2088

Draft
joelanford wants to merge 1 commit into
operator-framework:masterfrom
joelanford:csv-metadata-minification
Draft

joelanford wants to merge 1 commit into
operator-framework:masterfrom
joelanford:csv-metadata-minification

Conversation

@joelanford

Copy link
Copy Markdown
Member

Add the minify-csv-metadata migration and register it after bundle-object-to-csv-metadata. The migration rewrites existing olm.csv.metadata properties while leaving other bundle properties unchanged.

Minify CRD and API service definitions to retain only their identifying and display fields: Name, Group where applicable, Version, Kind, DisplayName, and Description. Add tests covering migration sequencing and removal of the omitted definition fields.

This follows the OLMv0 package-server implementation, which filters CRD and API service descriptions to the same fields: https://github.com/operator-framework/operator-lifecycle-manager/blob/cf27af72356d95b33c2fcb38dcff4d9ca2e7d475/pkg/package-server/apis/operators/packagemanifest.go#L28-L31

For the Red Hat 4.22 catalog, the catalog size decreases from 118,396 KiB (116M) to 47,200 KiB (47M) after migration and minification, a reduction of 71,196 KiB or approximately 60.1%.

Add the minify-csv-metadata migration and register it after bundle-object-to-csv-metadata. The migration rewrites existing olm.csv.metadata properties while leaving other bundle properties unchanged.

Minify CRD and API service definitions to retain only their identifying and display fields: Name, Group where applicable, Version, Kind, DisplayName, and Description. Add tests covering migration sequencing and removal of the omitted definition fields.

This follows the OLMv0 package-server implementation, which filters CRD and API service descriptions to the same fields:
https://github.com/operator-framework/operator-lifecycle-manager/blob/cf27af72356d95b33c2fcb38dcff4d9ca2e7d475/pkg/package-server/apis/operators/packagemanifest.go#L28-L31

For the Red Hat 4.22 catalog, the catalog size decreases from 118,396 KiB (116M) to 47,200 KiB (47M) after migration and minification, a reduction of 71,196 KiB or approximately 60.1%.
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 15, 2026
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@openshift-ci

openshift-ci Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

[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

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.75%. Comparing base (7465ba8) to head (8fb9ff3).

Files with missing lines Patch % Lines
alpha/action/migrations/001_minify_csv_metadata.go 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2088      +/-   ##
==========================================
+ Coverage   59.55%   59.75%   +0.19%     
==========================================
  Files          99      100       +1     
  Lines        8157     8202      +45     
==========================================
+ Hits         4858     4901      +43     
- Misses       2724     2725       +1     
- Partials      575      576       +1     

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

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant