Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-1.15: Reduce minimum go toolchain in go.mod. #8399

Merged

Conversation

kaovilai
Copy link
Member

@kaovilai kaovilai commented Nov 12, 2024

TL;DR: this change keeps 1.22.8 as go toolchain for this repo without enforcing it as minimum version on others.

Verification (click me!) prior to #8398 review

make container && docker run --rm velero/velero:main /velero version --client-only
[+] Building 60.0s (18/18) FINISHED                                                                                                        docker-container:colima-multiplat
 => [internal] load build definition from Dockerfile                                                                                                                    0.0s
 => => transferring dockerfile: 2.37kB                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/paketobuildpacks/run-jammy-tiny:0.2.52                                                                                       3.6s
 => [internal] load metadata for docker.io/library/golang:1.22.8-bookworm                                                                                               3.4s
 => [auth] paketobuildpacks/run-jammy-tiny:pull token for registry-1.docker.io                                                                                          0.0s
 => [auth] library/golang:pull token for registry-1.docker.io                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                       0.0s
 => => transferring context: 60B                                                                                                                                        0.0s
 => CACHED [stage-2 1/3] FROM docker.io/paketobuildpacks/run-jammy-tiny:0.2.52@sha256:402b925a81a4c6985438fd37d0b22022ca688e528bbd46a38831a3702067cced                  0.0s
 => => resolve docker.io/paketobuildpacks/run-jammy-tiny:0.2.52@sha256:402b925a81a4c6985438fd37d0b22022ca688e528bbd46a38831a3702067cced                                 0.0s
 => CACHED [restic-builder 1/3] FROM docker.io/library/golang:1.22.8-bookworm@sha256:3f0457a0a56a926d93c2baf4cf0057a645e8ff69ff31314080fcc62389643b8e                   0.0s
 => => resolve docker.io/library/golang:1.22.8-bookworm@sha256:3f0457a0a56a926d93c2baf4cf0057a645e8ff69ff31314080fcc62389643b8e                                         0.0s
 => [internal] load build context                                                                                                                                       0.2s
 => => transferring context: 883.86kB                                                                                                                                   0.2s
 => CACHED [velero-builder 2/4] WORKDIR /go/src/github.com/vmware-tanzu/velero                                                                                          0.0s
 => [velero-builder 3/4] COPY . /go/src/github.com/vmware-tanzu/velero                                                                                                  1.6s
 => [restic-builder 2/3] COPY . /go/src/github.com/vmware-tanzu/velero                                                                                                  1.6s
 => [velero-builder 4/4] RUN mkdir -p /output/usr/bin &&     export GOARM=$( echo "" | cut -c2-) &&     go build -o /output/velero     -ldflags "-X github.com/vmware  49.7s
 => [restic-builder 3/3] RUN mkdir -p /output/usr/bin &&     export GOARM=$(echo "" | cut -c2-) &&     /go/src/github.com/vmware-tanzu/velero/hack/build-restic.sh &&  34.6s
 => [stage-2 2/3] COPY --from=velero-builder /output /                                                                                                                  0.2s
 => [stage-2 3/3] COPY --from=restic-builder /output /                                                                                                                  0.1s
 => exporting to docker image format                                                                                                                                    4.1s
 => => exporting layers                                                                                                                                                 2.7s
 => => exporting manifest sha256:5387d1a59b10970f9d0800ba960c4eb0f008e0d2bba5a9498b009ac478e5f4d4                                                                       0.0s
 => => exporting config sha256:f29cee5131777c8dc47571fc475f1abb2984ff1657b51c3a720c8aa453b195f2                                                                         0.0s
 => => sending tarball                                                                                                                                                  1.4s
 => importing to docker                                                                                                                                                 0.5s
 => => loading layer 4e2166c05ab9 491.52kB / 45.94MB                                                                                                                    0.5s
 => => loading layer dd8fc23784d7 98.30kB / 8.82MB                                                                                                                      0.1s

 1 warning found (use --debug to expand):
 - UndefinedVar: Usage of undefined variable '$GOPROXY' (line 58)
container: velero/velero:main
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Client:
        Version: main
        Git commit: 303d239819259b54ecd264eef176b9dc55db3871-dirty
        Go version: go1.22.8

Thank you for contributing to Velero!

Please add a summary of your change

Reduce minimum go toolchain + add verification from #8398

Update: verification was removed per review in #8398, but we did validated this pr earlier that the correct toolchain was applied.

Does your change fix a particular issue?

Fixes #8397

Please indicate you've done the following:

@github-actions github-actions bot added the Dependencies Pull requests that update a dependency file label Nov 12, 2024
@kaovilai kaovilai force-pushed the removeMinimumGoToolchainGo.mod branch from 43c81aa to 7faca77 Compare November 12, 2024 21:15
@kaovilai kaovilai force-pushed the removeMinimumGoToolchainGo.mod branch 3 times, most recently from 327461d to 6151a0b Compare November 12, 2024 21:22
@kaovilai kaovilai changed the title Reduce minimum go toolchain in go.mod release-1.15 Reduce minimum go toolchain in go.mod Nov 12, 2024
@kaovilai kaovilai changed the title release-1.15 Reduce minimum go toolchain in go.mod release-1.15: Reduce minimum go toolchain in go.mod Nov 12, 2024
@kaovilai kaovilai changed the title release-1.15: Reduce minimum go toolchain in go.mod release-1.15: Reduce minimum go toolchain in go.mod and verify it do not lower toolchain used to build. Nov 12, 2024
@kaovilai kaovilai marked this pull request as ready for review November 12, 2024 21:26
@kaovilai kaovilai force-pushed the removeMinimumGoToolchainGo.mod branch from 6151a0b to daad3bd Compare November 12, 2024 21:43
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.98%. Comparing base (dd1c6a6) to head (c3967c3).
Report is 2 commits behind head on release-1.15.

Additional details and impacted files
@@              Coverage Diff              @@
##           release-1.15    #8399   +/-   ##
=============================================
  Coverage         58.98%   58.98%           
=============================================
  Files               367      367           
  Lines             38855    38855           
=============================================
  Hits              22919    22919           
  Misses            14474    14474           
  Partials           1462     1462           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -69,6 +69,7 @@ func printVersion(w io.Writer, clientOnly bool, kbClient kbclient.Client, server
fmt.Fprintln(w, "Client:")
fmt.Fprintf(w, "\tVersion: %s\n", buildinfo.Version)
fmt.Fprintf(w, "\tGit commit: %s\n", buildinfo.FormattedGitSHA())
fmt.Fprintf(w, "\tGo version: %s\n", buildinfo.GoVersion())
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this clear enough that it is not user's local go? do we want to say Built by Go Version instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, the information is good enough. Binary print information should already imply it's related to the binary built environment. It's not about the environment running it.

Copy link
Member Author

@kaovilai kaovilai left a comment

Choose a reason for hiding this comment

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

Removed Go Version from CLI/logs per community meeting.

@kaovilai kaovilai force-pushed the removeMinimumGoToolchainGo.mod branch from 9679f60 to fd879ed Compare November 20, 2024 18:03
@kaovilai kaovilai force-pushed the removeMinimumGoToolchainGo.mod branch from fd879ed to c3967c3 Compare November 28, 2024 08:42
go 1.22.8
// Do not pin patch version here. Leave patch at X.Y.0
// Unset GOTOOLCHAIN to assume GOTOOLCHAIN=local where go cli version in path is used.
// Use env GOTOOLCHAIN=auto to allow go to decide whichever is newer from go.mod or cli in path.
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this change affect the release process? E.g., release of 1.15.1.
Do we need to set GOTOOLCHAIN anywhere during the release?

Copy link
Member Author

@kaovilai kaovilai Dec 3, 2024

Choose a reason for hiding this comment

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

Nope.. no need to set GOTOOLCHAIN. Per prior versions of this PR which verified the golang version used to build, it inherits local go version by default which right now is defined by the Dockerfile.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@kaovilai kaovilai changed the title release-1.15: Reduce minimum go toolchain in go.mod and verify it do not lower toolchain used to build. release-1.15: Reduce minimum go toolchain in go.mod. Dec 3, 2024
@kaovilai kaovilai merged commit 3476530 into vmware-tanzu:release-1.15 Dec 4, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Pull requests that update a dependency file has-changelog has-unit-tests target/1.15.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants