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

Bug 1823714: Update PkgManifest upon catsrc update #1482

Conversation

Bowenislandsong
Copy link
Member

The catsrc update sync triggred by the informer does not update pkgmanifest. This commit addes update mechanism.

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

@openshift-ci-robot
Copy link
Collaborator

@Bowenislandsong: This pull request references Bugzilla bug 1823714, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1823714: Update PkgManifest upon catsrc update

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 24, 2020
@Bowenislandsong
Copy link
Member Author

/retest

1 similar comment
@Bowenislandsong
Copy link
Member Author

/retest

Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

Hey @Bowenislandsong - nice work, this looks good. I have a few questions that I'd like you to address before I LGTM. Thanks!

@@ -189,6 +189,15 @@ func (p *RegistryProvider) syncCatalogSource(obj interface{}) (syncError error)
Namespace: source.GetNamespace(),
Copy link
Member

Choose a reason for hiding this comment

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

You commit message has misspelled words: triggred andaddes. You should consider enabling spellcheck in VIM or whichever editor you use to create your commit messages.

Copy link
Member Author

Choose a reason for hiding this comment

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

neat! did not know that's an option

Copy link
Member Author

Choose a reason for hiding this comment

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

funny, i went and looked. turns out i had it on. Somehow i dont see notifiations. I'll check what was wrong with that.

Comment on lines 192 to 199

logger.Infof("updating PackageManifest based on CatalogSource changes: %v", key)
timeout, cancel := context.WithTimeout(context.Background(), cacheTimeout)
defer cancel()
client, err := p.registryClient(key)
if err == nil {
err = p.refreshCache(timeout, client)
}
Copy link
Member

Choose a reason for hiding this comment

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

I see that your adding this code to check if the list of packages has changed. The code looks correct in that it will update the list of packagemanifests but I have two questions:

  1. Could you make sure that the error is captured when the PackageServer is unable to refresh the cache? Either as a log or returning the error?
  2. It looks like this could be moved into the if statement below to prevent it from being called when sources don't already exist. Could you investigate?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. wow that was a very nice catch, I assumed the return was err instead of syncError. Kinda a weird way to express dislike for this kind of error return method.
  2. good call, that would reduce the traffic. I somehow thought about it backward initially.

@@ -168,6 +169,74 @@ var _ = Describe("Package Manifest", func() {
require.True(GinkgoT(), ok, "Expect this image %s to exist in the related images list\n", v)
}
})
It("updating CatalogSource", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the test be more structured to use ginkgo's container blocks and replacing assertions with gomega matcher library? You could refer to #1424 as a reference

Copy link
Contributor

Choose a reason for hiding this comment

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

you could refer to this cheatsheet

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, that would be much better. I did think about it, but may I suggest that we do that in a separate PR and have this test arranged exactly like the other tests in this file? IMO refactoring should be its own PR rather than smuggles in bug fixes.

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the test to at least not to use assert and conform to the other tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a new test -- why create more future work for ourselves? If this bug were on fire, I can see the argument for addressing the test feedback in a follow-up, but it doesn't seem to be urgent enough to do that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @benluddy

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I agree, but I am saying waiting for https://github.com/operator-framework/operator-lifecycle-manager/pull/1439/files will resolve all of our concerns. That PR is very close to merging.

/hold

@Bowenislandsong Bowenislandsong force-pushed the bug/updateDisplayName branch 2 times, most recently from 482de5c to a8b8e85 Compare April 29, 2020 19:05
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. and removed bugzilla/medium labels Apr 30, 2020
@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 Apr 30, 2020
@SSshahan
Copy link

SSshahan commented May 9, 2020

/test e2e-aws-olm

@awgreene
Copy link
Member

/retest

Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

one or two comments.

Comment on lines 197 to 200
client, err := p.registryClient(key)
if err != nil {
syncError = err
return
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
client, err := p.registryClient(key)
if err != nil {
syncError = err
return
client, syncError := p.registryClient(key)
if syncErr != nil {
return
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I will update once the dependent PR is merged!

Copy link
Member Author

Choose a reason for hiding this comment

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

Just realized, i can't do this, and was delieberatly avoiding it. This reinitialized syncError.

Copy link
Member

Choose a reason for hiding this comment

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

Can we just return err on line 199?

Copy link
Member

Choose a reason for hiding this comment

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

@Bowenislandsong just change := to = and decalre the client variable before the function call

@Bowenislandsong Bowenislandsong force-pushed the bug/updateDisplayName branch 2 times, most recently from e2719ca to 3224d0c Compare May 20, 2020 18:12
@Bowenislandsong
Copy link
Member Author

/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 May 21, 2020
@Bowenislandsong Bowenislandsong force-pushed the bug/updateDisplayName branch 2 times, most recently from 675ebe7 to a665578 Compare May 26, 2020 14:46
Copy link
Contributor

@harishsurf harishsurf left a comment

Choose a reason for hiding this comment

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

Looks good. I just had one comment for the e2e test.

test/e2e/packagemanifest_e2e_test.go Outdated Show resolved Hide resolved
@Bowenislandsong
Copy link
Member Author

/retest

@Bowenislandsong
Copy link
Member Author

/retest e2e-aws-olm

Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

A few non-blocking nits, nice work.

Comment on lines 197 to 200
client, err := p.registryClient(key)
if err != nil {
syncError = err
return
Copy link
Member

Choose a reason for hiding this comment

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

@Bowenislandsong just change := to = and decalre the client variable before the function call

catalogSource, err = crc.OperatorsV1alpha1().CatalogSources(testNamespace).Get(context.TODO(), catalogSource.GetName(), metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred(), "error getting catalogSource")

displayName := "updated Name"
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be = not :=

@Bowenislandsong Bowenislandsong force-pushed the bug/updateDisplayName branch 2 times, most recently from c93b402 to d874c35 Compare May 27, 2020 18:40
@awgreene
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 27, 2020
The catsrc update sync triggered by the informer does not update pkgmanifest. This commit adds an update mechanism.
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.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2020
@dinhxuanvu
Copy link
Member

/approve

1 similar comment
@kevinrizza
Copy link
Member

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awgreene, Bowenislandsong, dinhxuanvu, kevinrizza

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 May 27, 2020
@openshift-bot
Copy link
Contributor

/retest

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

2 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.

@Bowenislandsong
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.

2 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-merge-robot openshift-merge-robot merged commit d4fe858 into operator-framework:master May 28, 2020
@openshift-ci-robot
Copy link
Collaborator

@Bowenislandsong: All pull requests linked via external trackers have merged: operator-framework/operator-lifecycle-manager#1482. Bugzilla bug 1823714 has been moved to the MODIFIED state.

In response to this:

Bug 1823714: Update PkgManifest upon catsrc update

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.

@openshift-cherrypick-robot

@Bowenislandsong: #1482 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/package-server/provider/registry.go
M	test/e2e/packagemanifest_e2e_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/packagemanifest_e2e_test.go
CONFLICT (content): Merge conflict in test/e2e/packagemanifest_e2e_test.go
Auto-merging pkg/package-server/provider/registry.go
CONFLICT (content): Merge conflict in pkg/package-server/provider/registry.go
Patch failed at 0001 Update PkgManifest upon catsrc update

In response to this:

/cherry-pick release-4.3

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.

@openshift-cherrypick-robot

@Bowenislandsong: #1482 failed to apply on top of branch "release-4.2":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/package-server/provider/registry.go
M	test/e2e/packagemanifest_e2e_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/packagemanifest_e2e_test.go
CONFLICT (content): Merge conflict in test/e2e/packagemanifest_e2e_test.go
Auto-merging pkg/package-server/provider/registry.go
CONFLICT (content): Merge conflict in pkg/package-server/provider/registry.go
Patch failed at 0001 Update PkgManifest upon catsrc update

In response to this:

/cherry-pick release-4.2

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.

@openshift-cherrypick-robot

@Bowenislandsong: #1482 failed to apply on top of branch "release-4.4":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	pkg/package-server/provider/registry.go
M	test/e2e/packagemanifest_e2e_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/packagemanifest_e2e_test.go
CONFLICT (content): Merge conflict in test/e2e/packagemanifest_e2e_test.go
Auto-merging pkg/package-server/provider/registry.go
CONFLICT (content): Merge conflict in pkg/package-server/provider/registry.go
Patch failed at 0001 Update PkgManifest upon catsrc update

In response to this:

/cherry-pick release-4.4
/cherry-pick release-4.3
/cherry-pick release-4.2

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.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. 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