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

Wrong URL path when upgrade Golang dependencies #8525

Closed
sluongng opened this issue Feb 3, 2021 · 2 comments · Fixed by #8946
Closed

Wrong URL path when upgrade Golang dependencies #8525

sluongng opened this issue Feb 3, 2021 · 2 comments · Fixed by #8946
Labels
manager:gomod Go Modules priority-2-high Bugs impacting wide number of users or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality

Comments

@sluongng
Copy link
Contributor

sluongng commented Feb 3, 2021

This is a follow up for #7121 which was closed as I was overwhelmed by other workload and was unable to provide a reproducible output.

Now that I had sometime to mess with Renovate Bot again, here is the minimal reproduce repo:

As you can see:

         {
           "name": "renovate",
           "level": 50,
           "logContext": "Hxbo_0Eyd",
           "repository": "sluongng/renovate-minimal-reproduce",
           "branch": "renovate/github.com-atlassian-go-artifactory-2.x",
           "dep": "github.com/atlassian/go-artifactory",
           "err": {
             "killed": false,
             "code": 1,
             "signal": null,
             "cmd": "go mod tidy",
             "stdout": "",
             "stderr": "go: github.com/atlassian/go-artifactory/v2/v2@v2.5.0: reading github.com/atlassian/go-artifactory/v2/v2/go.mod at revision v2/v2.5.0: unknown revision v2/v2.5.0\n",
             "message": "Command failed: go mod tidy\ngo: github.com/atlassian/go-artifactory/v2/v2@v2.5.0: reading github.com/atlassian/go-artifactory/v2/v2/go.mod at revision v2/v2.5.0: unknown revision v2/v2.5.0\n",
             "stack": "Error: Command failed: go mod tidy\ngo: github.com/atlassian/go-artifactory/v2/v2@v2.5.0: reading github.com/atlassian/go-artifactory/v2/v2/go.mod at revision v2/v2.5.0: unknown revision v2/v2.5.0\n\n    at ChildProcess.exithandler (child_process.js:308:12)\n    at ChildProcess.emit (events.js:315:20)\n    at ChildProcess.EventEmitter.emit (domain.js:467:12)\n    at maybeClose (internal/child_process.js:1048:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)"
           },
           "msg": "Error updating branch: Command failed: go mod tidy\ngo: github.com/atlassian/go-artifactory/v2/v2@v2.5.0: reading github.com/atlassian/go-artifactory/v2/v2/go.mod at revision v2/v2.5.0: unknown revision v2/v2.5.0\n"
         },

This reading github.com/atlassian/go-artifactory/v2/v2/go.mod is the wrong URL. The correct URL should only has 1 /v2 in it.

@rarkins rarkins added manager:gomod Go Modules priority-2-high Bugs impacting wide number of users or very important features type:bug Bug fix of existing functionality reproduction:provided labels Feb 3, 2021
@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Feb 7, 2021
@sluongng
Copy link
Contributor Author

Have sometime to review it a bit closer today and I think there is some janky logic being wired here

} else if (
upgrade.newMajor > 1 &&
!newLine.includes(`/v${upgrade.newMajor}`)
) {
// If package has no version, pin to latest one.
newLine = newLine.replace(depName, `${depName}/v${upgrade.newMajor}`);
if (/^v(0|1)\./.test(upgrade.currentValue)) {
// Add version
newLine = newLine.replace(
updateLineExp,
`$1/v${upgrade.newMajor}$2$3`
);
} else {
// Replace version
const [oldV] = upgrade.currentValue.split('.');
newLine = newLine.replace(
new RegExp(`/${oldV}(\\s+)`),
`/v${upgrade.newMajor}$1`
);
}

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 24.73.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:gomod Go Modules priority-2-high Bugs impacting wide number of users or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants