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

deps: bump go 1.22 #6380

Merged
merged 6 commits into from
May 27, 2024
Merged

deps: bump go 1.22 #6380

merged 6 commits into from
May 27, 2024

Conversation

crodriguezvega
Copy link
Contributor

@crodriguezvega crodriguezvega commented May 24, 2024

Description

I shamelessly took @damiannolan's changes from the depinject feature branch and applied them to main.

Tested locally both make proto-all and make test.

closes: #5776


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Summary by CodeRabbit

  • Chores
    • Updated Go version from 1.21 to 1.22 across all GitHub Actions workflows.
    • Changed base Docker images to use Go 1.22-alpine3.20 instead of Go 1.21-alpine3.18.
    • Updated Go version to 1.22 in example and module-specific Dockerfiles.

Copy link
Contributor

coderabbitai bot commented May 24, 2024

Walkthrough

Walkthrough

The changes primarily involve updating the Go version from 1.21 to 1.22 across various workflow files, Dockerfiles, and configuration files within the repository. This ensures compatibility with the new Go version and maintains consistency across different environments and CI/CD pipelines.

Changes

Files/Groups Change Summary
.github/workflows/callbacks.yml, .github/workflows/capability.yml, .github/workflows/test.yml, .github/workflows/wasm-client.yml, .github/workflows/e2e-compatibility-workflow-call.yaml, .github/workflows/e2e-fork.yml, .github/workflows/e2e-test-workflow-call.yml, .github/workflows/e2e-wasm.yaml, .github/workflows/e2e.yaml, .github/workflows/e2emodule.yml, .github/workflows/golangci-feature.yml, .github/workflows/golangci.yml, .github/workflows/release.yml Updated go-version from '1.21' to '1.22' in the actions/setup-go@v5 steps.
Dockerfile, modules/apps/callbacks/Dockerfile, modules/light-clients/08-wasm/Dockerfile Changed the base image from golang:1.21-alpine3.18 to golang:1.22-alpine3.20.
go.work.example Updated the Go version from 1.21 to 1.22.0 and added a toolchain reference for Go 1.22.0.
CHANGELOG.md Documented the version bump for Go to 1.22 in the cosmos/ibc-go repository.

Assessment against linked issues

Objective Addressed Explanation
Bump Go to 1.22 in go.mod for all modules (#5776) The provided diff does not include changes to go.mod files.
Update setup-go steps in workflow files to use Go 1.22 (#5776)
Update go.work.example to use Go 1.22 (#5776)
Update Dockerfiles to use Go 1.22 and supported Alpine version (#5776)
Update version matrix in RELEASES.md (#5776) The provided diff does not include changes to RELEASES.md.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.


toolchain go1.21.0
toolchain go1.22.0
Copy link
Contributor

Choose a reason for hiding this comment

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

any idea if this is needed? some files have it, some not 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably it's not. Since it was already there, I left it...

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range and nitpick comments (16)
Dockerfile (3)

Line range hint 13-16: Prefer COPY over ADD for copying local files as COPY is more transparent.

- ADD internal internal
- ADD testing testing
- ADD modules modules
- ADD LICENSE LICENSE
+ COPY internal internal
+ COPY testing testing
+ COPY modules modules
+ COPY LICENSE LICENSE

Line range hint 18-22: Ensure WORKDIR is set before copying files to a relative destination to avoid ambiguity.

+ WORKDIR /go
COPY contrib/devtools/Makefile contrib/devtools/Makefile
COPY Makefile .
COPY go.mod .
COPY go.sum .

Line range hint 26-26: Consider consolidating multiple RUN instructions to reduce layers and improve build efficiency.

- RUN go mod download
- RUN make build
+ RUN go mod download && make build
modules/apps/callbacks/Dockerfile (4)

Line range hint 9-12: Prefer COPY over ADD for copying local files as COPY is more transparent.

- ADD internal internal
- ADD testing testing
- ADD modules modules
- ADD LICENSE LICENSE
+ COPY internal internal
+ COPY testing testing
+ COPY modules modules
+ COPY LICENSE LICENSE

Line range hint 14-15: Ensure WORKDIR is set before copying files to a relative destination to avoid ambiguity.

+ WORKDIR /go/modules/apps/callbacks
COPY go.mod .
COPY go.sum .

Line range hint 17-17: Use an absolute path for WORKDIR to avoid potential issues with relative paths.

- WORKDIR modules/apps/callbacks
+ WORKDIR /go/modules/apps/callbacks

Line range hint 21-21: Consider consolidating multiple RUN instructions to reduce layers and improve build efficiency.

- RUN go mod download
- RUN GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger," -w -s' -trimpath -o /go/build/ ./...
+ RUN go mod download && \
+    GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false go build -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger," -w -s' -trimpath -o /go/build/ ./...
modules/light-clients/08-wasm/Dockerfile (6)

Line range hint 7-7: Consolidate multiple RUN instructions to reduce layers and improve build efficiency.

- RUN test -n "${LIBWASM_VERSION}"
- RUN test -n "${LIBWASM_CHECKSUM}"
+ RUN test -n "${LIBWASM_VERSION}" && test -n "${LIBWASM_CHECKSUM}"

Line range hint 9-9: Pin specific versions of packages in apk add to ensure reproducibility.

- RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
+ RUN set -eux; apk add --no-cache git=2.30.2-r0 libusb-dev=1.0.24-r1 linux-headers=5.10.41-r0 gcc=10.3.1_git20210424-r2 musl-dev=1.2.2-r3 make=4.3-r0;

Line range hint 15-15: Set the SHELL option -o pipefail before using a pipe in RUN to ensure that errors in a pipeline are not masked.

+ SHELL ["/bin/ash", "-eo", "pipefail"]
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ${LIBWASM_CHECKSUM}

Line range hint 20-23: Prefer COPY over ADD for copying local files as COPY is more transparent.

- ADD internal internal
- ADD testing testing
- ADD modules modules
- ADD LICENSE LICENSE
+ COPY internal internal
+ COPY testing testing
+ COPY modules modules
+ COPY LICENSE LICENSE

Line range hint 25-26: Ensure WORKDIR is set before copying files to a relative destination to avoid ambiguity.

+ WORKDIR /go/modules/light-clients/08-wasm
COPY go.mod .
COPY go.sum .

Line range hint 32-32: Consider consolidating multiple RUN instructions to reduce layers and improve build efficiency.

- RUN go mod download
- RUN GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...
+ RUN go mod download && \
+    GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./...
CHANGELOG.md (3)

Line range hint 216-216: Remove trailing spaces.

- * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22. 
+ * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22.

Line range hint 266-266: Remove trailing spaces.

- * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22. 
+ * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22.

Line range hint 201-201: Use a descriptive text for URLs to improve accessibility.

- * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22.
+ * [\#6380](Bump go to v1.22)[https://github.com/cosmos/ibc-go/pull/6380]
Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between a8df69e and dc62243.
Files ignored due to path filters (5)
  • e2e/go.mod is excluded by !**/*.mod, !**/*.mod
  • go.mod is excluded by !**/*.mod, !**/*.mod
  • modules/apps/callbacks/go.mod is excluded by !**/*.mod, !**/*.mod
  • modules/capability/go.mod is excluded by !**/*.mod, !**/*.mod
  • modules/light-clients/08-wasm/go.mod is excluded by !**/*.mod, !**/*.mod
Files selected for processing (18)
  • .github/workflows/callbacks.yml (3 hunks)
  • .github/workflows/capability.yml (2 hunks)
  • .github/workflows/e2e-compatibility-workflow-call.yaml (1 hunks)
  • .github/workflows/e2e-fork.yml (4 hunks)
  • .github/workflows/e2e-test-workflow-call.yml (2 hunks)
  • .github/workflows/e2e-wasm.yaml (1 hunks)
  • .github/workflows/e2e.yaml (1 hunks)
  • .github/workflows/e2emodule.yml (2 hunks)
  • .github/workflows/golangci-feature.yml (1 hunks)
  • .github/workflows/golangci.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .github/workflows/test.yml (2 hunks)
  • .github/workflows/wasm-client.yml (3 hunks)
  • CHANGELOG.md (1 hunks)
  • Dockerfile (1 hunks)
  • go.work.example (1 hunks)
  • modules/apps/callbacks/Dockerfile (1 hunks)
  • modules/light-clients/08-wasm/Dockerfile (1 hunks)
Files skipped from review due to trivial changes (13)
  • .github/workflows/callbacks.yml
  • .github/workflows/e2e-compatibility-workflow-call.yaml
  • .github/workflows/e2e-fork.yml
  • .github/workflows/e2e-test-workflow-call.yml
  • .github/workflows/e2e-wasm.yaml
  • .github/workflows/e2e.yaml
  • .github/workflows/e2emodule.yml
  • .github/workflows/golangci-feature.yml
  • .github/workflows/golangci.yml
  • .github/workflows/release.yml
  • .github/workflows/test.yml
  • .github/workflows/wasm-client.yml
  • go.work.example
Additional Context Used
Markdownlint (3)
CHANGELOG.md (3)

216: Expected: 0 or 2; Actual: 1
Trailing spaces


266: Expected: 0 or 2; Actual: 1
Trailing spaces


201: null
Bare URL used

Hadolint (29)
Dockerfile (10)

4: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>


13: Use COPY instead of ADD for files and folders


14: Use COPY instead of ADD for files and folders


15: Use COPY instead of ADD for files and folders


16: Use COPY instead of ADD for files and folders


18: COPY to a relative destination without WORKDIR set.


19: COPY to a relative destination without WORKDIR set.


21: COPY to a relative destination without WORKDIR set.


22: COPY to a relative destination without WORKDIR set.


26: Multiple consecutive RUN instructions. Consider consolidation.

modules/apps/callbacks/Dockerfile (9)

3: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>


9: Use COPY instead of ADD for files and folders


10: Use COPY instead of ADD for files and folders


11: Use COPY instead of ADD for files and folders


12: Use COPY instead of ADD for files and folders


14: COPY to a relative destination without WORKDIR set.


15: COPY to a relative destination without WORKDIR set.


17: Use absolute WORKDIR


21: Multiple consecutive RUN instructions. Consider consolidation.

modules/light-clients/08-wasm/Dockerfile (10)

7: Multiple consecutive RUN instructions. Consider consolidation.


9: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>


15: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check


20: Use COPY instead of ADD for files and folders


21: Use COPY instead of ADD for files and folders


22: Use COPY instead of ADD for files and folders


23: Use COPY instead of ADD for files and folders


25: COPY to a relative destination without WORKDIR set.


26: COPY to a relative destination without WORKDIR set.


32: Multiple consecutive RUN instructions. Consider consolidation.

Path-based Instructions (1)
CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (4)
Dockerfile (1)

1-1: Update to Go 1.22 and Alpine 3.20 is aligned with the PR objectives.

modules/apps/callbacks/Dockerfile (1)

1-1: Update to Go 1.22 and Alpine 3.20 is aligned with the PR objectives.

modules/light-clients/08-wasm/Dockerfile (1)

1-1: Update to Go 1.22 and Alpine 3.20 is aligned with the PR objectives.

.github/workflows/capability.yml (1)

20-20: Update to Go 1.22 in GitHub Actions workflow is aligned with the PR objectives.

Also applies to: 32-32

@@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump Cosmos SDK to v0.50.6.
* [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump `cosmossdk.io/store` to v1.1.0.
* [\#6239](https://github.com/cosmos/ibc-go/pull/6239) Bump CometBFT to v0.38.7.
* [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure the Go version update is documented in the changelog.

Please add an entry in the changelog under the "Dependencies" section to document the update of the Go version to 1.22 as part of this pull request.

@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18 as builder
FROM golang:1.22-alpine3.20 as builder
ARG IBC_GO_VERSION

RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
Copy link
Contributor

Choose a reason for hiding this comment

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

Pin specific versions of packages in apk add to ensure reproducibility.

- RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
+ RUN set -eux; apk add --no-cache git=2.30.2-r0 libusb-dev=1.0.24-r1 linux-headers=5.10.41-r0 gcc=10.3.1_git20210424-r2 musl-dev=1.2.2-r3 make=4.3-r0;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
RUN set -eux; apk add --no-cache git=2.30.2-r0 libusb-dev=1.0.24-r1 linux-headers=5.10.41-r0 gcc=10.3.1_git20210424-r2 musl-dev=1.2.2-r3 make=4.3-r0;

@@ -1,4 +1,4 @@
FROM golang:1.21-alpine3.18 as builder
FROM golang:1.22-alpine3.20 as builder

RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
Copy link
Contributor

Choose a reason for hiding this comment

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

Pin specific versions of packages in apk add to ensure reproducibility.

- RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
+ RUN set -eux; apk add --no-cache git=2.30.2-r0 libusb-dev=1.0.24-r1 linux-headers=5.10.41-r0 gcc=10.3.1_git20210424-r2 musl-dev=1.2.2-r3 make=4.3-r0;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make;
RUN set -eux; apk add --no-cache git=2.30.2-r0 libusb-dev=1.0.24-r1 linux-headers=5.10.41-r0 gcc=10.3.1_git20210424-r2 musl-dev=1.2.2-r3 make=4.3-r0;

@crodriguezvega crodriguezvega added the priority PRs that need prompt reviews label May 27, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between dc62243 and 927ab14.
Files selected for processing (5)
  • .github/workflows/callbacks.yml (3 hunks)
  • .github/workflows/capability.yml (2 hunks)
  • .github/workflows/test.yml (3 hunks)
  • .github/workflows/wasm-client.yml (3 hunks)
  • CHANGELOG.md (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/callbacks.yml
  • .github/workflows/capability.yml
  • .github/workflows/test.yml
  • .github/workflows/wasm-client.yml
Additional Context Used
Markdownlint (4)
CHANGELOG.md (4)

57: Expected: 0 or 2; Actual: 1
Trailing spaces


217: Expected: 0 or 2; Actual: 1
Trailing spaces


267: Expected: 0 or 2; Actual: 1
Trailing spaces


202: null
Bare URL used

Path-based Instructions (1)
CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (1)
CHANGELOG.md (1)

44-44: The changelog entry for the Go version bump to 1.22 is correctly documented.

Copy link

Quality Gate Passed Quality Gate passed for 'ibc-go'

Issues
11 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@crodriguezvega crodriguezvega merged commit bce3e9e into main May 27, 2024
84 of 85 checks passed
@crodriguezvega crodriguezvega deleted the bump-go-1.22 branch May 27, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority PRs that need prompt reviews
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bump go to 1.22
4 participants