ci: add kube-api-linter and exclude current findings - #416
Conversation
748a99c to
4910796
Compare
|
And sorry if my comment sends you on a wild goose chase. I am not really involved in this project but I follow it for interest. cc Benjamin Elder (@BenTheElder) Tim Hockin (@thockin) I think having kube-api-linter is useful btu not sure what maintainers think. |
3f964cb to
8140409
Compare
|
Benjamin Elder (@BenTheElder) |
Benjamin Elder (BenTheElder)
left a comment
There was a problem hiding this comment.
In the future I'd recommend:
- split introducing the linter into one commit, and fixing the failure types into a commit per grouped type
- prevent including merge commits
this time I think it's small enough to just squash to one commit on merge.
Tim Hockin (@thockin) Julian Gutierrez Oschmann (@juli4n) PTAL
thx for feedback |
|
Haven Xia (@HavenXia) Would you mind taking a look at this one as well when you have some time? |
I don't have expertise in this area, the linter looks good to me. Benjamin Elder (@BenTheElder) can you review this and give a formal sign off? |
4f12ca7 to
26257e5
Compare
|
Can we squash these merge commits? As-is review is unwieldy. |
4b73c2b to
14c2023
Compare
|
Benjamin Elder (@BenTheElder) thx, squashed into one commit |
abe09ab to
80a338a
Compare
Benjamin Elder (BenTheElder)
left a comment
There was a problem hiding this comment.
I think the better way to do this is:
- introduce linter with all current failures as exceptions
- fix exceptions by class or type
as-is this is a rebase magnet and yet also needs pretty careful review for the API changes
c2720a6 to
bc2bb03
Compare
|
Done, split into two |
Introduces the kube-api-linter tool (hack/tools/kube-api-linter) and .golangci-kal.yaml, wired into hack/verify-all.sh. Every finding currently produced against pkg/api/v1alpha1 is excluded precisely by field, some because the fix needs a Go API change (tracked in agent-substrate#207) and some file-wide for now (commentstart, conditions, defaultorrequired, optionalorrequired, defaults). This PR makes no content changes to the API types, so it carries no review burden beyond the tool and config themselves. Follow-up PRs remove the file-wide exclusions and fix those findings by class.
bc2bb03 to
856483b
Compare
Benjamin Elder (BenTheElder)
left a comment
There was a problem hiding this comment.
Thanks!
f936206
into
agent-substrate:main
Part of #207, following the plan discussed there with Julian Gutierrez Oschmann (@juli4n) and Kevin Hannon (@kannon92): plumbing plus the non invasive fixes first, with the existing invasive findings excluded so new APIs do not regress (as Kevin Hannon (@kannon92) suggested in #207 (comment)). The linter itself was originally suggested by Benjamin Elder (@BenTheElder) in #188.
Plumbing:
Fixes in pkg/api/v1alpha1 (doc and marker only, no Go API change):
Generated CRDs regenerated. Structural schema changes are only the conditions listType/listMapKey and sandboxClass no longer in the required list (it is defaulted, so behavior is the same); the rest is description text.
Note: my earlier count of 50 issues in #207 was capped by the default golangci-lint issue limit. With the cap removed the real total is 86; the extra ones are requiredfields (20) and ssatags (4), both in the excluded set above.
Test plan