Skip to content

fix: address root causes of recurring CI failures on main - #146

Closed
MaxRink wants to merge 1 commit into
telekom:mainfrom
MaxRink:fix/ci-main-failures
Closed

fix: address root causes of recurring CI failures on main#146
MaxRink wants to merge 1 commit into
telekom:mainfrom
MaxRink:fix/ci-main-failures

Conversation

@MaxRink

@MaxRink MaxRink commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes three root causes of recurring CI failures observed on the main branch:

  1. 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 but go.mod only declares go 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)

  2. TestPoolDeletionWithExistingIPAddresses test failurecontroller-runtime's fake client (v0.21+) does not populate APIVersion on individual items returned by List. The APIVersion group filter in ListAddressesInUse and ListClaimsReferencingPool silently dropped all results, making ValidateDelete think no IPAddressClaim resources existed. This caused the webhook test to always fail after a controller-runtime upgrade. The index-based MatchingFields filter already guarantees only the correct resources are returned, so the loop was redundant and incorrect.

  3. golangci-lint version mismatch — The PR workflow pinned golangci-lint to v2.2.1 which doesn't support Go 1.25. Updated to v2.11.4.

Root Cause

The core issue is that go.mod declared go 1.24.7 while the project effectively requires Go 1.25 (as reflected in CI workflow go-version: 1.25). This mismatch causes failures any time a dependency update is tested against Go 1.25.

Changes

  • go.mod: go 1.24.7go 1.25
  • internal/poolutil/pool.go: Remove redundant and incorrect APIVersion group filter in ListAddressesInUse and ListClaimsReferencingPool; rename loop variable addressesclaims in ListClaimsReferencingPool for clarity
  • .github/workflows/pullrequests.yaml: Update golangci-lint to v2.11.4 (supports Go 1.25)
  • .github/workflows/draft_release.yaml: Update go-version to ^1.25 to match go.mod

Verification

  • go build ./... — ✅ passes
  • go vet ./... — ✅ passes
  • make test — ✅ all tests pass including TestPoolDeletionWithExistingIPAddresses
  • golangci-lint run ./internal/poolutil/... — ✅ no lint issues

Relationship to Other PRs

These are independent fixes targeting the same recurring CI failures on main.

@MaxRink
MaxRink requested a review from schrej as a code owner April 13, 2026 21:54
Copilot AI review requested due to automatic review settings April 13, 2026 21:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mod Go version directive to 1.25 to 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.

@MaxRink
MaxRink force-pushed the fix/ci-main-failures branch from 048c5d8 to 9f1c986 Compare May 20, 2026 09:10
@MaxRink
MaxRink force-pushed the fix/ci-main-failures branch from 9f1c986 to b921c52 Compare June 7, 2026 15:38
@MaxRink
MaxRink force-pushed the fix/ci-main-failures branch from b921c52 to 5d16e2a Compare July 31, 2026 14:40
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.
@MaxRink
MaxRink force-pushed the fix/ci-main-failures branch from 5d16e2a to d74e9f3 Compare August 4, 2026 20:10
@MaxRink

MaxRink commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

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 ListClaimsReferencingPool is already removed, and the golangci-lint / CI version bumps have already landed. The only remaining diff was a no-op variable rename (addresses -> claims) in internal/poolutil/pool.go, which isn't worth a standalone PR.

@MaxRink MaxRink closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants