-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Solve name collision and document why version strings can not be const #1143
Conversation
Hi @Adirio. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
/assign @pwittrock |
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.
Hi @Adirio,
It is really cool to see that you have been contributed to the project 🥇.
In order to help you with the review, I added so comments. Please feel free to check it.
Done. I added some answers justifying some of the changes you asked about. And thank you very much for the welcome. |
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.
Hi @Adirio,
I added some comments to clarifies my POV over it here.
Basically it shows that you have here 3 diff motivations/purposes in the same PR. So, I think it should be split like:
- Improve version.go for a better understanding
- Error strings should not be capitalized in order to follow the good practices
- Make explicitly "handles" the error by not doing anything.
@camilamacedo86 I answered some of your comments. The three motivations you mentioned are listed in the commit text and in the PR message, with a couple more. As the title states, it is just a cleanup, tidying up some random stuff. You may be right that some of these changes should be done for the whole project and not only the |
HI @Adirio, It is fine. Just to clarifies the key points of my review here: As a good practice no matter the project that you collab with you should keep a small context per PR. PR's should not address many motivations/purposes in order to keep simple and easier others understand what is going on, do the reviews, track the changes and etc.. Also, note that IMHO make no sense apply motivations like Hi @droot @pwittrock @mengqiy @DirectXMan12, could you please give a hand here and let us know wdyt about these changes? |
/ok-to-test |
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.
If we have cleanup all of the linter errors, it'd be great to enable the linters like controller-runtime does.
Ref: https://github.com/kubernetes-sigs/controller-runtime/blob/81842d0e78f7111f0566156189806e2801e3adf1/hack/verify.sh#L27-L45
Ok, I will split this PR into the different parts following your comments on monday |
Simplified the PR to follow the comments and letting the formatting and error handling parts to their specific PR in a project-wide scope. |
I started #1176 to track all changed that may be needed for this purpose. |
/test pull-kubebuilder-e2e |
@Adirio Hmm, it seems it conflicts with your other PR. Can you please rebase? |
Please squash the commits. |
I resolved the conflict in GitHub tool. Tomorrow I will be able to do it with my normal development environment and squash the commits if you think the commit history would be cleaner, but at least with this we should be able to check that the tests pass correctly. |
No rush. We can wait til tomorrow. |
foundProject, version := getProjectVersion() | ||
if foundProject && version == project.Version1 { | ||
foundProject, projectVersion := getProjectVersion() | ||
if foundProject && projectVersion == project.Version1 { |
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.
if foundProject && projectVersion == project.Version1 { | |
if isProjectFound && projectVersion == project.Version1 { |
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.
IHMO to merge this one is missing
- squash the commits
- small nit replace
foundProject
forisProjectFound
- update the first comment since it shows not so longer reflect the motivations of the changes performed here.
Besides the small changes above all shows fine for me 👍
/assign @camilamacedo86 |
/assign @mengqiy |
👍
Done.
I think we already discussed this. |
Hi @Adirio hasProjectFile sounds better 🥇 |
- Avoid variable and package name collision - Stop exporting get version function - Document why version strings cannot be constants Signed-off-by: Adrian Orive <[email protected]>
@Adirio: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
@mengqiy Done |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Adirio, mengqiy 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 |
Change list:
/kind cleanup