config/3
re-orders keyword lists while deep-merging
#14461
Labels
config/3
re-orders keyword lists while deep-merging
#14461
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.2.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
Elixir 1.18.3 (compiled with Erlang/OTP 27)
Operating system
Darwin MacBook-Pro 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:32:50 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6041 arm64
Current behavior
Consider the following
config.exs
Application.get_env(:config_reorder_reproduction, :key)
returns[c: 3, a: 2, b: 1]
.Expected behavior
From my point of view, the
Application.get_env(:config_reorder_reproduction, :key)
should return[a:2, b: 1, c: 3
, since in the firstconfig/3
they were configured in that particular order, and keyword-lists are ordered.Use case
When configuring something similar to pipeline, .e.g:
it is convenient only to configure secrets for the steps in
runtime.exs
, and not copy-paste the whole pipeline configuration, but currently the bug breaks the order on whichMyApp.Pipline1
may actually rely.PS
I suppose one could write the steps explicitly and then have only the values of the particular key/step be merged, but it would be better to have this behaviour documented.
The text was updated successfully, but these errors were encountered: