Skip to content

Conversation

@ankitathomas
Copy link
Contributor

@ankitathomas ankitathomas commented Sep 29, 2021

Check only for pruning of newly added bundles, allow existing bundles to be silently dropped in case of no specified paths

Also, update pruning error for clarity

Closes #799

@openshift-ci openshift-ci bot requested review from exdx and joelanford September 29, 2021 20:16
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
@codecov
Copy link

codecov bot commented Sep 29, 2021

Codecov Report

Merging #798 (a4f3f46) into master (37551d4) will decrease coverage by 0.10%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #798      +/-   ##
==========================================
- Coverage   51.18%   51.08%   -0.11%     
==========================================
  Files         103      103              
  Lines        9078     9041      -37     
==========================================
- Hits         4647     4619      -28     
+ Misses       3551     3545       -6     
+ Partials      880      877       -3     
Impacted Files Coverage Δ
pkg/lib/registry/registry.go 19.50% <84.61%> (-9.32%) ⬇️
alpha/action/render.go 63.87% <0.00%> (+0.85%) ⬆️

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 37551d4...a4f3f46. Read the comment docs.

@ankitathomas ankitathomas changed the title clarify pruned bundle message Check only for new bundles on add Sep 29, 2021
Signed-off-by: Ankita Thomas <ankithom@redhat.com>
@bparees
Copy link
Contributor

bparees commented Sep 29, 2021

@ankitathomas @kevinrizza @joelanford I think this is a good example of where i'd have expected some sort of "opm add" CI test gating to have prevented the original change(the one that regressed the behavior by erroring out on any pruned bundle) from going in.

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.

Looking good. Just a quick question.

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 Sep 30, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Sep 30, 2021
version: "1.2.0",
},
},
action: actionAdd,
Copy link
Member

Choose a reason for hiding this comment

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

Probably outside the scope of this pull request, but it would be nice if we had a way of comparing the contents of the database based on these actions rather than just checking for error conditions.

var err error
checkForBundleInChannel:
for _, channel := range bundle.Channels {
if graph == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason not to just do this once before we iterate?

},
{
description: "silentPruneForExistingBundle",
steps: []step{
Copy link
Member

Choose a reason for hiding this comment

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

Should we also test for the case where we're inserting multiple new bundles into the same graph? Both the failure case (one of those bundles doesn't replace another) and the success case (one of the bundles resets the graph, another gets added on top of it)?

wantErr: fmt.Errorf("add prunes bundle unorderedReplaces-1.0.0 (unorderedReplaces-1.0.0) from package testpkg, channel stable: this may be due to incorrect channel head (unorderedReplaces-1.1.0, skips/replaces [])"),
},
{
description: "silentPruneForExistingBundle",
Copy link
Member

Choose a reason for hiding this comment

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

nit: casing should match on all test names.

Signed-off-by: Ankita Thomas <ankithom@redhat.com>
Copy link
Member

@kevinrizza kevinrizza left a comment

Choose a reason for hiding this comment

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

/lgtm

action: actionAdd,
},
{
bundles: map[string]bundleDir{
Copy link
Member

Choose a reason for hiding this comment

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

👍

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2021
@openshift-merge-robot openshift-merge-robot merged commit 2ef669f into operator-framework:master Oct 1, 2021
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opm add pruning error is unclear

6 participants