Skip to content

Conversation

@joelanford
Copy link
Member

@joelanford joelanford commented Nov 23, 2021

Description of the change:
When building the channel_entry table, always using a starting depth of 0.

Motivation for the change:
This is important because the ListBundles query makes an assumption that all packages in the database will have the same minimum depth.

Closes #867

Signed-off-by: Joe Lanford <joe.lanford@gmail.com

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

… table

When building the channel_entry table, always using a starting depth of
0. This is important because the ListBundles query makes an assumption
that all packages in the database will have the same minimum depth.

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@openshift-ci openshift-ci bot requested review from ecordell and njhale November 23, 2021 20:33
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2021
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #868 (5c0ca75) into master (28aa654) will increase coverage by 0.56%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #868      +/-   ##
==========================================
+ Coverage   51.51%   52.07%   +0.56%     
==========================================
  Files         103      103              
  Lines        9062     9063       +1     
==========================================
+ Hits         4668     4720      +52     
+ Misses       3515     3438      -77     
- Partials      879      905      +26     
Impacted Files Coverage Δ
pkg/sqlite/load.go 45.98% <80.00%> (+2.57%) ⬆️
pkg/sqlite/loadprocs.go 33.33% <0.00%> (+33.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28aa654...5c0ca75. Read the comment docs.

Comment on lines +192 to +202
for _, b := range bundles {
graph, err := graphLoader.Generate(b.Package)
require.Conditionf(t, func() bool {
return err == nil || errors.Is(err, registry.ErrPackageNotInDatabase)
}, "got unexpected error: %v", err)
bundleLoader := registry.BundleGraphLoader{}
updatedGraph, err := bundleLoader.AddBundleToGraph(b, graph, &registry.AnnotationsFile{Annotations: *b.Annotations}, false)
require.NoError(t, err)
err = store.AddBundleSemver(updatedGraph, b)
require.NoError(t, err)
}
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 don't love that all of this code is in the test. It seems like this should be better encapsulated in non-test code. I suppose I could re-write the test using the DirectoryPopulator abstraction, but that would require using the imageDirMap and putting a bunch of bundle directories to disk during the test.

We could also look at making this something that could be more easily called in a test.

I'm just not sure it's worth it given all of this code is deprecated.

Copy link
Contributor

@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

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.

Looking good. A few comments.

// we got to the end of the channel graph
if nextNode.IsEmpty() {
if len(channel.Nodes) != depth {
if len(channel.Nodes)+startDepth-1 != depth {
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to have a comment explaining this addition.

@joelanford
Copy link
Member Author

/hold
So I can address some comments.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 24, 2021
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@joelanford
Copy link
Member Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 24, 2021
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.

Satisfied with the latest changes.
/lgtm

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

openshift-ci bot commented Nov 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, joelanford, 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:
  • OWNERS [dinhxuanvu,joelanford]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit f478fdd into operator-framework:master Nov 24, 2021
@joelanford joelanford deleted the fix/semver-mode branch November 24, 2021 14:46
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.

opm add with the options --from-index and --mode semver is not creating replaces edges

4 participants