Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(resolver): filtering deprecated bundles in resolver #1673

Conversation

gallettilance
Copy link
Member

Description of the change:

Motivation for the change:

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

Sorry, something went wrong.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2020
@gallettilance
Copy link
Member Author

waiting on operator-framework/operator-registry#397

@dinhxuanvu dinhxuanvu added the area/dependency Issues or PRs related to dependency changes label Jul 23, 2020
@ecordell ecordell force-pushed the new-resolver branch 3 times, most recently from 807be79 to e74f576 Compare July 26, 2020 10:51
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2020
@ecordell ecordell force-pushed the new-resolver branch 3 times, most recently from 64fc053 to 2467b25 Compare July 28, 2020 14:12
@gallettilance gallettilance force-pushed the deprecated-filter branch 2 times, most recently from 33bdf15 to 6fa52e8 Compare July 30, 2020 14:00
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2020
@@ -73,6 +73,8 @@ func (r *SatResolver) SolveOperators(namespaces []string, csvs []*v1alpha1.Clust
predicates = append(predicates, WithChannel(sub.Spec.Channel))
}

predicates = append(predicates, WithoutDeprecatedProperty())
Copy link
Member

Choose a reason for hiding this comment

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

this applies for finding updates / new installs, but we also need this predicate when searching for dependency candidates - see line 302 in getBundleInstallables

@dinhxuanvu dinhxuanvu changed the title WIP Updating: filtering deprecated bundles in resolver feat(resolver): filtering deprecated bundles in resolver Jul 30, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 30, 2020
@dinhxuanvu
Copy link
Member

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2020
@dinhxuanvu dinhxuanvu changed the base branch from new-resolver to master July 30, 2020 15:43
@dinhxuanvu
Copy link
Member

/retest

@dinhxuanvu
Copy link
Member

Looking this is missing some go mod vendor action because I don't see any new changes from registry being pulled into this PR.

@dinhxuanvu
Copy link
Member

This PR can be merged when it is lgtm and approve. I remove the hold.
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2020
Copy link
Contributor

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

Have a couple of comments @gallettilance

@@ -416,6 +416,18 @@ func WithPackage(pkg string) OperatorPredicate {
}
}

func WithoutDeprecatedProperty() OperatorPredicate {
return func(o *Operator) bool {
props := o.bundle.GetProperties()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: properties, since you've already used properties here

Copy link
Member Author

Choose a reason for hiding this comment

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

there is only one deprecated property per bundle

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't GetProperties returning properties (irrespective of whether those properties are deprecated or not)? And there's a for loop after this that's iterating on the properties we're getting from GetProperties

return func(o *Operator) bool {
		properties := o.bundle.GetProperties()
		for _, property := range properties {
			if property is deprecated {
				return false
			}
		}
		return true
	}

reads much better

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, you could eliminate the variable properties completely:

for _, p := range o.bundle.GetProperties()

Copy link
Member Author

Choose a reason for hiding this comment

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

@anik120 I thought you were talking about the function name - this makes sense to me

@@ -297,8 +297,6 @@ func NewOperatorFromBundle(bundle *api.Bundle, startingCSV string, sourceKey reg
return op, nil
}


Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this file hasn't really been changed and just has noises.

Copy link
Member Author

Choose a reason for hiding this comment

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

different go formatting I guess

Copy link
Contributor

Choose a reason for hiding this comment

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

Would reduce noise in this PR if this was reverted back.

@gallettilance
Copy link
Member Author

/retest

@benluddy
Copy link
Contributor

/retest

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2020
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, gallettilance

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@anik120
Copy link
Contributor

anik120 commented Jul 31, 2020

/lgtm

@gallettilance
Copy link
Member Author

/retest

1 similar comment
@gallettilance
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@dinhxuanvu
Copy link
Member

/retest

2 similar comments
@gallettilance
Copy link
Member Author

/retest

@gallettilance
Copy link
Member Author

/retest

@benluddy
Copy link
Contributor

pkg/controller/registry/resolver/cache_test.go:310:35: not enough arguments in call to apiSetToProperties
	have (map["github.com/operator-framework/operator-registry/pkg/registry".APIKey]struct {}, nil)
	want (APISet, APISet, bool) 

https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/operator-framework_operator-lifecycle-manager/1673/pull-ci-operator-framework-operator-lifecycle-manager-master-unit/1289276602584141824#1:build-log.txt%3A39

If these are passing locally, you probably need to rebase and check this out.

@dinhxuanvu
Copy link
Member

/retest

@openshift-ci-robot
Copy link
Collaborator

@gallettilance: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/unit 8cd1b77 link /test unit
ci/prow/e2e-aws-console-olm 8cd1b77 link /test e2e-aws-console-olm
ci/prow/e2e-aws-olm 8cd1b77 link /test e2e-aws-olm

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@dinhxuanvu
Copy link
Member

Replaced by #1699

@dinhxuanvu dinhxuanvu closed this Jul 31, 2020
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. area/dependency Issues or PRs related to dependency changes lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants