-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(mix): Support private hex repos/registries #29775
feat(mix): Support private hex repos/registries #29775
Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Michael Kriese <[email protected]>
Co-authored-by: Michael Kriese <[email protected]>
36e3f93
to
6c293a1
Compare
Feedback should be addressed 👍🏻 |
registryAliases: { | ||
oban: 'https://getoban.pro/repo', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be scoped to mix
manager, otherwise it will interferre with other managers using registry aliases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there needs to be a further nesting of the object? I didn't see any examples of that in other managers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryannaegele are you still working on this?
I have the same/very similar use case and I'd love renovate to support elixir correctly.
this particular change can be observed here https://github.com/renovatebot/renovate/blob/main/docs/usage/configuration-options.md#registryaliases
IMO this is what viceice is asking about.
registryAliases: { | |
oban: 'https://getoban.pro/repo', | |
}, | |
{ | |
"mix": { | |
registryAliases: { | |
oban: 'https://getoban.pro/repo', | |
}, | |
} | |
} |
registryAliases: { | ||
hexpm: 'https://hex.pm', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the URL for the hexpm registry, which is the default, so we put it into the default config. This is merged with anything the user has supplied, giving us a complete lookup of the URLs. This has an added benefit that if a company wished to host an internal proxy registry, no updates are needed to their mix files; they have a way to point someplace else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not add a default url, the datasource has it already, so only set registry url if it's not the default
if (requirement?.startsWith('==')) { | ||
dep.currentVersion = requirement.replace(regEx(/^==\s*/), ''); | ||
} | ||
|
||
if (organization) { | ||
dep.packageName = `org:${organization}:${app}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is used by the hex datasource, so needs changes there too
const [hexPackageName, organizationName] = packageName.split(':'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is in the other PR. You requested to split them so neither PR will work on its own
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then don't change package name in this PR, do the package name change in a separate refactor PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So neither PR is backwards compatible with the other. They are both dependent on the format change. If we don't change this here then your proposed refactor PR just pushes the change both need to make into a single PR that touches the datasource and manager.
Co-authored-by: Michael Kriese <[email protected]>
Co-authored-by: Michael Kriese <[email protected]>
this MR is closed, what s the plan? is there a solution merged? what s the end result? |
The original author was not able to continue the work. You are welcome to pick it up where he left off and submit a new PR |
Changes
This adds support to the mix manager to add private hex repos/registries via
registryAliases
for mapping andhostRules
for authentication.Context
This is the companion to #29756 and dependent on that change. Splitting the manager and datasource work per request in #29756. When combined, this will enable support for private repos/registries such as oban pro.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
Tested in combination with #29756. This will not fully work without that code.