Repository navigation
Renovate does not handle golang workspace correctly #37653
Unanswered
jankaluza
asked this question in
Request Help
Replies: 1 comment
|
Following is the PR which should fix this issue: #37910 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
A Mend.io-hosted app
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
No response
Please tell us more about your question or problem
Hi,
We are using Renovate in the https://github.com/containers/container-libs repository to keep the go.mod dependencies and the "vendor" directory up to date.
This repository uses https://go.dev/doc/tutorial/workspaces and therefore there is the
go.workfile in the top-level directory. The particulargo.modfiles are in the sub-directories mentioned by thisgo.workfile.Problem description
The issue is that the
gomodRenovate manager expects that thevendordirectory is next to thego.mod. This can be seen in the code here. This is afaik not how go works - if you rungo work vendor, it creates thevendordirectory in the top-level directory above the go modules (next to the go.work file). This leads to Renovate ignoring the changes done to thevendordirectory and pushing only go.mod and go.sum changes. This can be seen in the https://github.com/containers/container-libs/pull/19/files.There is a similar issue with go.work.sum file. Renovate tries to search for it in the
goModDirwhile it afaik always exists next to thego.workfile which does not have to live next to thego.mod.Expected behaviour
Renovate should find out the
vendordirectory even if it's next to the go.work file one level above the go.mod files and include the changes done to this directory bygo work vendorin the PR. Same for go.mod.sum.Proposed solution
The vendorDir should probably be based on the goWorkFile in case it is found in the directory tree. There can be fall-back to the
vendorDirbased on the originalgoModDir.That way would ensure, that the
vendordir next to thego.workis always included in the PR if it exists.Logs (if relevant)
Logs
All reactions