Skip to content

ci: Fail the build when go.mod is not tidy - #493

Merged
nirs merged 1 commit into
RamenDR:mainfrom
raaizik:412-go-mod-tidy
Jul 23, 2026
Merged

ci: Fail the build when go.mod is not tidy#493
nirs merged 1 commit into
RamenDR:mainfrom
raaizik:412-go-mod-tidy

Conversation

@raaizik

@raaizik raaizik commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Add a CI job that runs go mod tidy and fails if go.mod or go.sum would change. The diff is shown in the job log so module drift is easy to spot before it lands.

This keeps the module files tidy on every change and avoids unrelated tidy churn showing up in later PRs.

Fixes #412

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@raaizik, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b0d7b0c-6e16-47b9-aec1-83fbe243e25c

📥 Commits

Reviewing files that changed from the base of the PR and between c20169f and d5e25d2.

📒 Files selected for processing (1)
  • .github/workflows/test.yaml
📝 Walkthrough

Walkthrough

The test workflow adds a tidy job that runs go mod tidy and fails if the command changes repository files.

Changes

Go module CI validation

Layer / File(s) Summary
Add Go module tidy workflow job
.github/workflows/test.yaml
Adds checkout and Go setup steps, runs go mod tidy, and verifies the working tree remains clean.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: a CI check that fails when Go modules are not tidy.
Description check ✅ Passed The description accurately describes the new go mod tidy CI job and its failure behavior.
Linked Issues check ✅ Passed The workflow adds a tidy check that runs go mod tidy, shows the diff, and fails on module drift as requested in #412.
Out of Scope Changes check ✅ Passed The change is limited to the CI workflow and stays within the tidy-check scope from the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Comment thread .github/workflows/test.yaml Outdated
Run go mod tidy in CI and fail with a visible diff if go.mod or
go.sum would change, so module drift does not land unnoticed.

Use git --no-pager so the same check works locally without opening
a pager.

Signed-off-by: raaizik <132667934+raaizik@users.noreply.github.com>

@nirs nirs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@nirs
nirs merged commit d676f3c into RamenDR:main Jul 23, 2026
17 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.

ci: Add go mod tidy check

2 participants