Skip to content

github/workflows: Use Go version in go.mod rather than static version#147

Merged
echarrod merged 4 commits intomainfrom
ed-updateGitHubWorkflowUseGoModVersion
Sep 9, 2025
Merged

github/workflows: Use Go version in go.mod rather than static version#147
echarrod merged 4 commits intomainfrom
ed-updateGitHubWorkflowUseGoModVersion

Conversation

@echarrod
Copy link
Contributor

@echarrod echarrod commented Sep 9, 2025

Update GitHub Actions workflow to use standardized Go versions ['1.24', '1'] in matrix and '1.24' for standalone usage instead of ['1.23', '1'] and '1.23'.

This change:

  • Updates matrix strategy Go versions from ['1.23', '1'] to ['1.24', '1']
  • Updates standalone Go version from '1.23' to '1.24'
  • Uses Go 1.24 as the specific version for testing
  • Uses Go '1' to always test against the latest stable version

Summary by CodeRabbit

  • New Features

    • No user-facing changes in this release.
  • Chores

    • Continuous integration now reads the Go version from the project configuration, avoiding hard-coded values.
    • Test matrix updated to include Go 1.24 for broader compatibility.
  • Refactor

    • Simplified internal cancellation handling to reduce complexity without changing behaviour.
  • Tests

    • Minor workflow formatting tidy-up with no impact on functionality.

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

  • .github/workflows/sonar.yaml: Updated actions/setup-go@v5 to use go-version-file: 'go.mod' instead of a hard-coded go-version: '1.22'.
  • .github/workflows/tests.yml: Bumped test matrix from Go '1.23' to '1.24'; switched adapters_and_examples job to use go-version-file: 'go.mod'; minor formatting tweak in a loop’s closing echo without behavioural change.
  • adapters/memrolescheduler/memrolescheduler.go: Simplified context cancellation handling in RoleScheduler.Await by replacing a loop-based select with a single wait on ctx.Done(), maintaining the same behaviour.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

Possibly related PRs

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly captures the primary change — switching from a hard-coded Go version to using the version specified in go.mod — and directly reflects the updates made to the GitHub Actions workflows without including extraneous details.
Description Check ✅ Passed The description clearly outlines the modifications to the GitHub Actions workflows, specifically detailing the updates to the Go version matrix and the standalone Go version bump, which directly correspond to changes in the pull request.

Poem

I twitch my ears at version lore,
From hard-coded seeds to go.mod’s core.
Tests hop to 1.24 with cheer,
While ctx.Done() whispers near.
A gentle lock, a simpler thread—
Small hops forward, lightly tread. 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ed-updateGitHubWorkflowUseGoModVersion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 9, 2025

Copy link

@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

🧹 Nitpick comments (2)
adapters/memrolescheduler/memrolescheduler.go (1)

31-36: Capture and unlock the exact mutex; avoid map lookups under lock

Unlocking via r.roles[role] risks targeting a different mutex if the map entry ever changes and needlessly holds r.mu. Capture mu in the goroutine and Unlock() it directly.

-	go func(role string) {
-		<-ctx.Done()
-		r.mu.Lock()
-		r.roles[role].Unlock()
-		r.mu.Unlock()
-	}(role)
+	go func(m *sync.Mutex) {
+		<-ctx.Done()
+		m.Unlock()
+	}(mu)
.github/workflows/tests.yml (1)

52-52: Add a trailing newline to satisfy linters

Yamllint flags “no new line at end of file”.

           (cd "$dir" && go vet ./...)
-          done
+          done
+
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5707497 and e70ecdb.

📒 Files selected for processing (3)
  • .github/workflows/sonar.yaml (1 hunks)
  • .github/workflows/tests.yml (3 hunks)
  • adapters/memrolescheduler/memrolescheduler.go (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/tests.yml

[error] 52-52: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (4)
adapters/memrolescheduler/memrolescheduler.go (1)

45-45: No behavioural change here

Closing brace only.

.github/workflows/tests.yml (2)

14-14: LGTM: test against Go 1.24 and latest stable

Good balance between a fixed baseline and tracking latest.


38-39: LGTM: derive Go version from go.mod

Using go-version-file: 'go.mod' keeps a single source of truth for adapters/examples.

.github/workflows/sonar.yaml (1)

22-22: LGTM: use go-version-file for Sonar job as well

This aligns CI with the module’s declared toolchain.

@echarrod echarrod merged commit fbf31cc into main Sep 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments