Skip to content

Conversation

xNok
Copy link

@xNok xNok commented Feb 12, 2024

I discovered your utility via Renovate, which uses it to handle the major upgrade workflow. The module is conveniently called mod, so it could be extended to auto-resolve all the mod-related issues.

Renovate recently introduced the "replacement" feature that can be used to update the dependencies for which the package name has changed. Unfortunately, the gomod manager is not supported, so I am planning to do the work and get it implemented.

There are a few cases where this happens in go

  • Repository changes owners or is given to a different organisation
  • Migration to a different repository hosting solution Github <-> Gitlab <-> Bitbucket <-> etc
  • Introducing registry or vanity URLs.

My renovate branch for this feature: https://github.com/xNok/renovate/tree/replacement-for-gomod

@jamietanna
Copy link

jamietanna commented Apr 20, 2025

Giving this a go (as part of renovatebot/renovate#29575) with https://github.com/jamietanna/renovate-iss-oapi I'm finding this doesn't quite work.

For instance:

$ mod replace --mod-old=github.com/deepmap/oapi-codegen --mod-new=github.com/oapi-codegen/oapi-codegen/v2
replace github.com/deepmap/oapi-codegen by github.com/oapi-codegen/oapi-codegen/v2running go mod tidy...
go: finding module for package github.com/deepmap/oapi-codegen/cmd/oapi-codegen
go: found github.com/deepmap/oapi-codegen/cmd/oapi-codegen in github.com/deepmap/oapi-codegen v1.16.3

This then results in the following diff:

-require github.com/deepmap/oapi-codegen v1.12.0
+require github.com/deepmap/oapi-codegen v1.16.3

Whereas I'd expect to see:

-require github.com/deepmap/oapi-codegen v1.12.0
+require github.com/oapi-codegen/oapi-codegen/v2 v2.3.1

Any idea why?

I'd assume that after executing this, I'd also see a change in the tools.go

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