Skip to content

feat(gomod): run go mod tidy after Go module updates - #8

Merged
cwaits6 merged 1 commit into
mainfrom
feat/gomod-tidy
Sep 7, 2026
Merged

cwaits6 merged 1 commit into
mainfrom
feat/gomod-tidy

Conversation

@cwaits6

@cwaits6 cwaits6 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

Renovate's Go module manager only adds go.sum checksums for the new version on each bump and never removes the previous version's entries unless gomodTidy is enabled. In cwaits6/apk-datasource this accumulated about 118 stale lines across OpenTelemetry 1.42 through 1.45 before a manual go mod tidy in cwaits6/apk-datasource#57 cleaned it up.

What

Add "postUpdateOptions": ["gomodTidy"] so Renovate runs go mod tidy after editing go.mod. Documented in the README table.

Blast radius

gomodTidy is scoped to the gomod manager and is never evaluated in a repo without go.mod. Of the repos extending this preset today, only apk-datasource is Go. krypsis-io/wick will join it via krypsis-io/wick#35.

The first Renovate PR in any Go repo after this lands will carry a one-time go.sum prune. In apk-datasource that already happened in #57, so nothing extra shows up there.

Summary by CodeRabbit

  • New Features

    • Renovate now runs go mod tidy after Go module updates, helping remove stale go.sum entries.
  • Documentation

    • Added documentation for the new Go module cleanup setting.

Without postUpdateOptions gomodTidy, Renovate only adds checksums for
the new version on each Go module bump and never removes the old ones.
In apk-datasource this left ~118 stale go.sum lines across five
OpenTelemetry versions before a manual tidy cleaned them up.

gomodTidy is scoped to the gomod manager, so repos without a go.mod are
unaffected.
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: a2f375bb-faaa-4a6d-bf97-dfe15a4a0960

📥 Commits

Reviewing files that changed from the base of the PR and between 3a5880a and 6468a6e.

📒 Files selected for processing (2)
  • README.md
  • default.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Renovate configuration enables gomodTidy after Go module updates. The README documents this behavior.

Changes

Go module tidy configuration

Layer / File(s) Summary
Configure and document gomodTidy
default.json, README.md
The configuration enables postUpdateOptions with gomodTidy. The README documents the resulting go mod tidy execution.

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

Merge Risk: ⚪ Minimal · up to 6468a

Renovate will run go mod tidy after Go module dependency updates and documentation now describes that behavior. No concrete current-head merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling go mod tidy after Go module updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gomod-tidy

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.

@cwaits6
cwaits6 merged commit 26f0c11 into main Sep 7, 2026
1 check passed
@krypsis-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@cwaits6
cwaits6 deleted the feat/gomod-tidy branch September 7, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant