-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
golangci-lint misconfiguration in GitHub actions #17929
Comments
I can think of two possible solutions for the issue: 1. Keep
|
I feel like the best option would be the second one, but just laying out the possible solutions to get feedback. cc. @jmhbnz, and maybe @ArkaSaha30. I'm not sure who else could provide feedback regarding this area. |
Agree - My preference would be to focus on our pattern of The pr decoration/annotation would be nice for failures but personally I am not too worried about this. Expectation for contributors is they can run |
Sounds good, fair point. I was thinking of contributor experience, as I feel it's easier to see annotations on the PR. If we decide not to add the annotations, there's still some cleanup to do to avoid running twice |
I agree with the second option as well, since it is more github independent (since we need to run golangci-lint as a part of |
Actually, if the ultimate intention is to migrate running Is that the plan? Do we have a plan for what we're keeping as GitHub actions/workflows and what as Prow Jobs? |
Yes. We want to migrate all etcd continuous integration to kubernetes project community test infrastructure. I suggest we just remove the unnecessary github action usage for golangci-lint under this issue and stick with |
In that case, doesn't it make more sense to remove the GitHub action? |
As I was exploring removing the GitHub action, I realized that the Prow job is failing (I've already addressed why it's failing), and it's not correctly reporting that it has a failure status. In the runs, it always ends successfully despite an error. Refer to a sample build: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/etcd-io_etcd/17934/pull-etcd-verify/1786627012845113344
I reviewed its configuration, and it's not set as optional. I also tried changing the exit status from 255 to 1. See #17935 / https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/etcd-io_etcd/17935/pull-etcd-verify/1786631288405364736. Do you know if I'm missing something obvious? Or should I contact sig-testing about this issue? |
I have an idea why it's not reporting failure properly, take a look at: kubernetes/test-infra#32563 If you think it's worth trying please give it an |
Thanks @jmhbnz, it works: #17935 / https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/etcd-io_etcd/17935/pull-etcd-verify/1787233596726054912. I think we can safely delete the GitHub workflow now. |
Agreed - Feel free to raise it if you have time, thanks 🙏🏻 |
@jmhbnz, this ticket is morphing into replacing the static analysis GitHub workflow with a Prow job. There are more follow-up items. However, I feel the discussion is beyond the scope of the original issue. Should we continue the discussion here, or should I open a new issue to track the progress and close this one? |
Sorry I might not have been clear, I think we can delete https://github.com/etcd-io/etcd/blob/main/.github/workflows/static-analysis.yaml#L15-L21 but I don't think we should be removing the whole workflow yet. Just the unnecessary step for running standalone golangci-lint. I think we can make that change under this issue, agree anything further should be a separate discussion. |
Bug report criteria
What happened?
As I've been working on enabling golangci linters (#17286, #17578), it came to my attention that when there's a linter violation, we're not getting the comments that the
golangci-lint-action
GitHub action highlights in the Files Changed tab.What did you expect to happen?
Have the linter violations highlighted, as it provides helpful feedback for the contributor to address the issues before merging.
How can we reproduce it (as minimally and precisely as possible)?
I created a PR in my fork showing the current behavior:
Anything else we need to know?
The reason why it's not working is because the GitHub workflow is misconfigured. This is the current configuration:
etcd/.github/workflows/static-analysis.yaml
Lines 17 to 21 in ce45881
Quoting golangci/golangci-lint-action's configuration documentation:
This means that the current step tests only the root directory, and there are no violations, so it doesn't highlight them.
But why does it still work (i.e., it still fails on my build)? It's because later we call
make verify
:etcd/.github/workflows/static-analysis.yaml
Lines 34 to 37 in ce45881
This runs
golangci-lint
for each module (and again for the top-level directory).Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
paste your configuration here
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: