Skip to content

feat(resolver): Indicate dependency class in resolution constraint text #2258

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

Merged

Conversation

anik120
Copy link
Contributor

@anik120 anik120 commented Jul 15, 2021

Description of the change:

This PRintroduces a String() method to the Predicate interface, implementations
of which are used to build clauses that are fed to the sat solver. Calling the
predicate.String() method enhances the error messages displayed when dependency
resolution fails.

For example, an error message previously due to an unsatisfyiable contraint was
diplayed as

ResolutionFailed' constraints not satisfiable: bundle etcdoperator-community.v0.6.1 has
a dependency without any candidates to satisfy it, subscription etcd requires
my-catalog/olm/alpha/etcdoperator-community.v0.6.1, subscription etcd exists

With this commit, the same error is displayed as:

ResolutionFailed' constraints not satisfiable: bundle etcdoperator-community.v0.6.1 requires
an operator with package:foo and with version in range:>0.27.0, subscription etcd requires
my-catalog/olm/alpha/etcdoperator-community.v0.6.1, subscription etcd exists

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 /doc
  • Commit messages sensible and descriptive

@openshift-ci openshift-ci bot requested review from awgreene and exdx July 15, 2021 18:16
@anik120 anik120 force-pushed the all-about-predicates branch from a6f183f to c571eb3 Compare July 15, 2021 18:46
@anik120 anik120 requested review from benluddy and ecordell July 15, 2021 19:19
Copy link
Contributor

@ankitathomas ankitathomas 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 16, 2021
Copy link
Contributor

@benluddy benluddy left a comment

Choose a reason for hiding this comment

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

Looks great!

@anik120 anik120 force-pushed the all-about-predicates branch from c571eb3 to 1e78d44 Compare July 22, 2021 15:45
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@anik120 anik120 force-pushed the all-about-predicates branch from 1e78d44 to 2f5fc18 Compare July 22, 2021 17:24
This commit introduces a String() method to the Predicate interface, implementations
of which are used to build clauses that are fed to the sat solver. Calling the
predicate.String() method enhances the error messages displayed when dependency
resolution fails.

For example, an error message previously due to an unsatisfyiable contraint was
diplayed as

```
ResolutionFailed' constraints not satisfiable: bundle etcdoperator-community.v0.6.1 has
a dependency without any candidates to satisfy it, subscription etcd requires
my-catalog/olm/alpha/etcdoperator-community.v0.6.1, subscription etcd exists
```

With this commit, the same error is displayed as:

```
ResolutionFailed' constraints not satisfiable: bundle etcdoperator-community.v0.6.1 requires
an operator with package:foo and with version in range:>0.27.0, subscription etcd requires
my-catalog/olm/alpha/etcdoperator-community.v0.6.1, subscription etcd exists
```

Signed-off-by: Anik Bhattacharjee <[email protected]>
@anik120 anik120 force-pushed the all-about-predicates branch from 2f5fc18 to 8c0f4aa Compare July 22, 2021 17:41
@benluddy
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jul 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anik120, ankitathomas, benluddy

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 Jul 22, 2021
@openshift-merge-robot openshift-merge-robot merged commit e944849 into operator-framework:master Jul 22, 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.

4 participants