Go: unify go.mod and tools.mod#1330
Conversation
renovate seems to struggle to handle multiple *.mod files. Therefore merge tools.mod into go.mod to have a single dependency management file. Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
Can you elaborate a little more on what the issue with renovate is? Dumping all the tool dependencies into our main |
I think, it is acutally the other way around. Having a single go.mod avoids a split brain situation for dependencies. Just see the amount of duplicate entries, that have been in tools.mod, that are no longer tracked twice. As a quick check see the "impact" of this PR, which is currently +1,215 and -1,564 - so we actually reducing lines.
If you look into the past Go dependency upates done by renovate, like #1337, #1332 or #1320, you will notice that I have to step in every time and manually fix the shortcomings of renovte. Renovate does not suceed on running Does the size of go.mod impact resulting executables? No Suggesting to go with two Go modfiles in the first place was a mistake, I'm regreting now. |
The main issue I have in mind with mixing dependencies is that we can't specify different versions of the same dependency in the same
OK so the main problem is that Let me dig a bit more. |
Taking the tool
So - we have the case where tools and our code use the same dependency in different version (including major version changes). |
How did you generate this table? The versions I see in |
I'm looking at .sum, as .sum contains direct and transitive dependencies. Overall, if a tool causes issue, I would question the tool over code in this project and look into replacing the tool. |
Isn't this looking at only the The issue I'm outlining is that if we move all dependencies into a single |
|
Some options:
1 is the easy fix as renovate won't be managing I'm still investigating 2. |
Sounds like a similar solution to the internal package used in https://github.com/elastic/opentelemetry-collector-components/tree/main/internal/tools + we could still use |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
16f0ef3 to
f0ea95f
Compare
|
I have updated the PR and moved tools.[go|mod] into internal/tools/. |
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
|
I can't merge yet as there are conflicts. |
|
Resolved merge conflicts ✅ |
renovate seems to struggle to handle multiple *.mod files. Therefore merge tools.mod into go.mod to have a single dependency management file.
EDIT: We ended up moving
tools.modtointernal/tools/go.modand kept it separate from our maingo.mod.