Skip to content

Conversation

@jpower432
Copy link
Contributor

@jpower432 jpower432 commented Jan 18, 2022

opm diff in headsOnly mode with an include config will prune all empty channels
from a package which can leave the output config with an empty package. This change
will remove any empty packages after the channel pruning.

Fixes #904

Signed-off-by: Jennifer Power barnabei.jennifer@gmail.com

Description of the change:
This PR removes empty packages when using opm alpha diff with no previous reference.

Motivation for the change:
To ensure file-based catalogs are not being created with invalid packages by opm alpha diff

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

…Only mode

opm diff in headsOnly mode with an include config will prune all empty channels
from a package which can leave the output config with an empty package. This change
will remove any empty packages after the channel pruning.

Fixes operator-framework#904

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@openshift-ci openshift-ci bot requested review from anik120 and hasbro17 January 18, 2022 22:26
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 18, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 18, 2022

Hi @jpower432. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Jan 18, 2022

Codecov Report

Merging #905 (a9d2c64) into master (c056ac1) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #905      +/-   ##
==========================================
+ Coverage   52.07%   52.17%   +0.09%     
==========================================
  Files         103      103              
  Lines        9092     9094       +2     
==========================================
+ Hits         4735     4745      +10     
+ Misses       3449     3443       -6     
+ Partials      908      906       -2     
Impacted Files Coverage Δ
alpha/declcfg/diff.go 77.96% <100.00%> (+1.04%) ⬆️
pkg/registry/query.go 60.41% <0.00%> (-0.53%) ⬇️
alpha/declcfg/diff_include.go 67.92% <0.00%> (+6.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c056ac1...a9d2c64. Read the comment docs.

@dinhxuanvu dinhxuanvu changed the title fix(opm): adds removal of empty packages when using opm diff in heads… fix(opm): adds removal of empty packages when using opm diff in headsOnly mode Jan 19, 2022
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, jpower432

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

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 19, 2022
@dinhxuanvu
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2022
@joelanford
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2022
@openshift-merge-robot openshift-merge-robot merged commit f7e2773 into operator-framework:master Jan 19, 2022
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] opm: opm diff does not prune empty packages in headsonly mode.

4 participants