Skip to content

Bump mockery to v2.53.7 to unbreak unit-test on Go 1.27 - #269

Merged
ack-prow[bot] merged 1 commit into
aws-controllers-k8s:mainfrom
gustavodiaz7722:chore/mockery-go1.27
Sep 8, 2026
Merged

Bump mockery to v2.53.7 to unbreak unit-test on Go 1.27#269
ack-prow[bot] merged 1 commit into
aws-controllers-k8s:mainfrom
gustavodiaz7722:chore/mockery-go1.27

Conversation

@gustavodiaz7722

Copy link
Copy Markdown
Member

Description of changes:

unit-test is currently failing on every PR, including unmodified main. It
fails in the mocks target, which make test depends on, so no test runs:

building mocks for pkg/types ...
internal error: package "k8s.io/apimachinery/pkg/apis/meta/v1" without types was imported from "github.com/aws-controllers-k8s/runtime/pkg/types"
make: *** [Makefile:24: mocks] Error 1

scripts/install-mockery.sh builds mockery from source with whatever Go the CI
image provides, and aws-controllers-k8s/test-infra#1084 moved go_version from
1.26.5 to 1.27.1 on 2026-09-02. mockery v2.53.3 pins
golang.org/x/tools v0.30.0, whose go/packages predates Go 1.27 and cannot
type-check its standard library, which is what produces the without types
loader error.

The timeline matches: the last unit-test run before the image bump passed
(PR #267, 2026-09-02T19:04Z), and runs after it fail.

v2.53.7 pins golang.org/x/tools v0.49.0, which handles Go 1.27.

The mocks are regenerated so the committed output matches the new version. The
only content changes are the generated-by header and import grouping — no mock
behaviour changes.

This also drops mocks/pkg/types/resolved_reference_manager.go. Its
ResolvedReferenceManager interface no longer exists in pkg/types, so mockery
does not generate it and nothing references it. It survived because the mocks
target overwrites files rather than starting from a clean directory, so a
make clean-mocks && make mocks cycle would otherwise always leave the tree
dirty.

Testing

Reproduced and verified locally against both Go versions, building mockery from
source exactly as the job does:

Go mockery make mocks
1.26.0 v2.53.3 passes
1.27.1 v2.53.3 fails with the error above
1.27.1 v2.53.7 passes

Under Go 1.27.1 with this change, all six mock sets generate and the full
go test ./... passes. I also confirmed v2.53.3 fails on unmodified main under
Go 1.27.1, so this is not specific to any open PR.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The unit-test job builds mockery from source with the CI image's Go, and
test-infra moved that image to Go 1.27.1 in aws-controllers-k8s/test-infra#1084.
mockery v2.53.3 pins golang.org/x/tools v0.30.0, whose go/packages predates
Go 1.27 and cannot type-check its standard library, so `make mocks` fails
before any test runs:

    building mocks for pkg/types ...
    internal error: package "k8s.io/apimachinery/pkg/apis/meta/v1" without
    types was imported from "github.com/aws-controllers-k8s/runtime/pkg/types"

v2.53.7 pins golang.org/x/tools v0.49.0, which handles Go 1.27.

Regenerate the mocks so the committed output matches the new version. The
only content changes are the generated-by header and import grouping.

This also drops mocks/pkg/types/resolved_reference_manager.go. Its
ResolvedReferenceManager interface no longer exists in pkg/types, so mockery
does not generate it and nothing references it; it survived only because the
mocks target overwrites files rather than starting from a clean directory.
@michaelhtm

Copy link
Copy Markdown
Member

/lgtm

@ack-prow ack-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2026
@ack-prow

ack-prow Bot commented Sep 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gustavodiaz7722, michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow Bot added the approved label Sep 8, 2026
@ack-prow
ack-prow Bot merged commit 782e265 into aws-controllers-k8s:main Sep 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants