Mix manager should set git versioning git dependencies #31778
Replies: 4 comments 34 replies
-
Hi there, Get your discussion fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. Discussions without reproductions are less likely to be converted to Issues. Please follow these steps:
If you need help with running renovate on your minimal reproduction repository, please refer to our Running Renovate guide. The Renovate team |
Beta Was this translation helpful? Give feedback.
-
@rarkins please lemme know if there is something else I am missing. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
Is there a |
Beta Was this translation helpful? Give feedback.
-
What would you like help with?
I think I found a bug
How are you running Renovate?
Self-hosted
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
Gituhb 38.101.1
Please tell us more about your question or problem
This is a follow-up on Bad Tag name for git dependencies in Elixir project.
Problem
It looks like the
mix
manager handles git dependencies incorrectly and when"datasource": "git-tags", "versioning": "hex"
renovate runs the hex versioning and reaches this linerenovate/lib/modules/versioning/hex/index.ts
Line 104 in 8b2d1fa
As far as I understand mix does not support version ranges for git dependencies. And it looks like the
extract.ts
implementation is completely wrong.Eg.
ref:
can be a tag, branch or digest. But the current implementation treats it as digest and replaces tag with SHA which is probably not the desired solution.It produces an invalid newVersion from
v.0.1
->== v0.2
which fails to download the tag (because it does not exist) andmix deps.update
fails.Fix proposal
I think the fix can follow the logic of the existing Poetry manager, where it sets versioning to
semver
in case the dependency is a type ofsemver
renovate/lib/modules/manager/poetry/schema.ts
Lines 133 to 135 in 8b2d1fa
Here are the use cases the mix manager should cover
After doing more tests, it turns out the
mix.exs
file changes in an unexpected way, and for some reasonmix.lock
is not changed at allhttps://github.com/jans-forks/renovate-reporoduction-31778/pull/3/files
I've made some modifications to the code and achieved this.
https://github.com/jans-forks/renovate-playground/compare/main..e5f0dce01dd3b321dd3d2e46c7bf09605cead7ed
I am still not sure about the desired behaviour for
branch
where renovate has changedref: branch-name
->ref: SHA1
, but I think this should only happen in a lock file not themix.exs
.Besides the logic fix, I propose to update the docs page https://docs.renovatebot.com/modules/manager/mix/
To mention that git dependencies may require manager process may require extra git credentials. Which I achieved with customenvvariables.
Reproduction repo
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions