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

Custom package name for Hex dependency #32972

Closed
rarkins opened this issue Dec 8, 2024 Discussed in #32834 · 10 comments · Fixed by #32984
Closed

Custom package name for Hex dependency #32972

rarkins opened this issue Dec 8, 2024 Discussed in #32834 · 10 comments · Fixed by #32984
Labels
manager:mix Mix package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Dec 8, 2024

Discussed in #32834

Originally posted by bernardo-martinez December 1, 2024

Tell us more.

What would you like Renovate to be able to do?

In Mix in elixir you can setup a dependency with a different name than the default one fetched from hex.pm, see: https://hex.pm/docs/usage#options

For example:

{:gun, "~> 2.0.0", hex: :grpc_gun},

This will fetch the grpc_gun dependency from hex.pm located here: https://hex.pm/packages/grpc_gun but will treat it locally as gun

If you have any ideas on how this should be implemented, please tell us here.

I think the mix manager should have an additional regex to search for such hex: option and use it to set PackageDependency.sourceUrl accordingly, which then would be used in the hex versioning?

Is this a feature you are interested in implementing yourself?
Yes, just need some discussion and guidance first

Reproduction: renovate-reproductions/32834#1

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:mix Mix package manager labels Dec 8, 2024
@bernardo-martinez
Copy link
Contributor

@rarkins what do you think of the approach proposed?

I am also thinking if instead the extract.ts module should set packageName to the hex package name here (if hex: option is set)

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 8, 2024

SourceUrl is incorrect. PackageName is correct

@bernardo-martinez
Copy link
Contributor

but datasource fetches release based on packageName

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 8, 2024

Yes, exactly. If you set both depName and packageName then packageName will be used for the datasource lookup

@bernardo-martinez
Copy link
Contributor

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 9, 2024

Does it work end to end? Can you share a public repo demonstrating it?

@bernardo-martinez
Copy link
Contributor

dunno exactly the best way to demonstrate it, but using the reproduction repo I:

  1. Ran locally renovatebot within main, it resulted in this PR: test 3 bernardo-martinez/renovate-reproduction-32834#4 and this debug log
  2. Checked out this branch and ran again, which resulted in closing the PR and the debug log I shared in the comments

how do you see it?

@rarkins
Copy link
Collaborator Author

rarkins commented Dec 9, 2024

Please also find an example where it success upgrades an alias like this, eg. from 2.0.0 to 2.0.1

@bernardo-martinez
Copy link
Contributor

ok i think this new PR summarises the thing nicely:
bernardo-martinez/renovate-reproduction-32834#5

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 39.61.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:mix Mix package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants