Open hugoboos opened 1 year ago
Reproduction imported to https://github.com/renovate-reproductions/21010 (note: in future it would be appreciated if you can reproduction github.com to make it more easily forkable)
This one will need someone to do some experimentation. Renovate usually:
go.mod
) manually, thengo.sum
, vendored files, etc)In this case it's being asked to skip the go.mod
update and go directly to running commands. We may not be able to easily skip the update but we may be able to reverse it prior to running commands.
If I can help to test something, let me know.
We see this half working in runatlantis/atlantis. It updates almost every single go-github major version except for one import in a single file.
File to manually update: https://github.com/runatlantis/atlantis/blob/main/server/events/vcs/testdata/fixtures.go
Original renovate PR that updates all but one file https://github.com/runatlantis/atlantis/pull/3495
Subsequent PR to manually update the file https://github.com/runatlantis/atlantis/pull/3498
Upgrading major versions should be left to maitainers.
Or if you are insisting to do it, do it right:
go mod
command (ex: go mod edit -require=module@version && go mod tidy
)go mod tidy
to check that the upgrade did happen (cucumber/gherkin#120 is an example of such failure)Here is an example of how it goes wrong (cucumber/gherkin#120) and my manual upgrade (cucumber/gherkin#133).
Supporting major updates of Go was a requested feature, and appreciated by many, so we won't be removing it. It's quite simple to disable major updates for the go manager for those who don't want.
@rarkins Should I open separate issues for the things I reported above in https://github.com/renovatebot/renovate/issues/21010#issuecomment-1634377616 ? Do you have suggestions on how to split them?
@dolmen I do see a significant overlap between the items you reported and the original issue. I don't think badgering rarkins will get you much.
I do see the issue is labeled as help wanted. Perhaps you can create a fix that does major upgrades correctly.
@dolmen please start your own Discussion in this repo putting together all of your suggestions for major upgrades, then we can decide how many separate issues to divide them into. Thanks!
What would you like Renovate to be able to do?
Update major versions in projects that have Go vendoring enabled.
Eg.
github.com/google/go-github/v48
togithub.com/google/go-github/v50
Reproduction repository: https://gitlab.com/hugoboos/renovate-go-update-import
Related discussion: https://github.com/renovatebot/renovate/discussions/20996
If you have any ideas on how this should be implemented, please tell us here.
At the moment Renovate updates
go.mod
. This should be done by themod
tool. This tool is already being used by Renovate. Only the order should be changed.mod
to change the import pathsgo mod tidy
, this will updatego.mod
. Possible that version is different from that Renovate selected.go.mod
for the updated package.go mod tidy
go mod vendor
Is this a feature you are interested in implementing yourself?
No