Replies: 4 comments 2 replies
-
|
the The documentation is probably unclear but the two options are mutually exclusive, and 'replace' needs to be first: rebar3/apps/rebar/src/rebar_hex_repos.erl Lines 82 to 96 in b62659b |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your reply. I have removed {repos, List}, but the issue with Would be also great to get some information about all hex repo map fields and what they are for. Especially how are they related to {'$repos',#{<<"hex-local">> =>
#{auth_key =>
<<"Bearer cmVmd...">>,
public_key =>
<<"-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----\n">>,
url =>
<<"https://somehost/artifactory/api/hex/hex-local">>,
fetch_public_key => nil},
<<"hexpm">> => #{url => <<"https://repo.hex.pm">>}}}.
|
Beta Was this translation helpful? Give feedback.
-
|
Can it be that: rebar3/apps/rebar/src/rebar_hex_repos.erl Lines 142 to 143 in b62659b Maps merge parameters order is incorrect; it appears as if default repo overwrite replacement. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @ferd, rebar3/apps/rebar/src/rebar_hex_repos.erl Lines 133 to 140 in b62659b This function always overrides repo_url — regardless of whether it is already defined or what value it has — with either the default Hex.pm DEFAULT_CDN or the value of the HEX_CDN environment variable. This is problematic when overriding the default Hex.pm repo, since it forces me to also set Wouldn't it be more appropriate to only perform this override if Thanks ! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello team,
Context
~/.config/rebar3/rebar.configand rely on therebar3_hexplugin.Configuration
~/.config/rebar3/rebar.config(sanitized):{plugins, [ %% pulled from an internal mirror {rebar3_hex, {git, "<internal_mirror>", "v7.0.11"}} ]}. {hex, [ {repos, [ #{name => <<"hex-local">>, api_url => <<"https://somehost/artifactory/api/hex/hex-local">>, repo_url => <<"https://somehost/artifactory/hex-local">>, repo_public_key => <<"-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n">>, api_key => <<"Bearer cmVm...">>, repo_key => <<"Bearer cmVm....">> } ]}, {repos, replace, [ #{name => <<"hexpm">>, api_url => <<"https://somehost/artifactory/api/hex/hex-local">>, repo_url => <<"https://somehost/artifactory/hex-local">>, repo_public_key => <<"-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----\n">>, api_key => <<"Bearer cmVm...">>, repo_key => <<"Bearer cmVm....">> } ]} ]}.Reproduction steps
Observed behavior
In the diagnostic output,
api_urlis correctly replaced with the Artifactory endpoint, butrepo_urlremains set tohttps://repo.hex.pm:Expected behavior
api_urlandrepo_urlfor thehexpmrepository should be overridden so that index queries and tarball downloads come from Artifactory.rebar.lockso the entire team resolves consistently.Questions
repo_urloverride supported via{hex, [{repos, replace, [...]}]}? If so, is there a different key that controls the tarball download host?repo_urlat its default (for examplerebar.lock,~/.cache/rebar3/hex, or registry metadata)? What is the proper way to clear or refresh it?~/.hex/hex.configauth_keymap into rebar3 configuration? Areapi_keyandrepo_keythe correct fields for Artifactory, and should the values be inBearer <token>form?hexpm?Environment
Additional notes and attempts
hexpmfrom the repo list and leaving only the local repo still showedrepo_url => https://repo.hex.pmin diagnostics when the repo name ishexpm.~/.cache/rebar3and removingrebar.lockdid not change the behavior.api_urlandrepo_url.Thanks for your help. If this belongs under
rebar3_hexorhex_coreinstead ofrebar3, please let me know and I can refile.Beta Was this translation helpful? Give feedback.
All reactions