ash-project / ash-project/igniter

`Igniter.Project.Config.configure/6` doesn't update nested Keyword

Open
#194 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Elixir
Stars
404
Forks
75
Avg merge
9h 58m
Merged PRs (30d)
3

Description

**Describe the bug**
`Igniter.Project.Config.configure/6` doesn't look into the keywords list properly

**To Reproduce**
Have a `dev.exs` with contents like
```elixir
config :demo, DemoWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
secret_key_base: "A0DSgxjGCYZ6fCIrBlg6L+qC/cdoFq5Rmomm53yacVmN95Wcpl57Gv0sTJjKjtIp",
watchers: [
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
]
```
and run
```elixir
Igniter.Project.Config.configure(
igniter,
"dev.exs",
:demo,
[DemoWeb.Endpoint, :http, :port],
{:code, Sourceror.parse_string!("4100")}
)
```

**Expected behavior**
Should replace port `4000` -> `4100`

**Actual behavior**
No changes apply

**Workaround**
The function works properly if we go one level higher, updating the entire `:http` list instead of just the `:port` key within
```elixir
Igniter.Project.Config.configure(
igniter,
"dev.exs",
:demo,
[DemoWeb.Endpoint, :http],
{:code, Sourceror.parse_string!("[ip: {127, 0, 0, 1}, port: 4100]")}
)
```

**Runtime**

- Elixir version 1.16
- Erlang version 26
- OS X 14.6.1
- Igniter version 0.5.8
- any related extension versions

Contributor guide

Open the contributing guide

Research direction

Start by locating Igniter.Project.Config.configure/6 and reproduce the nested [DemoWeb.Endpoint, :http, :port] example from the issue. Trace how the keyword path is handled, then verify that the existing configuration changes port 4000 to 4100 while the higher-level workaround remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.