-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Hocon/Json Configuration Source for MP #4218
Support Hocon/Json Configuration Source for MP #4218
Conversation
klustria
commented
May 14, 2022
•
edited
Loading
edited
- Meta-config is refactored to allow it to be customizable by users for other types.
- Hocon/Json is parsed as a config source only via meta-config.
1. Discovers application.conf as a config source and parses it in hocon format 2. Discovers application.json as a config source and parses it in json format 3. Meta-config Config Source support for new types: hocon and json 4. Config profile support for both hocon and json config sources
This PR adds HOCON/JSON support as part of the default Helidon MicroProfile Config implementation. I think we need to refactor our MP metaconfiguration to be based on a service loader, and add a service provider implementation to both YAML and Hocon MP config sources. This provider would add a supported type (such as This would be a backward compatible change and allow us to add additional MP config sources in the future to be compatible with MP meta configuration. |
Thanks for the feedback @tomas-langer. I think I’ve discussed this with you before, but is it ok if I remove the metaconfig change in this PR, and deal with this in a new issue that would take care of the requirements you suggested? Are you ok with the rest of the changes, outside of the metaconfig? |
...sources/META-INF/native-image/io.helidon.config/helidon-config-hocon-mp/resource-config.json
Outdated
Show resolved
Hide resolved
config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigSource.java
Outdated
Show resolved
Hide resolved
config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigSource.java
Outdated
Show resolved
Hide resolved
config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigSourceProvider.java
Outdated
Show resolved
Hide resolved
…tification comment for security bug filtering
config/config-mp/src/main/java/io/helidon/config/mp/MpMetaConfigUtils.java
Show resolved
Hide resolved
config/config-mp/src/main/java/io/helidon/config/mp/MpPropertiesMetaConfigProvider.java
Outdated
Show resolved
Hide resolved
config/config-mp/src/main/java/io/helidon/config/mp/MpSystemPropertiesMetaConfigProvider.java
Outdated
Show resolved
Hide resolved
config/config-mp/src/main/java/io/helidon/config/mp/MpPropertiesMetaConfigProvider.java
Show resolved
Hide resolved
config/config-mp/src/main/java/io/helidon/config/mp/spi/MpMetaConfigProvider.java
Outdated
Show resolved
Hide resolved
...sources/META-INF/native-image/io.helidon.config/helidon-config-hocon-mp/resource-config.json
Outdated
Show resolved
Hide resolved
config/hocon-mp/src/test/java/io/helidon/config/hocon/mp/HoconJsonMpConfigSourceTest.java
Outdated
Show resolved
Hide resolved
…g-mp’s module-info and set priority of all implementations of MpMetaConfigProvider to 300
config/config-mp/src/test/java/io/helidon/config/mp/MpMetaConfigTest.java
Outdated
Show resolved
Hide resolved
config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigIncluder.java
Outdated
Show resolved
Hide resolved
…e failing because of dependency on yaml-mp
Docs related issues:
|
* Support Hocon/Json Configuration Source for MP 1. Meta-config is refactored to allow it to be customizable by users for other types. 2. Hocon/Json is parsed as a config source only via meta-config. * Create hocon includer per instance of hocon config source and add justification comment for security bug filtering * Remove support of application.conf/json hocon/json as default discoverable sources * Initial commit for Mp config-source provider implementation * Add MP meta-config provider test for Environment Variables * Add Yaml MP meta-config provider tests and various resolution to review feedback * Add helidon-config-yaml-mp as a dependency of helidon-microprofile-cdi * Declare "uses io.helidon.config.mp.spi.MpMetaConfigProvider" in config-mp’s module-info and set priority of all implementations of MpMetaConfigProvider to 300 * Various updates/cleanups from review feedback * Add helidon-config-yaml dependency to metrics examples after they were failing because of dependency on yaml-mp
* Support Hocon/Json Configuration Source for MP (#4218) * Support Hocon/Json Configuration Source for MP 1. Meta-config is refactored to allow it to be customizable by users for other types. 2. Hocon/Json is parsed as a config source only via meta-config. * Create hocon includer per instance of hocon config source and add justification comment for security bug filtering * Remove support of application.conf/json hocon/json as default discoverable sources * Initial commit for Mp config-source provider implementation * Add MP meta-config provider test for Environment Variables * Add Yaml MP meta-config provider tests and various resolution to review feedback * Add helidon-config-yaml-mp as a dependency of helidon-microprofile-cdi * Declare "uses io.helidon.config.mp.spi.MpMetaConfigProvider" in config-mp’s module-info and set priority of all implementations of MpMetaConfigProvider to 300 * Various updates/cleanups from review feedback * Add helidon-config-yaml dependency to metrics examples after they were failing because of dependency on yaml-mp * Replace javax.inject with jakarta.inject and javax.enterprise with jakarta.enterprise