Skip to content

fix(manager/gomod): use regex to remove version suffix from name#35508

Merged
rarkins merged 2 commits intorenovatebot:mainfrom
Shegox:gomod-major-updates
Apr 23, 2025
Merged

fix(manager/gomod): use regex to remove version suffix from name#35508
rarkins merged 2 commits intorenovatebot:mainfrom
Shegox:gomod-major-updates

Conversation

@Shegox
Copy link
Copy Markdown
Contributor

@Shegox Shegox commented Apr 23, 2025

Changes

This PR uses a regular expression to remove the /v2 or /v3 suffix from go packages. This is later used to determine if suffix can be updated or appended.

Context

The change is required for packages which don't contain a org/repo but only a package name like sigs.k8s.io/structured-merge-diff. Currently Renovate appends here the new major version to construct the wrong sigs.k8s.io/structured-merge-diff/v4/v6 rather than the expected sigs.k8s.io/structured-merge-diff/v6

fixes #35507

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Tests are added both for the short example as well as an example with multiple (3+) name components.

@rarkins rarkins added this pull request to the merge queue Apr 23, 2025
Merged via the queue into renovatebot:main with commit 5224255 Apr 23, 2025
40 checks passed
Comment thread lib/modules/manager/gomod/update.ts
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 25, 2025
@Shegox Shegox deleted the gomod-major-updates branch June 10, 2025 09:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants