Add a plug that detects the need for running `mix ash.codegen`
- Dominant language
- Elixir
- Stars
- 2.5k
- Forks
- 422
- Avg merge
- 23h 26m
- Merged PRs (30d)
- 46
Description
There are some challenges:
1. AshPostgres and AshGraphql both expect to be able to exit/raise. We need to make sure that they *raise a specific known error* in this case, and don't use `exit` when we are calling their `codegen` functions.
2. In order to run `mix ash.codegen`, we need to provide a name. The current tooling in `Plug.Exception` supports actions, but not actions that take inputs. Perhaps we need to try and improve `Plug.Exception` to support inputs. I find it unlikely that it would be something that they are open to but worth checking.
Contributor guide
Research direction
Start by inspecting the AshPostgres and AshGraphql codegen functions and the Plug.Exception action support mentioned in the issue. Determine how `mix ash.codegen` can detect that code generation is needed, how a name can be supplied, and how codegen failures can raise a known error instead of exiting. Done means the detection flow handles both providers and supports the required named action.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100