fix: address root causes of recurring CI failures on main - #146
Conversation
There was a problem hiding this comment.
Pull request overview
Aligns repository tooling and utility logic with the project’s effective Go/tooling requirements and updated controller-runtime fake client behavior, eliminating recurring CI failures on main.
Changes:
- Bump
go.modGo version directive to1.25to match dependency requirements and CI configuration. - Simplify poolutil list helpers by removing incorrect
APIVersion-based filtering that breaks with newer controller-runtime fake client behavior. - Update CI workflows to use a Go-1.25-compatible golangci-lint version and align draft release Go version with
go.mod.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/poolutil/pool.go |
Removes redundant/incorrect APIVersion group filtering; returns indexed list results directly. |
go.mod |
Updates the Go version directive to 1.25. |
.github/workflows/pullrequests.yaml |
Updates golangci-lint version to one that supports Go 1.25. |
.github/workflows/draft_release.yaml |
Aligns release workflow Go version to ^1.25. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
048c5d8 to
9f1c986
Compare
9f1c986 to
b921c52
Compare
b921c52 to
5d16e2a
Compare
Three changes to prevent recurring CI failures: 1. go.mod: bump go directive from 1.24.7 to 1.25 The dependencies already require Go 1.25 (controller-runtime v0.21+ and the CI uses go-version 1.25). The go.mod directive must match to avoid 'go language version lower than targeted' errors in golangci-lint when dependabot updates arrive. 2. internal/poolutil/pool.go: remove APIVersion group filter controller-runtime's fake client (v0.21+) does not populate APIVersion on individual items in List results. The filter 'gv.Group != ipam.cluster.x-k8s.io' silently dropped all results, causing TestPoolDeletionWithExistingIPAddresses to fail (webhook ValidateDelete thought no IPAddressClaims existed). The index-based filtering (MatchingFields) already ensures only the right resources are returned, so the APIVersion loop was redundant. 3. CI workflows: update golangci-lint to v2.11.4 and Go version in release workflow to ^1.25 to match the go.mod requirement and avoid lint errors when building with the correct Go version.
5d16e2a to
d74e9f3
Compare
|
Closing as redundant. After rebasing onto the current main, all substantive fixes from this PR are already present independently: go.mod is already at 1.26.5, the APIVersion group-filter in |
Summary
Fixes three root causes of recurring CI failures observed on the
mainbranch:Dependabot kubernetes group update failures — When dependabot recreates the kubernetes group PR (updating
controller-runtime,cluster-api, etc.), CI fails because the updated dependencies require Go 1.25 butgo.modonly declaresgo 1.24.7, causing golangci-lint to abort with:go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)TestPoolDeletionWithExistingIPAddressestest failure —controller-runtime's fake client (v0.21+) does not populateAPIVersionon individual items returned byList. The APIVersion group filter inListAddressesInUseandListClaimsReferencingPoolsilently dropped all results, makingValidateDeletethink noIPAddressClaimresources existed. This caused the webhook test to always fail after a controller-runtime upgrade. The index-basedMatchingFieldsfilter already guarantees only the correct resources are returned, so the loop was redundant and incorrect.golangci-lint version mismatch — The PR workflow pinned golangci-lint to
v2.2.1which doesn't support Go 1.25. Updated tov2.11.4.Root Cause
The core issue is that
go.moddeclaredgo 1.24.7while the project effectively requires Go 1.25 (as reflected in CI workflowgo-version: 1.25). This mismatch causes failures any time a dependency update is tested against Go 1.25.Changes
go.mod:go 1.24.7→go 1.25internal/poolutil/pool.go: Remove redundant and incorrect APIVersion group filter inListAddressesInUseandListClaimsReferencingPool; rename loop variableaddresses→claimsinListClaimsReferencingPoolfor clarity.github/workflows/pullrequests.yaml: Update golangci-lint tov2.11.4(supports Go 1.25).github/workflows/draft_release.yaml: Updatego-versionto^1.25to matchgo.modVerification
go build ./...— ✅ passesgo vet ./...— ✅ passesmake test— ✅ all tests pass includingTestPoolDeletionWithExistingIPAddressesgolangci-lint run ./internal/poolutil/...— ✅ no lint issuesRelationship to Other PRs
These are independent fixes targeting the same recurring CI failures on
main.