Add goimports verification and skeleton ci presubmit check#4710
Add goimports verification and skeleton ci presubmit check#4710jetstack-bot merged 1 commit intocert-manager:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: SgtCoDFish The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
|
||
| .PHONY: tools | ||
| tools: bin/tools/helm bin/tools/kubectl bin/tools/kind bin/tools/cosign bin/tools/release-notes bin/tools/cmrel bin/tools/ytt bin/tools/yq | ||
| tools: bin/tools/helm bin/tools/kubectl bin/tools/kind bin/tools/cosign bin/tools/cmrel bin/tools/release-notes bin/tools/goimports bin/tools/ytt bin/tools/yq |
There was a problem hiding this comment.
note: I rearranged cmrel to come before release-notes just to match the ordering we have in the list of VERSION variables above.
|
Hm, if we only run this in make and not in bazel, could this lead to either 1) bazel and make 'fighting' each other and 2) a change in what people need to run to do things? It'd be great if goimports could be automatically called as part of I'm worried that if we add things that only exist in Make, we end out in a 'split' state of the world until the migration from Bazel to Make is complete, where someone needs both build environments configured correctly (and drift between laptop go version and bazel go version could create issues). During k/k's migration, this didn't come up because they had always maintained both a Make-based and Bazel based build system, so our job is slightly harder than theirs in this instance 😬 Just my 2c 😄 (but a huge +1 to running goimports during presubmits!! 🎉) |
That's useful history, thanks. 👍 Maintaining both make + bazel for cert-manager until the final switchover was actually my intention in any case, precisely to avoid the situation you describe with the two fighting. I take the view that by only adding to make (and not going back and changing bazel) the worst that can happen is someone (justifiably) writes a PR locally using a bazel-based development flow in which all tests pass, and then is surprised to see That's not ideal - ideally there's exactly one way to build code + run tests, which you're alluding to - but I think it's fine for the inbetween "dual-running" period before we do the final shift to using make entirely. Certainly if the only difference until the switchover is that the make flow also runs goimports, that's totally acceptable to me because it's a small win and mostly we don't have issues with people not running (I think probably I should have an issue describing the dual running above, as a focal point for discussion, and I'll make that issue now) |
CI check will be built upon as Make is improved to reach testing partiy with bazel Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
|
I think this is probably good to go. If we really don't want to have |
|
/lgtm |
This adds a step by which we can run
goimportsagainst the codebase.It's also the first part of moving "testing" more generally from bazel to make. A lot of the existing steps are tied to bazel in some way, but since this is greenfield it's an easy place to start.
After this merges, we can add
make -f make/Makefile ci-presubmitto the presubmits.Sort-of related to #4705
/kind feature