Describe the bug
When mix igniter.install ash_postgres is run twice, configure_runtime/3 always keeps adding
if config_env() == :prod do
...
end
to runtime.exs. This bug surfaced after the recent change in Igniter: https://github.com/ash-project/igniter/pull/54; specifically, the PR ensured that Igniter.Code.Function.argument_matches_predicate?/3 never returns :error because it can mistakenly be interpreted as truthy in if calls, which is what happened here.
To Reproduce
Run mix igniter.install ash_postgres twice with the most recent Igniter.
Expected behavior
It only adds it once and not when it is already set.
Additional context
Just tried using a pre-change version of Igniter and adding a dbg() statement to line 60 of the installer and it is indeed :error on repeat installs. This is not critical because configs are deep merged anyway. So it doesn't actually "matter" if it repeats 100 times.
Describe the bug When
mix igniter.install ash_postgres
is run twice,configure_runtime/3
always keeps addingto
runtime.exs
. This bug surfaced after the recent change in Igniter: https://github.com/ash-project/igniter/pull/54; specifically, the PR ensured thatIgniter.Code.Function.argument_matches_predicate?/3
never returns:error
because it can mistakenly be interpreted as truthy inif
calls, which is what happened here.To Reproduce Run
mix igniter.install ash_postgres
twice with the most recent Igniter.Expected behavior It only adds it once and not when it is already set.
Additional context Just tried using a pre-change version of Igniter and adding a
dbg()
statement to line 60 of the installer and it is indeed:error
on repeat installs. This is not critical because configs are deep merged anyway. So it doesn't actually "matter" if it repeats 100 times.