New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gomod): Update source import paths on major upgrade #9144
feat(gomod): Update source import paths on major upgrade #9144
Conversation
Add gomodUpdateImportPaths postUpdateOption to update source code import paths when major updates occur.
A point to discuss from this PR is the interaction & effective requirement for running the An example PR using just You can see both imports exist in the
The ordering implemented in this PR is the only order it can be completed in, |
I have considered whether to run Alternatively, running it implicitly if it's a major update, but then the behavior would be inconsistent between major and non-major updates. We should also consider whether to make this PR's functionality default too, if we are generating incorrect PRs without it anyway. Running |
Having tested the double I personally am not sure why you wouldn't run |
@56KBs let's start by running FYI the main reason for not running tidy all the time was because initially it wasn't part of go modules, and the modules creator thought people shouldn't focus on "cleaning up" their modules definitions too obsessively. So if it was optional for go mod, we kept it as optional for Renovate. But from my point of view, it makes sense to run. |
I've made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I think best to leave it behind a feature flag like
you've done until a few people have validated it in practice. Before approving, can you point to some example PRs where it's working?
Having ran it over some larger examples, it flagged up a bug when going from v0 -> v1 (It shouldn't update any source code) - I've pushed a fix for it and here are some example PRs:
|
🎉 This PR is included in version 24.96.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
Add gomodUpdateImportPaths postUpdateOption to update source code import paths when major updates occur.
Uses marwan-at-work/mod to complete the source code update
Context:
Closes #3348
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: