Closed kubaodias closed 5 years ago
The proper fix would be for rebar3_hex to use a different config file than mix since there are no guarantees that either will follow the other's format.
I agree however current implementation works only because of the default settings. Another question is: should 'api_url' point to {HEX_PM_URL} or to actual API endpoint {HEX_PM_URL}/api ?
Since api_url
is set when using other endpoints than hex.pm we need to consider that they may have a different URL structure and should not assume not /api.
Only /api is used when using the hex.pm API, but this option is for when not using hex.pm so we should be flexible.
It is the other way around, rebar3_hex is using ~/.hex/hex.config.
It is not currently. That's what we should fix.
Do you have any proposition how it should be fixed to use 'mix' and 'rebar3 hex' concurrently? rebar3_hex plugin uses most of variables from ~/.hex/hex.config (api_url,cdn_url,key,username) so I maybe it's a good idea for rebar3 to use the same config as mix. To sum up: if mix uses api_url with [...]/api suffix and it is sufficient enough I don't know why you want 'rebar3 hex' keep possibility to use other paths.
Do you have any proposition how it should be fixed to use 'mix' and 'rebar3 hex' concurrently?
Yes, I think rebar3_hex should use a different config file. But it's up to the maintainers of rebar3_hex.
rebar3_hex plugin uses most of variables from ~/.hex/hex.config (api_url,cdn_url,key,username) so I maybe it's a good idea for rebar3 to use the same config as mix.
It's not a good idea that two separate applications with no shared development use the same config. It makes it much harder to make changes to the config when you have worry about breaking another application you have no control over. The fact that we the issue with api url is proof of this. Should mix change or rebar make the change to their config?
To sum up: if mix uses api_url with [...]/api suffix and it is sufficient enough I don't know why you want 'rebar3 hex' keep possibility to use other paths.
I'm not sure what this means? Mix uses no suffix, we directly use the URL that the user has configured with appending anything to it.
Yea, we should probably use a different config. The thinking was that sharing one would mean a user would only have to login once to hex and it be good for both tools, as well as being able to define proxies and additional repos in only one place.
As for separate development and hex devs having no control over it, happy to let you have control of the plugin ;)
Or maybe with hex_erl
at least that would be in control of hexpm team and we'd just depend on it? So I would take care of just the rebar3 plugin portion.
Only issue may be we have different plans for how multi-repo will work. But I'm not sure that would actually be an issue for this but instead be just differences in how rebar3 handles resolving from repos internally (separate from rebar3_hex) and everything for this plugin would be the same between mix/rebar3_hex.
(...) would mean a user would only have to login once to hex and it be good for both tools (...)
Or maybe with hex_erl at least that would be in control of hexpm
Yes, I think that's a good idea, I can look into that.
Only issue may be we have different plans for how multi-repo will work.
@tsloughter I haven't been following development closely, are the plans written anywhere?
Closing this as it is outdated now that we use hex_core.
When I use mix and rebar3 to connect with hex API they have inconsistent naming of api_url configuration setting. Default rebar3's api_url points to https://hex.pm while mix points to https://hex.pm/api
Request with 'rebar3 hex' fails with HTTP 404 Not Found
Changing api_url to URL without /api works ok
However such setting of api_url is not correct for mix.