github/workflows: Use Go version in go.mod rather than static version#39
github/workflows: Use Go version in go.mod rather than static version#39
Conversation
|
Warning Rate limit exceeded@echarrod has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 8 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe Sonar workflow now sets the Go version by reading from go.mod using go-version-file instead of a hard-coded 1.24. The Test workflow updates its Go matrix to use Go 1.24 (and 1). No other steps or commands were changed in these workflows. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/test.yml (1)
32-36: Upgrade Actions and modernise dependency install.
- actions/setup-go@v1 and actions/checkout@v2 are outdated; align with v5 and v4 respectively (we already use v5 in sonar.yml).
- Prefer
go mod downloadovergo get -din CI.Apply this diff:
- - name: Set up Go - uses: actions/setup-go@v1 + - name: Set up Go + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - name: Get dependencies - run: | - go get -v -t -d ./... + run: | + go mod downloadAlso applies to: 38-43
.github/workflows/sonar.yml (1)
9-13: Tighten default token permissions (defence in depth).Set minimal permissions at workflow/job scope.
Apply one of:
name: Sonar Report on: push: branches: [ "main" ] pull_request: branches: [ "main" ] jobs: build: + permissions: + contents: read runs-on: ubuntu-latestOr at the top-level:
name: Sonar Report +permissions: + contents: read
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/sonar.yml(1 hunks).github/workflows/test.yml(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: echarrod
PR: luno/shift#32
File: .github/workflows/test.yml:18-18
Timestamp: 2025-05-01T10:01:27.992Z
Learning: In GitHub Actions with Go, using '1' as a version number refers to the latest stable version of Go 1.x (for example, 1.24 if that's the latest release). This allows workflows to automatically test against the latest version without explicitly updating version numbers.
📚 Learning: 2025-05-01T10:01:27.992Z
Learnt from: echarrod
PR: luno/shift#32
File: .github/workflows/test.yml:18-18
Timestamp: 2025-05-01T10:01:27.992Z
Learning: In GitHub Actions with Go, using '1' as a version number refers to the latest stable version of Go 1.x (for example, 1.24 if that's the latest release). This allows workflows to automatically test against the latest version without explicitly updating version numbers.
Applied to files:
.github/workflows/sonar.yml
🪛 actionlint (1.7.7)
.github/workflows/test.yml
49-49: property access of object must be type of string but got "number"
(expression)
🪛 YAMLlint (1.37.1)
.github/workflows/test.yml
[error] 49-49: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (2)
.github/workflows/test.yml (1)
18-18: Matrix bump to Go 1.24 and latest looks good.Using ['1.24', '1'] is aligned with our earlier guidance; '1' tracks the latest stable Go 1.x.
.github/workflows/sonar.yml (1)
30-30: Good switch to go-version-file.Deriving Go from go.mod removes version drift between CI and the module.
Please confirm go.mod declares the intended Go version (e.g., go 1.24) so Sonar runs against the expected toolchain.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
…luno#39) * github/workflows: Use Go version in go.mod rather than static version * github/workflows: Update sonar workflow to use Go version from go.mod * Update .github/workflows/test.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .github/workflows/sonar.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>



Update GitHub Actions workflow to use standardized Go versions ['1.24', '1'] instead of ['1.23', '1'].
This change:
Summary by CodeRabbit