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

Removes error silencing from IsFailForwardEnabled #2957

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Apr 24, 2023

Description of the change:

  • IsFailForwardEnabled is currently silincing errors from List method. This change makes it propogate errors to the caller.
  • Also IsFailForwardEnabled currently has a specifal case for situation where there are 0 OperatorGroups (len(ogs) == 0) which no longer makes sense: one OperatorGroups is required. This now falls into more generic len(ogs) != 1 condition.

Main change is in pkg/controller/registry/resolver/fail_forward.go. Everything else is just updates required to fix tests: many of them were working without a fake operator group before.

Motivation for the change:

Follow up from this conversation - #2952 (comment).

Architectural changes:

Change in how we handle zero OperatorGroups.

Testing remarks:

Existing tests should cover 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
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

@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 Apr 24, 2023
@openshift-ci
Copy link

openshift-ci bot commented Apr 24, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@m1kola m1kola force-pushed the IsFailForwardEnabled-simplify branch from 02cff6c to e781c82 Compare April 24, 2023 16:58
@m1kola m1kola marked this pull request as ready for review April 24, 2023 17:53
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2023
@m1kola m1kola force-pushed the IsFailForwardEnabled-simplify branch 2 times, most recently from f7656be to c682d1a Compare April 26, 2023 15:20
@@ -335,6 +335,7 @@ func TestResolver(t *testing.T) {
name: "SubscriptionOmitsChannel",
clusterState: []runtime.Object{
newSub(namespace, "package", "", catalog),
newOperatorGroup("foo", namespace),
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: there is a lot of copy-pasted newOperatorGroup("foo", namespace) lines. What is not very visible in the diff is that there are some calls for newOperatorGroup where strategy is set to fail forward.

Previously presence of OG in cluster state was not required in this test (and in others in this PR) because was len(ogs) == 0 condition in IsFailForwardEnabled which was returning a default value for a timeout and now we explicitly return an error in this case. So tests had to be updated.

@perdasilva
Copy link
Collaborator

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2023
Copy link
Collaborator

@perdasilva perdasilva left a comment

Choose a reason for hiding this comment

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

lgtm - thank you!!!!

@openshift-ci
Copy link

openshift-ci bot commented May 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: m1kola, perdasilva

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

@perdasilva perdasilva force-pushed the IsFailForwardEnabled-simplify branch from c682d1a to 579a0d7 Compare May 22, 2023 13:03
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@m1kola m1kola force-pushed the IsFailForwardEnabled-simplify branch from 579a0d7 to d6158bf Compare May 26, 2023 13:31
@grokspawn
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2023
@openshift-merge-robot openshift-merge-robot merged commit 08a95ad into operator-framework:master Jun 12, 2023
@m1kola m1kola deleted the IsFailForwardEnabled-simplify branch June 12, 2023 13:32
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