When autopatching a mix.exs file. the below case statement can fail if the Hex repo used does not contain the version of the package being checked.
|
case hex_repo:get_package(Config, atom_to_binary(Name)) of |
|
{ok, {200, _RespHeaders, Package}} -> |
|
#{releases := List} = Package, |
|
{value, #{version := Version}} = lists:search(fun(#{version := Vsn}) -> |
|
M = list_to_atom("Elixir.Version"), |
|
F = list_to_atom("match?"), |
|
M:F(Vsn, Req) |
|
end, List), |
|
{ok, Version}; |
|
{ok, {Status, _, Errors}} -> |
|
{error, Status, Errors} |
|
end |
This can happen in an environment where access to hex.lb.local is restricted and dependencies are being pulled from git instead.
This results in {error,unverified} being returned by hex_repo:get_package/2
This should likely be handled as an actual failure but can be a valid expectation like the situation above
Could it be worth checking the fetch method of the dependency and ignoring the error if it's not from hex?
When autopatching a mix.exs file. the below case statement can fail if the Hex repo used does not contain the version of the package being checked.
erlang.mk/core/elixir.mk
Lines 37 to 48 in 973ccc3
This can happen in an environment where access to
hex.lb.localis restricted and dependencies are being pulled from git instead.This results in
{error,unverified}being returned byhex_repo:get_package/2This should likely be handled as an actual failure but can be a valid expectation like the situation above
Could it be worth checking the fetch method of the dependency and ignoring the error if it's not from hex?