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 1889388: Set replaces in ListBundles query result using channel entries. #483

Conversation

benluddy
Copy link
Contributor

@benluddy benluddy commented Oct 20, 2020

The "replaces" column in ListBundles query result rows was being populated with the "replaces" from the respective bundle. For registries built using semver mode, the source of truth for "replaces" is the "replaces" column on each channel entry row.

@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 Oct 20, 2020
@openshift-ci-robot
Copy link

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

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high 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. labels Oct 20, 2020
@openshift-ci-robot
Copy link

@benluddy: This pull request references Bugzilla bug 1889388, 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.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1889388: Set replaces in ListBundles query result using channel entries.

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.

@benluddy benluddy marked this pull request as ready for review October 27, 2020 18:04
@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 Oct 27, 2020
@openshift-ci-robot
Copy link

@benluddy: This pull request references Bugzilla bug 1889388, which is valid.

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

In response to this:

Bug 1889388: Set replaces in ListBundles query result using channel entries.

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.

@benluddy benluddy force-pushed the listbundles-channel-entry-replacement branch from dba076d to 33f6275 Compare October 27, 2020 18:14
@exdx
Copy link
Member

exdx commented Oct 27, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 27, 2020
LEFT OUTER JOIN dependencies ON dependencies.operatorbundle_name = channel_entry.operatorbundle_name
LEFT OUTER JOIN properties ON properties.operatorbundle_name = channel_entry.operatorbundle_name
INNER JOIN package ON package.name = channel_entry.package_name`
const listBundlesQuery = `SELECT DISTINCT channel_entry.entry_id, operatorbundle.bundle, operatorbundle.bundlepath,
Copy link
Member

Choose a reason for hiding this comment

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

My only question is does this change to the query impact non-semver bundles in any way? Is that query behavior the same as before. Or are we saying in the latest versions of opm we expect the bundles to be built in semver mode?

Copy link
Contributor Author

@benluddy benluddy Oct 27, 2020

Choose a reason for hiding this comment

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

For replaces bundles, the existing query should work the same either way, since the replaces column in channel_entry should be synthesized from the bundle. The existing query is only problematic for semver indices, since in that case the bundle and channel_entry "replaces" column aren't necessarily the same.

@kevinrizza Please check my understanding. I put a hold on this to wait for confirmation.

Copy link
Member

Choose a reason for hiding this comment

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

You're right @benluddy, in both cases the channel_entry table is correct -- the source of truth should be the edges listed in the channel_entry table. The only diff is that in semver mode the replaces field is ignored when deciding what to add. In replaces mode that table gets rebuilt from scratch every time, so it should always be correct.

@benluddy
Copy link
Contributor Author

/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 Oct 27, 2020
@benluddy benluddy requested review from kevinrizza and removed request for Bowenislandsong October 27, 2020 19:01
@benluddy
Copy link
Contributor 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 Oct 27, 2020
LEFT OUTER JOIN properties ON properties.operatorbundle_name = channel_entry.operatorbundle_name
INNER JOIN package ON package.name = channel_entry.package_name`
const listBundlesQuery = `SELECT DISTINCT channel_entry.entry_id, operatorbundle.bundle, operatorbundle.bundlepath,
channel_entry.operatorbundle_name, channel_entry.package_name, channel_entry.channel_name, replaced_entry.operatorbundle_name, operatorbundle.skips,
Copy link
Member

Choose a reason for hiding this comment

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

This is definitely better, but in theory we might want to synthesize all of the channel edges directly from just the channel_entry table given that these input fields are disparate and may or may not be relevant when deciding what edges are actually real. That's the intention of the channel_entry table itself.

That being said, I think that's something we can worry about later and for now this is better.

@kevinrizza
Copy link
Member

/lgtm

@openshift-merge-robot openshift-merge-robot merged commit bf13cb4 into operator-framework:master Oct 27, 2020
@openshift-ci-robot
Copy link

@benluddy: All pull requests linked via external trackers have merged:

Bugzilla bug 1889388 has been moved to the MODIFIED state.

In response to this:

Bug 1889388: Set replaces in ListBundles query result using channel entries.

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.

@benluddy
Copy link
Contributor Author

/cherry-pick release-4.6

@openshift-cherrypick-robot

@benluddy: new pull request created: #497

In response to this:

/cherry-pick release-4.6

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-high Referenced Bugzilla bug's severity is high 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

6 participants