Add presubmit jobs tests and linting for sig-security tool srctl #36801
Add presubmit jobs tests and linting for sig-security tool srctl #36801Daniel-Giszpenc wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
Welcome @Daniel-Giszpenc! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Daniel-Giszpenc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Daniel-Giszpenc. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| - | | ||
| set -euo pipefail | ||
| cd sig-security-tooling/srctl | ||
| go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.4 |
There was a problem hiding this comment.
maybe would be cool to have an image that already includes golangci-lint?
There was a problem hiding this comment.
I could try figuring out where Kubernetes keeps their images and try that, it would fit well. I'll ask what the test-infra slack thinks.
There was a problem hiding this comment.
I would strongly encourage moving this into the sig security repo and generally putting test target definitions and verisons there, as breifly discussed in the slack thread
This makes it easier for contributors to reproduce, and makes it safe to iterate on the options and versions (because the PR that changes them will run the tests before merge)
| decorate: true | ||
| spec: | ||
| containers: | ||
| - image: public.ecr.aws/docker/library/golang:1.25@sha256:ed520ab5bed37ce887012c050ced60f7d52dfcd212e3dc6fdd8951e9c4e25c1a |
There was a problem hiding this comment.
I've seen your comment
Special Note: The ecr golang image was used instead of the e2e kubekins image because that image is way oversized for the tasks here of running a few small golang unit tests and running a linting tool and the ecr doesn't impose the rate limiting problems that docker hub does on the kubernetes project. Oversized images mean more code surface for vulnerabilities as well as more resources to both fetch and use the image. The long term concern with this requiring manual image updating currently as the generic image auto-bumper won't work with this though a tool can be developed for this purpose and the manual work is very minimal.
Tbh I'll use whatever is maintained by sig test-infra and they think is a good image. Maybe it would be interesting to ask them what they think is a good image for our use case?
There was a problem hiding this comment.
They told me the image I chose was fine.
https://kubernetes.slack.com/archives/C09QZ4DQB/p1776265122708969
On the flip side I do need to do some work on the golangci-lint side because the version for that that gets used should be decided in the source directory of srctl, not here in test-infra so I need to update that which means a PR over there combined with this PR being updated to take advantage of that.
Issue: tooling: run tests and linters with prow for srctl #175
Assignment details: In the recent sig-security tooling meeting it was decided this issue was being re-assigned so it would get done and I would take this issue on if bleon-ethical did not express interest to pick it back up by today. I am a little early but if Benjamin comes on help would certainly be appreciated. Closing this PR should close PR #36409, PR #36431, and the above issue.
Work Done:
Special Note: The ecr golang image was used instead of the e2e kubekins image because that image is way oversized for the tasks here of running a few small golang unit tests and running a linting tool and the ecr doesn't impose the rate limiting problems that docker hub does on the kubernetes project. Oversized images mean more code surface for vulnerabilities as well as more resources to both fetch and use the image. The long term concern with this requiring manual image updating currently as the generic image auto-bumper won't work with this though a tool can be developed for this purpose and the manual work is very minimal.
Work Not Done:
I am leaving this a draft right now considering the lack of a testing run yet but the jobs should be good I think and review would be appreciated.
/assign