build(ci): pin Go in migration-script-lint like the other container jobs - #9096
Open
DoDiODev wants to merge 1 commit into
Open
build(ci): pin Go in migration-script-lint like the other container jobs#9096DoDiODev wants to merge 1 commit into
DoDiODev wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
migration-script-lintis the only job that runs insidemericodev/lake-builder:latestwithout installing the pinned Go toolchain.The image still ships Go 1.20.4, while
backend/go.moddeclaresgo 1.26.test.yml,test-e2e.ymlandgolangci-lint.ymlall bootstrap the toolchainvia
backend/scripts/install-go.sh(added in #9031 / #9056). This PR adds thesame step to the remaining job, using the identical step name and command:
Why it matters even though the job is green today
Go ≤ 1.20 does not treat a higher
godirective as a hard error — it onlyreports it when compilation fails for another reason. The job therefore passes,
but it builds and runs
core/migration/linter/main.gounder a language versionsix 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
:latestbuilder imagesilently determines the Go version used to run project code.
Cost
install-go.shis idempotent: it checks for an already-installed toolchainunder
/opt/go/$GO_VERSIONbefore 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.shandinstall-mockery.share 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-lintjob the linting step nowreports:
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:latestprecisely becauseinstall-go.shinstalls thetoolchain at job runtime — the same mechanism the other three container jobs
already rely on.