-
Notifications
You must be signed in to change notification settings - Fork 707
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
Add status check jobs for local_e2e_tests matrix and linters #5628
Add status check jobs for local_e2e_tests matrix and linters #5628
Conversation
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
✅ Deploy Preview for kubeapps-dev canceled.Built without sensitive environment variables
|
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.
Thanks for the explanation!
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
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.
Great, thanks!
.github/workflows/linters.yml
Outdated
linters-status-check: | ||
needs: | ||
- yaml-linter | ||
- golang-linter | ||
- license-headers-linter | ||
- codeql-linter |
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.
Hmm, don't we already run the yaml and golang linters during the image builds (as a step in the docker file build, so that people can and will find the lint problem locally). The headers linter and codeql linters probably need to be run separately here, just not sure about the yaml and golang ones?
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.
IINM the golang
linter is not being run as part of the image build, it is true that golangci-lint
is being installed in the docker file, but its execution is conditioned to the existence of a build argument called lint
that it's currently not being passed in the call to docker build
that is made in the Makefile. Regarding yamllint
, I've added it recently, so it's never being executed as part of the image build process. IMHO, it makes sense to have a listing step in the pipeline itself that allows us to easily identify that the issue is in the linting step. Besides that, and taking into account that not all the linters could be run as part of the image-building process, I think it's better to have all the linters aggregated as part of the same process instead of having them scattered through different places. Don't you think so?
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.
IINM the
golang
linter is not being run as part of the image build, it is true thatgolangci-lint
is being installed in the docker file, but its execution is conditioned to the existence of a build argument calledlint
that it's currently not being passed in the call todocker build
that is made in the Makefile.
Oh - yes, it looks like in #5234, 2 months ago, @antgamdia updated the Dockerfile to make it conditional . Do you remember why it was made conditional @antgamdia?
Regarding
yamllint
, I've added it recently, so it's never being executed as part of the image build process.
👍 ah - ok.
IMHO, it makes sense to have a listing step in the pipeline itself that allows us to easily identify that the issue is in the linting step. Besides that, and taking into account that not all the linters could be run as part of the image-building process, I think it's better to have all the linters aggregated as part of the same process instead of having them scattered through different places. Don't you think so?
I agree in part, in that I have no problem with a lint stage in CI per-se. The key thing for me is that we avoid us devs doing:
- Commit and create PR,
- Find next task and start reading about it
- Notice failed lint in CI for (1) so switch back
(repeat).
So the key thing is, IMO, that we ensure the feedback is fast (ie. at worst, run early in CI which I'm sure you're doing), and that we can run the same check easily locally. The purpose of including such things in the build step of the Dockerfile is because it's an easy way for fast feedback and simple local running.
+1 either way :)
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.
Yeah, I see your point. The linters stage is executed right after starting the pipeline, so the feedback look will be short. Regarding running the linters locally, we could add a make target for that, although that would be out of the scope of this PR I guess.
Signed-off-by: Jesús Benito Calzada <bjesus@vmware.com>
Signed-off-by: Jesús Miguel Benito Calzada <bjesus@vmware.com>
Description of the change
Due to GH limitations, it is not possible to add a branch protection rule pointing to all the jobs generated by GHA's matrix strategy. As a workaround, we've introduced a new status check job that depends on the job with the matrix, and whose status depends on the success of all the jobs generated by that. In addition, we've taken advantage to add another check-status job for all the linter jobs.
Benefits
local_e2e_tests
jobs derived from the matrix.Possible drawbacks
None
Applicable issues
Additional information