Schema not found message with multiple level schema extends
- Dominant language
- Elixir
- Stars
- 378
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
I have an umbrella app with the following apps
```
myapp1
models
utils
otherapp
```
myapp1 has a conform dependency tree like this: `myapp1 -> models -> utils`. When I try to start the app in my distillery release (`./bin/myapp1 start`), I get the following output:
```
Schema extends utils, but the schema for utils was not found.
==> Generated sys.config in /Users/aaronrenner/projects/myapp/_build/prod/myapp1/var
```
The app starts up just fine and the settings that are defined in utils.schema.exs are properly mapped to var/sys.config, but I get this error message. As a side note, I knew it could find the utils.schema.exs at some point because it inserted utils' settings into `apps/myapp/config/myapp.conf` when I ran `MIX_ENV=prod mix conform.configure`. As part of my troubleshooting, I switched to the release directory and ran the following command:
```
unzip -l releases/0.0.1/myapp.schema.ez
Length Date Time Name
--------- ---------- ----- ----
4807 08-02-2017 11:19 otherapp/config/otherapp.schema.exs
4106 08-02-2017 11:19 myapp1/config/myapp1.schema.exs
3912 08-02-2017 11:19 models/config/models.schema.exs
2799 08-02-2017 11:19 utils/config/utils.schema.exs
--------- -------
26976 4 files
```
I saw the utils schema file was in the .ez file and also found it interesting that otherapp's schema was also in the ez file (even though it's not a dependecy of myapp1).
I also ran 1 more experiment and removed all extends from my schemas and started my app and found the settings defined in utils.schema.exs were still properly mapped through to sys.config.
It seems like there might be a few issues here:
1. The schema not found message starting an app that has multiple levels of extended schemas.
2. Settings from schema.exs are getting mapped through to sys.config even if the current app's schema doesn't extend them. (However I tried setting a config value for "otherapp" and that didn't get mapped through.)
3. It seems weird that all of my umbrella apps schema files are included in the .schema.ez instead of just the ones my app extends.
Please let me know if I've misconfigured something or missed something in the docs. Thanks!
---
Also, here are my example schema files if they're helpful.
apps/myapp1/config/myapp1.schema.exs
```elixir
[
extends: [:models],
import: [],
mappings: [
#...
],
transforms: []
]
```
apps/models/config/models.schema.exs
```elixir
[
extends: [:utils],
import: [],
mappings: [
#...
],
transforms: []
]
```
apps/utils/config/utils.schema.exs
```elixir
[
extends: [],
import: [],
mappings: [
#...
],
transforms: []
]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.