Skip to content

build(ci): pin Go in migration-script-lint like the other container jobs - #9096

Open
DoDiODev wants to merge 1 commit into
apache:mainfrom
DoDiODev:pr/wave6-migration-lint-go-pin
Open

build(ci): pin Go in migration-script-lint like the other container jobs#9096
DoDiODev wants to merge 1 commit into
apache:mainfrom
DoDiODev:pr/wave6-migration-lint-go-pin

Conversation

@DoDiODev

@DoDiODev DoDiODev commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

migration-script-lint is the only job that runs inside
mericodev/lake-builder:latest without installing the pinned Go toolchain.
The image still ships Go 1.20.4, while backend/go.mod declares go 1.26.

test.yml, test-e2e.yml and golangci-lint.yml all bootstrap the toolchain
via backend/scripts/install-go.sh (added in #9031 / #9056). This PR adds the
same step to the remaining job, using the identical step name and command:

      - uses: actions/checkout@v6
      - name: Install Go 1.26.6
        run: backend/scripts/install-go.sh
      - name: migration script linting

Why it matters even though the job is green today

Go ≤ 1.20 does not treat a higher go directive as a hard error — it only
reports it when compilation fails for another reason. The job therefore passes,
but it builds and runs core/migration/linter/main.go under a language version
six major releases behind what the project declares. Any migration script that
uses post-1.20 language or standard-library features would fail here for a
reason unrelated to the lint itself, and the failure message would point at the
wrong thing.

This also removes the last place where the mutable :latest builder image
silently determines the Go version used to run project code.

Cost

install-go.sh is idempotent: it checks for an already-installed toolchain
under /opt/go/$GO_VERSION before downloading. Measured on a verification run
(worst case, nothing pre-installed): 2.8 s for download, checksum
verification and extraction, in a job that takes about 45 s in total.

install-libgit2.sh and install-mockery.sh are deliberately not added —
the migration linter needs neither cgo bindings nor generated mocks.

Validation

Verified on a fork branch that mirrors the upstream workflow step lists:
run 33620580891,
13/13 jobs green. In the migration-script-lint job the linting step now
reports:

installed Go 1.26.6 in /opt/go/1.26.6
go version go1.26.6 linux/amd64

instead of the image-provided 1.20.4.

Note for reviewers

This PR does not require a new builder image. It works with the current
mericodev/lake-builder:latest precisely because install-go.sh installs the
toolchain at job runtime — the same mechanism the other three container jobs
already rely on.

The job runs in mericodev/lake-builder:latest, which still ships Go 1.20.4,
while go.mod declares go 1.26. test.yml, test-e2e.yml and golangci-lint.yml
already install the pinned toolchain via backend/scripts/install-go.sh; this
job was the only container job left out.

It currently passes because Go <= 1.20 does not treat a higher go directive as
a hard error, but it compiles and runs the linter under a language version six
major releases behind what the project declares.

The step is idempotent and costs 2.8 seconds when nothing is pre-installed, on
a job of roughly 45 seconds. libgit2 and mockery are not needed here.
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.

1 participant