๐ฑ nilnil linter #2579
Hi @SD-13. Thanks for your PR.
I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
<details>
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-sigs/prow repository.
</details>
@tuminoid I am new to golang and still learning semantic errors. I would really appreciate if you can leave some early feedback on this. Thanks!
@tuminoid I am new to golang and still learning semantic errors. I would really appreciate if you can leave some early feedback on this. Thanks!
Sorry I missed your message.
/ok-to-test
This needs some time to review as returning errors instead of nil. nil might break the system as sometimes we have cases nil, nil is the expected output. For example in BMO nilnil PR: https://github.com/metal3-io/baremetal-operator/pull/2514 we had these cases.
I don't have time to review it before my vacations, so I'll ping other guys to check it.
/cc @adilGhaffarDev @lentzi90
This is not really something we consider an error. We need to keep it as nil and tell the linter to ignore it instead.
return nil, nil //nolint:nilnil
return nil, nil //nolint:nilnil
This is also deliberate. We ignore the error only if the BMH is not found. All other errors are returned.
return nil, nil //nolint:nilnil
This I think is fine, but please remove the extra newlines above.
return nil, nil //nolint:nilnil
return nil, nil //nolint:nilnil
return nil, nil //nolint:nilnil
These I am not so sure about. I think we could clean them up but that would be a bit bigger refactor.
For now I think the better way forward is to put nil //nolint:nilnil also here.
Hello @lentzi90 Thanks for reviewing my PR!
I addressed your comments, can you please take another look?
Thanks!
Looks like this is still causing a unit test to fail. We will need to either change that unit test or revert and put nolint here as well
I am trying to modify that unit test accordingly.
I added nolint for now.
/retest
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/2579#pullrequestreview-2941627165" title="Approved">lentzi90</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
/test metal3-centos-e2e-integration-test-main
/test metal3-ubuntu-e2e-integration-test-main
/lgtm
/override metal3-centos-e2e-integration-test-main
The centos based tests are facing an unrelated issue, the actual test has passed.https://jenkins.nordix.org/blue/organizations/jenkins/metal3-centos-e2e-integration-test-main/detail/metal3-centos-e2e-integration-test-main/1391/pipeline
@Rozzii: Overrode contexts on behalf of Rozzii: metal3-centos-e2e-integration-test-main
<details>
In response to this:
>/override metal3-centos-e2e-integration-test-main
>The centos based tests are facing an unrelated issue, the actual test has passed.https://jenkins.nordix.org/blue/organizations/jenkins/metal3-centos-e2e-integration-test-main/detail/metal3-centos-e2e-integration-test-main/1391/pipeline
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-sigs/prow repository.
</details>
lentzi90
SD-13
<!-- please add an icon to the title of this PR (see https://sigs.k8s.io/cluster-api/CONTRIBUTING.md#contributing-a-patch), and delete this line and similar ones -->
<!-- the icon will be either โ ๏ธ (:warning:, major or breaking changes), โจ (:sparkles:, feature additions), ๐ (:bug:, patch and bugfixes), ๐ (:book:, documentation or proposals), or ๐ฑ (:seedling:, minor or other) -->
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #2446