-
Notifications
You must be signed in to change notification settings - Fork 261
Migration of the diff logic to oc-mirror #1006
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
Migration of the diff logic to oc-mirror #1006
Conversation
|
Hi @pawicao-ibm. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/ok-to-test |
|
Please do not merge this PR until the oc-mirror PR is merged. I will put a hold here just in case. |
|
I would like to ask you @pawicao-ibm to squash the commits to reduce the noises here. Grouping the commits together based on their purposes to reduce maybe 2 main commits (one for adding channel properties and one for removing the diff logic). |
Codecov Report
@@ Coverage Diff @@
## master #1006 +/- ##
==========================================
- Coverage 52.87% 51.67% -1.20%
==========================================
Files 104 101 -3
Lines 9468 8961 -507
==========================================
- Hits 5006 4631 -375
+ Misses 3529 3450 -79
+ Partials 933 880 -53
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
One a second look, in fact there is already a PR for priority channel which is linked here (#969) so I recommend to move all commits associated to that PR out of this PR and squash the rest into one. |
5cbe3fa to
112f173
Compare
|
It made sense and I followed your suggestion. This PR now includes the migration of the diff logic to oc-mirror, #969 includes only adding the channel priority. There are two things to note here:
|
If you remove the diff code, then |
yes and that's exactly how it is prepared now. I was asking if for sure you are okay with that |
|
/hold cancel |
|
@pawicao-ibm Hey Oskar, do me a favor and do a few things for this PR:
Thanks. |
Signed-off-by: Oskar Pawica <Oskar.Pawica@ibm.com>
Signed-off-by: Oskar Pawica <Oskar.Pawica@ibm.com>
ed15fac to
1096598
Compare
Is it okay now? |
dinhxuanvu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
|
@joelanford Can you please take a look and give it a lgtm if everything is good? Thanks. |
grokspawn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate it if we can run to ground the new exports before concluding this. Unless required by an API consumer not represented here, we'd like to minimize exports when possible.
I'm pretty sure the diff code uses them. Now the diff code is moving out of the package, these variables and functions need to be exportable so they can be used on mirror repo. |
|
@pawicao-ibm Can you confirm that you need those variables and the func to be exportable for mirror usage? Or there is another reason for it? |
|
Now that I look into that, they are used but within tests of the diff logic, while creating DeclarativeConfigs. They are also used here: https://github.com/openshift/oc-mirror/blob/a1440e623b1f6c9652c3053ec78661bfe223ecae/pkg/operator/diff/internal/diff.go#L542 - this function is called for comparing bundles. Maybe there would be a way around that tho |
I see. The main question is if these changes are needed. If they ain't, we should reverse them. I personally don't mind the changes but let keep the changes to the minimum and avoid unnecessary ones. |
|
I am looking into that |
These changes are needed if we want to have the diff functions in oc-mirror and not have redundant duplications of these schemas. I see some possibility of manouvering functions here and there. For example some of the internal diff functions (https://github.com/openshift/oc-mirror/blob/a1440e623b1f6c9652c3053ec78661bfe223ecae/pkg/operator/diff/internal/diff.go#L542:L629) could go to operator-registry - |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, grokspawn, pawicao-ibm 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 |
|
Appreciate the diligence, folks. /lgtm |
This PR is a follow-up of #969 and is being worked on simultaneously with openshift/oc-mirror#497
Description of the change:
The discussion on the diff logic started with openshift/oc-mirror#453 issue where the defaultChannels for operators where invalid while using minVersion/maxVersion.
Further work and discussions on adding the Priority property (see #969) resulted in a conclusion to migrate the entirety of diff logic to oc-mirror.
This work has been prepared in the following PR: openshift/oc-mirror#497
Some changes in the operator-registry have to be done though together with the migration (e.g. changing schema variables to public or adding properties to a channel model), in order for oc-mirror's diff to be able to take advantage of needed operator-registry structures.
Lastly this migration results in changes to
opm diff. See here for the latest thoughts on deprecating this commandMotivation for the change:
Reviewer Checklist
/docs