-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(HACBS-2381): increase consistency #214
Conversation
07be233
to
8b9e32d
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
==========================================
- Coverage 85.50% 85.45% -0.06%
==========================================
Files 23 23
Lines 1442 1437 -5
==========================================
- Hits 1233 1228 -5
Misses 150 150
Partials 59 59
☔ View full report in Codecov by Sentry. |
d902da4
to
4514b01
Compare
This depends on #213 and also includes all of its changes. Given that, I am not really sure how this is ready for review |
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.
I am -1 to this change. I don't think it is worth merging 833 lines of new code with no new functionality or bug fixes, just renaming variables and moving stuff around
This is a change for increasing consistency, which is the main reason to write Operator Toolkit and the main reason behind the presentation we did. This change is following the best practices set by the framework and by the sample operator wrote using Operator Toolkit. Given that it doesn't change functionality it should be easy to review and merge. Happy to discuss those best practices and take changes over to the framework itself. Btw, same changes have been applied already to our other operator konflux-ci/internal-services#22 |
/retest |
I am not seeing how changing function receivers from |
Saying that I applied the changes and I'm waiting for them to be reviewed. Regarding consistency and best practices, this change makes every single webhook to be called webhook, which for new developers is easier to read. Most of the lines in this change go to putting in place a suite file (356 of them), avoid exposing structs that should not be exposed like the adapter, which right now is accessible from outside the controller package (which is wrong) and unifying the names (having just controller and webhook across all our controllers and webhooks). |
/retest |
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.
I do not disagree with anyone, but I think if the effort is already done and it makes no change to functionality but just the consistency with naming and refinements for better alignment with the framework I think we should move forward, but same time, such wide changes are concerning some time as Johhny told.
I am approving this PR because the code looks good to me. But the decision to merge this can be determined by the team.
Generally speaking I am ok with the changes. Just on thing I noticed as this one is for consistency, in some places |
Controllers get a copy but anything else within the controller (adapter, syncer, etc) get a reference. |
Personally I'm not sure if this is better. Is there some convention for operators that we're now closer to? Or is this just your idea that this is better? I kind of liked the old structure more. And also, before, you could search the code base for something like But I'm fine with either way. |
Good comments. Let me address them individually.
There's no convention as you can see by checking any RHTAP operator. The only "conventions" are the interfaces used like the the one containing the Reconcile method.
It kinda is my idea but for example, the controllers/adapters thing comes from another Red Hat operator. I built Operator Toolkit from there, trying to share as much code as possible and trying to keep a clean and readable structure.
There are multiple mentions of author in the very same file. What we get with the webhooks structure changes is:
And for webhooks:
You can see that searching for |
@davidmogar thanks for the additional details. It makes sense. |
Sure thing is that those changes are turning the project to easier to read and follow up, at least for me . |
The operator-toolkit has been already released and operator-goodies is deprecated. Signed-off-by: David Moreno García <damoreno@redhat.com>
This change is focused on webhooks. It increases consistency and follow operator-toolkit best practices. Signed-off-by: David Moreno García <damoreno@redhat.com>
This change is focused on controllers. It increases consistency and follow operator-toolkit best practices. Signed-off-by: David Moreno García <damoreno@redhat.com>
This change is focused on the syncer. It increases consistency and follow operator-toolkit best practices. Signed-off-by: David Moreno García <damoreno@redhat.com>
This change is focused on the loader. It increases consistency and follow operator-toolkit best practices. Signed-off-by: David Moreno García <damoreno@redhat.com>
Signed-off-by: David Moreno García <damoreno@redhat.com>
Signed-off-by: David Moreno García <damoreno@redhat.com>
The function should only be used within the package. Signed-off-by: David Moreno García <damoreno@redhat.com>
New changes are detected. LGTM label has been removed. |
This change improves consistency across the project, following operator-toolkit best practices.
Depends on #213