Skip to content
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

Merged
merged 9 commits into from
Mar 27, 2021
3 changes: 2 additions & 1 deletion docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,8 @@ If enabled Renovate will pin Docker images by means of their SHA256 digest and n

## postUpdateOptions

- `gomodTidy`: Run `go mod tidy` after Go module updates
- `gomodTidy`: Run `go mod tidy` after Go module updates. This is implicitly enabled for major module updates.
- `gomodUpdateImportPaths`: Update source import paths on major module updates, using [mod](https://github.com/marwan-at-work/mod)
- `npmDedupe`: Run `npm dedupe` after `package-lock.json` updates
- `yarnDedupeFewer`: Run `yarn-deduplicate --strategy fewer` after `yarn.lock` updates
- `yarnDedupeHighest`: Run `yarn-deduplicate --strategy highest` (`yarn dedupe --strategy highest` for Yarn >=2.2.0) after `yarn.lock` updates
Expand Down
4 changes: 3 additions & 1 deletion docs/usage/golang.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ Renovate supports upgrading dependencies in `go.mod` files and their accompanyin
1. Renovate resolves the dependency's source repository and checks for SemVer tags if found. Otherwise commits and `v0.0.0-....` syntax will be used
1. If Renovate finds an update, Renovate will update `go.mod` to the new value
1. Renovate runs `go get` to update the `go.sum` files
1. If the user has enabled the option `gomodTidy` in the [`postUpdateOptions`](https://docs.renovatebot.com/configuration-options/#postupdateoptions) array, then Renovate runs `go mod tidy`, which itself can update `go.mod` and `go.sum`
1. If the user has enabled the option `gomodUpdateImportPaths` in the [`postUpdateOptions`](https://docs.renovatebot.com/configuration-options/#postupdateoptions) array, then Renovate uses [mod](https://github.com/marwan-at-work/mod) to update import paths on major updates, which can update any Go source file
1. If the user has enabled the option `gomodTidy` in the [`postUpdateOptions`](https://docs.renovatebot.com/configuration-options/#postupdateoptions) array, then Renovate runs `go mod tidy`, which itself can update `go.mod` and `go.sum`.
1. This is implicitly enabled for major updates
1. `go mod vendor` is run if vendored modules are detected
1. A PR will be created with `go.mod`,`go.sum`, and any updated vendored files updated in the one commit
1. If the source repository has either a "changelog" file or uses GitHub releases, then Release Notes for each version will be embedded in the generated PR
Expand Down
1 change: 1 addition & 0 deletions lib/config/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,7 @@ const options: RenovateOptions[] = [
type: 'array',
default: [],
allowedValues: [
'gomodUpdateImportPaths',
'gomodTidy',
'npmDedupe',
'yarnDedupeFewer',
Expand Down