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

Remove provides+required GVK and modify/remove associated tests #408

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Sep 13, 2023

GVK Properties are not being set on bundle properties, and how we handle these dependencies has not been fully fleshed out. Removing this code will also simplify the transition away from Entity/EntitySource code.
Please also see slack discussion here.

@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 Sep 13, 2023
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.28% 🎉

Comparison is base (dd0dfaf) 83.68% compared to head (cf55fe2) 83.97%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
+ Coverage   83.68%   83.97%   +0.28%     
==========================================
  Files          27       27              
  Lines        1103     1073      -30     
==========================================
- Hits          923      901      -22     
+ Misses        123      119       -4     
+ Partials       57       53       -4     
Flag Coverage Δ
e2e 61.82% <ø> (+0.03%) ⬆️
unit 80.34% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...ternal/catalogmetadata/filter/bundle_predicates.go 92.85% <ø> (+3.66%) ⬆️
...lution/variablesources/bundles_and_dependencies.go 91.83% <ø> (+4.73%) ⬆️
...rnal/resolution/variablesources/crd_constraints.go 92.00% <ø> (+2.00%) ⬆️
internal/catalogmetadata/types.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dtfranz dtfranz force-pushed the remove_required_provided_gvks branch from 5f33a41 to ea08115 Compare September 13, 2023 18:12
@dtfranz dtfranz marked this pull request as ready for review September 13, 2023 19:56
@dtfranz dtfranz requested a review from a team as a code owner September 13, 2023 19:56
@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 Sep 13, 2023
Copy link
Member

@m1kola m1kola 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 to me! A few minor things, but I think we can merge.

Comment on lines +14 to +18
const (
MediaTypePlain = "plain+v0"
MediaTypeRegistry = "registry+v1"
PropertyBundleMediaType = "olm.bundle.mediatype"
)
Copy link
Member

Choose a reason for hiding this comment

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

I was a bit confused since this (and PackageRequired an some other bits in this file) is not related to GVK removal. But we still need these changes for further entity source removal.

I'm ok to merge it like this.

assert.Nil(t, gvk)
})
}},
wantRequiredPackages: nil,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: empty value for a pointer is nil so this can be ommited.

b.mu.Lock()
defer b.mu.Unlock()
if b.requiredGVKs == nil {
requiredGVKs, err := loadFromProps[[]GVKRequired](b, property.TypeGVKRequired, false)
if b.mediaType == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Hm. We should probably use a pointer here: if nil - try to unmarshal. If non-nil - then we already tried to load it (even if the string itself is empty).

Copy link
Member

Choose a reason for hiding this comment

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

Created #409 for this. Will rebase once this PR gets merged.

@m1kola m1kola added this pull request to the merge queue Sep 14, 2023
Merged via the queue into operator-framework:main with commit ca95325 Sep 14, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants