Bump go 1.27.1 - #22373
Conversation
Signed-off-by: Sharath P J <pjsharath28@gmail.com>
Signed-off-by: Sharath P J <pjsharath28@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 441 files with indirect coverage changes @@ Coverage Diff @@
## main #22373 +/- ##
==========================================
+ Coverage 69.73% 72.97% +3.23%
==========================================
Files 448 448
Lines 38058 31556 -6502
==========================================
- Hits 26541 23028 -3513
+ Misses 10101 8525 -1576
+ Partials 1416 3 -1413 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Commit 1 — Go version bump Commit 2 — fix: use value dereference for v2error.Error with %w |
…0.8.1 Signed-off-by: Sharath P J <pjsharath28@gmail.com>
|
Commit 3 - fix: address staticcheck SA4023 warnings
|
Signed-off-by: Sharath P J <pjsharath28@gmail.com>
|
Commit 4 - test: update TestLogRotation expected error for Go 1.27 json/v2 Go 1.27 enables
No production code changed - just updated the hardcoded expected string |
…hesis Dockerfile Signed-off-by: Sharath P J <pjsharath28@gmail.com>
|
Commit 5 - fix: sync go.work and go.mod versions in antithesis Dockerfile The Dockerfile clones from |
|
/retest |
| # Sync go.work and all go.mod versions to match the copied pkg module, | ||
| # since the cloned branch may be behind the copied pkg module requirements. | ||
| RUN eval $(grep -E '^(go|toolchain) ' tests/antithesis/pkg/go.mod | awk '{print toupper($1)"="$2}') && \ | ||
| go work edit -go=${GO} -toolchain=${TOOLCHAIN} && \ | ||
| find . -name 'go.mod' -not -path './tests/antithesis/*' -exec \ | ||
| go mod edit -go=${GO} -toolchain=${TOOLCHAIN} {} \; |
There was a problem hiding this comment.
Why is line 9 not working anymore? I remember that it failed in a previous minor version bump, and the solution was to set the environment variable.
There was a problem hiding this comment.
The fix in 4e39cdf was for a patch bump mismatch (base image 1.25.0 vs toolchain 1.25.1) where go env -w was enough since the go directive didn't need to change.
In this case though, the copied pkg/go.mod requires go 1.27 while the cloned go.work still says go 1.26, so we also need go work edit + go mod edit to update the directive itself. Happy to revisit if there's a cleaner way to handle this!
There was a problem hiding this comment.
Ah, got it. I wanted to replace this with the utilities we already have, something like:
RUN awk 'match($0, /^toolchain go/) {gsub(/go/, "", $2); print $2}' tests/antithesis/pkg/go.mod > .go-version && make sync-toolchain-directive
But the problem is that we would only update the toolchain, not the go directive.
fuweid
left a comment
There was a problem hiding this comment.
Could you please squash the commits into one? Don't think we need 5 commits to bump goversion thanks
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pjsharath28 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Just thought it'd be easier to keep them separate for the reviewers. Once everything looks good, I'm happy to squash. Hope that would be fine. |
| if err := c.getWatch(); err != nil { | ||
| fmt.Printf("getWatch failed, will retry after %v: %v\n", backoff, err) | ||
| } | ||
| err := c.getWatch() |
There was a problem hiding this comment.
suggest using comment instead of changing code
//nolint:staticcheck // SA4023: Related diagnostic for the defensive nil check in getWatchLoop.
| COPY pkg /etcd/tests/antithesis/pkg | ||
| # Sync go.work and all go.mod versions to match the copied pkg module, | ||
| # since the cloned branch may be behind the copied pkg module requirements. | ||
| RUN eval $(grep -E '^(go|toolchain) ' tests/antithesis/pkg/go.mod | awk '{print toupper($1)"="$2}') && \ |
There was a problem hiding this comment.
maybe we can try this
# The copied module may require a newer Go version than the cloned workspace.
RUN if [ -f go.work ]; then go work use; fi
| # cloning etcd | ||
| ARG REF=main | ||
| RUN git clone --depth=1 https://github.com/etcd-io/etcd.git --branch=${REF} /etcd | ||
| RUN go env -w GOTOOLCHAIN="go$(cat .go-version)" |
There was a problem hiding this comment.
We can try this because GO_IMAGE_TAG is aligned with .go-version in root.
# Use the selected build image's toolchain, including when building older refs.
ENV GOTOOLCHAIN=local
Part of #22372