renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.59k stars 2.32k forks source link

Go module major version update PR doesn't actually update version #11901

Closed at-wat closed 3 years ago

at-wat commented 3 years ago

How are you running Renovate?

WhiteSource Renovate hosted app on github.com

Please select which platform you are using if self-hosting.

No response

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

Describe the bug

PR Update module github.com/google/go-github/v38 to v39 doesn't actually update module version to v39. I'm not very sure other modules cause same problem, but I observed the problem on go-github at several public and private repositories.

Major version update PR of go-github worked at least until August 11 with same config. (v37 to v38) https://github.com/at-wat/gh-pr-comment/pull/148

Minimal reproductions below use single-line require but same problem happens on the repo using multi-line require as well. (https://github.com/at-wat/gh-pr-comment/pull/153/files#r712618249) And, it looks independent from Go version (tried 1.14, 1.16 and 1.17) specified in go.mod.

According to the attached logs:

I'm suspecting that go mod tidy step is reverting the version since the major version in the import paths on the source code is pointing the old version like:

import "github.com/google/go-github/v38/github"

Minimal reproductions:

Relevant debug logs

Logs #### Go mod version 1.16 ([renovate log](https://app.renovatebot.com/dashboard#github/at-wat/renovate-repro-go-github-major-1.16/466768385)) ``` DEBUG: packageFiles with updates { "config": { "gomod": [ { "packageFile": "go.mod", "constraints": { "go": "^1.16" }, "deps": [ { "managerData": { "lineNumber": 4 }, "depName": "github.com/google/go-github/v38", "depType": "require", "currentValue": "v38.1.0", "datasource": "go", "depIndex": 0, "updates": [ { "bucket": "major", "newVersion": "v39.1.0", "newValue": "v39.1.0", "releaseTimestamp": "2021-09-23T16:43:50.000Z", "newMajor": 39, "newMinor": 1, "updateType": "major", "branchName": "renovate/github.com-google-go-github-v38-39.x" } ], "warnings": [], "versioning": "semver", "sourceUrl": "https://github.com/google/go-github", "currentVersion": "v38.1.0", "isSingleVersion": true, "fixedVersion": "v38.1.0" } ] } ] } } DEBUG: processRepo() DEBUG: Processing 1 branch: renovate/github.com-google-go-github-v38-39.x DEBUG: Calculating hourly PRs remaining DEBUG: Retrieving PR list DEBUG: Retrieved 1 Pull Requests DEBUG: currentHourStart=2021-09-27T01:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating prConcurrentLimit (20) DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed) DEBUG: 0 PRs are currently open DEBUG: PR concurrent limit remaining: 20 DEBUG: Calculated maximum PRs remaining this run { "prsRemaining": 2 } DEBUG: PullRequests limit = 2 DEBUG: Calculating hourly PRs remaining DEBUG: currentHourStart=2021-09-27T01:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating branchConcurrentLimit (20) DEBUG: 0 already existing branches found: DEBUG: Branch concurrent limit remaining: 20 DEBUG: Calculated maximum branches remaining this run { "branchesRemaining": 2 } DEBUG: Branches limit = 2 DEBUG: Setting current branch to master(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: latest commit(branch="renovate/github.com-google-go-github-v38-39.x") { "branchName": "master", "latestCommitDate": "2021-09-27T10:21:47+09:00" } DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: branchExists=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: dependencyDashboardCheck=undefined(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: recreateClosed is false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, Update module github.com/google/go-github/v38 to v39, !open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: prAlreadyExisted=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Checking schedule(at any time, null)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: No schedule defined(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Branch needs creating(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Using reuseExistingBranch: false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod.updateDependency: v39.1.0(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod: major update(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "github.com/google/go-github/v38" } DEBUG: Updating github.com/google/go-github/v38 in go.mod(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod.updateArtifacts(go.mod)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: go get command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "get -d ./..." } DEBUG: go mod tidy command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "mod tidy" } DEBUG: additional go mod tidy command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "mod tidy" } DEBUG: Using docker to execute(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found version constraint - checking for a compatible image to use(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "docker.io/renovate/go", "scheme": "npm", "constraint": "^1.16" } DEBUG: getLabels(https://index.docker.io, renovate/go, latest)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found compatible image version(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "docker.io/renovate/go", "scheme": "npm", "constraint": "^1.16", "version": "1.17.1" } DEBUG: Resolved tag constraint(branch="renovate/github.com-google-go-github-v38-39.x") { "image": "docker.io/renovate/go", "tagConstraint": "^1.16", "tagVersioning": "npm", "tag": "1.17.1" } DEBUG: Docker image is already prefetched: docker.io/renovate/go:1.17.1(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Executing command(branch="renovate/github.com-google-go-github-v38-39.x") { "command": [ "docker run --rm --name=renovate_go --label=renovate_child -v \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\":\"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GOPATH -e GOFLAGS -e CGO_ENABLED -w \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\" docker.io/renovate/go:1.17.1 bash -l -c \"git config --global url.\\\"https://**redacted**@github.com/\\\".insteadOf \\\"https://github.com/\\\" && go get -d ./... && go mod tidy && go mod tidy\"" ] } DEBUG: exec completed(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\":\"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GOPATH -e GOFLAGS -e CGO_ENABLED -w \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.16\" docker.io/renovate/go:1.17.1 bash -l -c \"git config --global url.\\\"https://**redacted**@github.com/\\\".insteadOf \\\"https://github.com/\\\" && go get -d ./... && go mod tidy && go mod tidy\"", "durationMs": 4295, "stdout": "", "stderr": "go: downloading github.com/google/go-github/v38 v38.1.0\ngo: downloading github.com/google/go-github v17.0.0+incompatible\ngo: downloading github.com/google/go-querystring v1.1.0\ngo: downloading golang.org/x/crypto v0.0.0-20210817164053-32db794688a5\ngo get: added github.com/google/go-github/v38 v38.1.0\ngo: downloading github.com/google/go-cmp v0.5.6\n" } DEBUG: Returning updated go.sum(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found updated go.mod after go.sum update(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Updated 1 package files(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Updated 2 lock files(branch="renovate/github.com-google-go-github-v38-39.x") { "updatedArtifacts": [ "go.sum", "go.mod" ] } DEBUG: 2 file(s) to commit(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Committing files to branch renovate/github.com-google-go-github-v38-39.x(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Setting git author name(branch="renovate/github.com-google-go-github-v38-39.x") { "gitAuthorName": "Renovate Bot" } DEBUG: Setting git author email(branch="renovate/github.com-google-go-github-v38-39.x") { "gitAuthorEmail": "bot@renovateapp.com" } DEBUG: git commit(branch="renovate/github.com-google-go-github-v38-39.x") { "deletedFiles": [], "ignoredFiles": [], "result": { "author": null, "branch": "renovate/github.com-google-go-github-v38-39.x", "commit": "4b71cff", "root": false, "summary": { "changes": 2, "insertions": 16, "deletions": 0 } } } DEBUG: git push(branch="renovate/github.com-google-go-github-v38-39.x") { "result": { "pushed": [ { "deleted": false, "tag": false, "branch": true, "new": true, "alreadyUpdated": false, "local": "refs/heads/renovate/github.com-google-go-github-v38-39.x", "remote": "refs/heads/renovate/github.com-google-go-github-v38-39.x" } ], "branch": { "local": "renovate/github.com-google-go-github-v38-39.x", "remote": "renovate/github.com-google-go-github-v38-39.x", "remoteName": "origin" }, "ref": { "local": "refs/remotes/origin/renovate/github.com-google-go-github-v38-39.x" }, "remoteMessages": { "all": [ "Create a pull request for 'renovate/github.com-google-go-github-v38-39.x' on GitHub by visiting:", "https://github.com/at-wat/renovate-repro-go-github-major-1.16/pull/new/renovate/github.com-google-go-github-v38-39.x" ], "pullRequestUrl": "https://github.com/at-wat/renovate-repro-go-github-major-1.16/pull/new/renovate/github.com-google-go-github-v38-39.x" } } } INFO: Branch created(branch="renovate/github.com-google-go-github-v38-39.x") { "commitSha": "4b71cff" } DEBUG: Ensuring PR(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: There are 0 errors and 0 warnings(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Creating PR(branch="renovate/github.com-google-go-github-v38-39.x") { "prTitle": "Update module github.com/google/go-github/v38 to v39" } DEBUG: Creating PR(branch="renovate/github.com-google-go-github-v38-39.x") { "title": "Update module github.com/google/go-github/v38 to v39", "head": "at-wat:renovate/github.com-google-go-github-v38-39.x", "base": "master", "draft": false } DEBUG: PR created(branch="renovate/github.com-google-go-github-v38-39.x") { "pr": 2, "draft": false } DEBUG: Adding labels '' to #2(branch="renovate/github.com-google-go-github-v38-39.x") INFO: PR created(branch="renovate/github.com-google-go-github-v38-39.x") { "pr": 2, "prTitle": "Update module github.com/google/go-github/v38 to v39" } DEBUG: Created Pull Request #2(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: PR is not configured for automerge(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open) DEBUG: Found PR #2 DEBUG: Returning from graphql open PR list DEBUG: Ensuring Dependency Dashboard DEBUG: ensureIssue(Dependency Dashboard) INFO: Issue created DEBUG: Removing any stale branches DEBUG: config.repoIsOnboarded=true DEBUG: Branch lists { "branchList": [ "renovate/github.com-google-go-github-v38-39.x" ], "renovateBranches": [ "renovate/github.com-google-go-github-v38-39.x" ] } ``` #### Go mod version 1.17 ([renovate log](https://app.renovatebot.com/dashboard#github/at-wat/renovate-repro-go-github-major-1.17/466768345)) ``` DEBUG: packageFiles with updates { "config": { "gomod": [ { "packageFile": "go.mod", "constraints": { "go": "^1.17" }, "deps": [ { "managerData": { "lineNumber": 4 }, "depName": "github.com/google/go-github/v38", "depType": "require", "currentValue": "v38.1.0", "datasource": "go", "depIndex": 0, "updates": [ { "bucket": "major", "newVersion": "v39.1.0", "newValue": "v39.1.0", "releaseTimestamp": "2021-09-23T16:43:50.000Z", "newMajor": 39, "newMinor": 1, "updateType": "major", "branchName": "renovate/github.com-google-go-github-v38-39.x" } ], "warnings": [], "versioning": "semver", "sourceUrl": "https://github.com/google/go-github", "currentVersion": "v38.1.0", "isSingleVersion": true, "fixedVersion": "v38.1.0" } ] } ] } } DEBUG: processRepo() DEBUG: Processing 1 branch: renovate/github.com-google-go-github-v38-39.x DEBUG: Calculating hourly PRs remaining DEBUG: Retrieving PR list DEBUG: Retrieved 1 Pull Requests DEBUG: currentHourStart=2021-09-27T02:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating prConcurrentLimit (20) DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed) DEBUG: 0 PRs are currently open DEBUG: PR concurrent limit remaining: 20 DEBUG: Calculated maximum PRs remaining this run { "prsRemaining": 2 } DEBUG: PullRequests limit = 2 DEBUG: Calculating hourly PRs remaining DEBUG: currentHourStart=2021-09-27T02:00:00.000+00:00 DEBUG: PR hourly limit remaining: 2 DEBUG: Calculating branchConcurrentLimit (20) DEBUG: 0 already existing branches found: DEBUG: Branch concurrent limit remaining: 20 DEBUG: Calculated maximum branches remaining this run { "branchesRemaining": 2 } DEBUG: Branches limit = 2 DEBUG: Setting current branch to master(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: latest commit(branch="renovate/github.com-google-go-github-v38-39.x") { "branchName": "master", "latestCommitDate": "2021-09-27T10:19:01+09:00" } DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: branchExists=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: dependencyDashboardCheck=undefined(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: recreateClosed is false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, Update module github.com/google/go-github/v38 to v39, !open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: prAlreadyExisted=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Checking schedule(at any time, null)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: No schedule defined(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Branch needs creating(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Using reuseExistingBranch: false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: manager.getUpdatedPackageFiles() reuseExistinbranch=false(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod.updateDependency: v39.1.0(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod: major update(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "github.com/google/go-github/v38" } DEBUG: Updating github.com/google/go-github/v38 in go.mod(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: gomod.updateArtifacts(go.mod)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: go get command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "get -d ./..." } DEBUG: go mod tidy command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "mod tidy" } DEBUG: additional go mod tidy command included(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "go", "args": "mod tidy" } DEBUG: Using docker to execute(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found version constraint - checking for a compatible image to use(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "docker.io/renovate/go", "scheme": "npm", "constraint": "^1.17" } DEBUG: getLabels(https://index.docker.io, renovate/go, latest)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found compatible image version(branch="renovate/github.com-google-go-github-v38-39.x") { "depName": "docker.io/renovate/go", "scheme": "npm", "constraint": "^1.17", "version": "1.17.1" } DEBUG: Resolved tag constraint(branch="renovate/github.com-google-go-github-v38-39.x") { "image": "docker.io/renovate/go", "tagConstraint": "^1.17", "tagVersioning": "npm", "tag": "1.17.1" } DEBUG: Fetching Docker image: docker.io/renovate/go:1.17.1(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Finished fetching Docker image(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Executing command(branch="renovate/github.com-google-go-github-v38-39.x") { "command": [ "docker run --rm --name=renovate_go --label=renovate_child -v \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\":\"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GOPATH -e GOFLAGS -e CGO_ENABLED -w \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\" docker.io/renovate/go:1.17.1 bash -l -c \"git config --global url.\\\"https://**redacted**@github.com/\\\".insteadOf \\\"https://github.com/\\\" && go get -d ./... && go mod tidy && go mod tidy\"" ] } DEBUG: exec completed(branch="renovate/github.com-google-go-github-v38-39.x") { "cmd": "docker run --rm --name=renovate_go --label=renovate_child -v \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\":\"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e GOPATH -e GOFLAGS -e CGO_ENABLED -w \"/mnt/renovate/gh/at-wat/renovate-repro-go-github-major-1.17\" docker.io/renovate/go:1.17.1 bash -l -c \"git config --global url.\\\"https://**redacted**@github.com/\\\".insteadOf \\\"https://github.com/\\\" && go get -d ./... && go mod tidy && go mod tidy\"", "durationMs": 8438, "stdout": "", "stderr": "go: downloading github.com/google/go-github/v38 v38.1.0\ngo: downloading github.com/google/go-github v17.0.0+incompatible\ngo: downloading github.com/google/go-querystring v1.1.0\ngo: downloading golang.org/x/crypto v0.0.0-20210817164053-32db794688a5\ngo get: added github.com/google/go-github/v38 v38.1.0\ngo get: upgraded github.com/google/go-querystring v1.0.0 => v1.1.0\ngo get: upgraded golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 => v0.0.0-20210817164053-32db794688a5\ngo: downloading github.com/google/go-cmp v0.5.6\n" } DEBUG: Returning updated go.sum(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Found updated go.mod after go.sum update(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Updated 1 package files(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Updated 2 lock files(branch="renovate/github.com-google-go-github-v38-39.x") { "updatedArtifacts": [ "go.sum", "go.mod" ] } DEBUG: 2 file(s) to commit(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Committing files to branch renovate/github.com-google-go-github-v38-39.x(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Setting git author name(branch="renovate/github.com-google-go-github-v38-39.x") { "gitAuthorName": "Renovate Bot" } DEBUG: Setting git author email(branch="renovate/github.com-google-go-github-v38-39.x") { "gitAuthorEmail": "bot@renovateapp.com" } DEBUG: git commit(branch="renovate/github.com-google-go-github-v38-39.x") { "deletedFiles": [], "ignoredFiles": [], "result": { "author": null, "branch": "renovate/github.com-google-go-github-v38-39.x", "commit": "4435deb", "root": false, "summary": { "changes": 2, "insertions": 13, "deletions": 0 } } } DEBUG: git push(branch="renovate/github.com-google-go-github-v38-39.x") { "result": { "pushed": [ { "deleted": false, "tag": false, "branch": true, "new": true, "alreadyUpdated": false, "local": "refs/heads/renovate/github.com-google-go-github-v38-39.x", "remote": "refs/heads/renovate/github.com-google-go-github-v38-39.x" } ], "branch": { "local": "renovate/github.com-google-go-github-v38-39.x", "remote": "renovate/github.com-google-go-github-v38-39.x", "remoteName": "origin" }, "ref": { "local": "refs/remotes/origin/renovate/github.com-google-go-github-v38-39.x" }, "remoteMessages": { "all": [ "Create a pull request for 'renovate/github.com-google-go-github-v38-39.x' on GitHub by visiting:", "https://github.com/at-wat/renovate-repro-go-github-major-1.17/pull/new/renovate/github.com-google-go-github-v38-39.x" ], "pullRequestUrl": "https://github.com/at-wat/renovate-repro-go-github-major-1.17/pull/new/renovate/github.com-google-go-github-v38-39.x" } } } INFO: Branch created(branch="renovate/github.com-google-go-github-v38-39.x") { "commitSha": "4435deb" } DEBUG: Ensuring PR(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: There are 0 errors and 0 warnings(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, closed)(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: Creating PR(branch="renovate/github.com-google-go-github-v38-39.x") { "prTitle": "Update module github.com/google/go-github/v38 to v39" } DEBUG: Creating PR(branch="renovate/github.com-google-go-github-v38-39.x") { "title": "Update module github.com/google/go-github/v38 to v39", "head": "at-wat:renovate/github.com-google-go-github-v38-39.x", "base": "master", "draft": false } DEBUG: PR created(branch="renovate/github.com-google-go-github-v38-39.x") { "pr": 2, "draft": false } DEBUG: Adding labels '' to #2(branch="renovate/github.com-google-go-github-v38-39.x") INFO: PR created(branch="renovate/github.com-google-go-github-v38-39.x") { "pr": 2, "prTitle": "Update module github.com/google/go-github/v38 to v39" } DEBUG: Created Pull Request #2(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: PR is not configured for automerge(branch="renovate/github.com-google-go-github-v38-39.x") DEBUG: getBranchPr(renovate/github.com-google-go-github-v38-39.x) DEBUG: findPr(renovate/github.com-google-go-github-v38-39.x, undefined, open) DEBUG: Found PR #2 DEBUG: Returning from graphql open PR list DEBUG: Ensuring Dependency Dashboard DEBUG: ensureIssue(Dependency Dashboard) INFO: Issue created DEBUG: Removing any stale branches DEBUG: config.repoIsOnboarded=true DEBUG: Branch lists { "branchList": [ "renovate/github.com-google-go-github-v38-39.x" ], "renovateBranches": [ "renovate/github.com-google-go-github-v38-39.x" ] } ```

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction repository in the bug description

rarkins commented 3 years ago

I think go 1.17.1 is being run both times?

at-wat commented 3 years ago

I think go 1.17.1 is being run both times?

I mean go version written in go.mod file. Since Go 1.17, go mod command runs in compatibility mode if old version is specified in go.mod. details: https://golang.org/doc/go1.17#go-command

Go running on renovate seems be 1.17.1.

t-kulmburg commented 3 years ago

We have a similar problem running renovate/renovate:27.19.2@sha256:.. Seems like updates where the import URL has to be changed are not working, as other updates work with no problems.

rarkins commented 3 years ago

I think go 1.17.1 is being run both times?

I mean go version written in go.mod file. Since Go 1.17, go mod command runs in compatibility mode if old version is specified in go.mod. details: golang.org/doc/go1.17#go-command

Go running on renovate seems be 1.17.1.

That's a nice feature from go, although I suppose we'll need to trust that it's working! So just to be clear:

github-actions[bot] commented 3 years ago

Hi there,

Help us by making a minimal reproduction repository.

Before we can start work on your issue we first need to know exactly what's causing the current behavior. A minimal reproduction helps us with this.

To get started, please read our guide on creating a minimal reproduction to understand what is needed.

We may close the issue if you (or someone else) have not provided a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment.

Good luck,

The Renovate team

rarkins commented 3 years ago

Sorry, I took at look at the example repository and it's not minimal enough to be easily debuggable, so I reverted the label. Can you reproduce this in an example repo when there's only one dependency?

at-wat commented 3 years ago

@rarkins I don't get what do you mean. Reproduction repos https://github.com/at-wat/renovate-repro-go-github-major-1.16 and https://github.com/at-wat/renovate-repro-go-github-major-1.17 has exactly one dependency (go-github). Packages listed in go.sum are dependencies from go-github.

rarkins commented 3 years ago

Sorry, I missed that one just now!

rarkins commented 3 years ago

So the next step will be to walk through this at debug level and see which commands remove the change (e.g. go mod tidy) and then try to work out why. We use github.com/marwan-at-work/mod/cmd/mod@latest for helping with major updates BTW

at-wat commented 3 years ago

Oh, I didn't noticed that there is gomodUpdateImportPaths option. I used to update Go module import path on Renovate PR by using https://github.com/at-wat/go-sum-fix-action GitHub Action which assumes that Renovate update only go.mod on major update.

I'm guessing that gomodTidy option had been ignored if the update is major . (I'm not very sure since the old succeeded log seems been expired.) For example, this commit was go-github's major update PR made by Renovate on August 12: https://github.com/at-wat/gh-pr-comment/commit/7ac9ca13efcbb5bc981d81dbec4c6695a4308e1a Even I have enabled gomodTidy https://github.com/at-wat/gh-pr-comment/blob/bec9e664e07bbdf7b73ae7195d88621850d6939b/renovate.json#L5-L7, go mod tidy seems be skipped.

After I looked around https://github.com/renovatebot/renovate/pull/9144/files, my guess about the problem is: (two different problems)

1. when no postUpdateOptions is specified (problem happening on minimal reproduction repos)

Due to this condition https://github.com/renovatebot/renovate/blob/624fad0ac7dc59c36b71f336bdcfc909000cd0e6/lib/manager/gomod/artifacts.ts#L158-L160 go mod tidy is forcefully executed even if gomodUpdateImportPaths is not specified. In this case it's ordinal behavior of go mod tidy to remove these major updates from go.mod.

isGoModTidyRequired should be false if gomodUpdateImportPaths is not specified.

reproduction: https://github.com/at-wat/renovate-repro-go-github-major-1.16 and https://github.com/at-wat/renovate-repro-go-github-major-1.17

2. when gomodTidy is specified in postUpdateOptions but gomodUpdateImportPaths is not (problem in https://github.com/at-wat/gh-pr-comment/pull/148)

go mod tidy which had been skipped on major update is now executed for some reason.

I made another reproduction repo for this case: https://github.com/at-wat/renovate-repro-go-github-major-with-gomodTidy

at-wat commented 3 years ago

I'm digging into the code and might create a fix PR.

at-wat commented 3 years ago

Created a PR to fix this issue.

renovate-release commented 3 years ago

:tada: This issue has been resolved in version 28.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: