-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Replaced Quarkus Config Profiles and Expansion with SmallRye Config #9184
Conversation
@geoand do you want to have a quick look at that one? Given we have all tests passing, I think we are probably good. |
Well, given that the tests were run a month ago, I would feel a lot better if the PR was rebased onto master |
I definitely like it and want it in :). If the tests pass on latest |
Let me rebase. |
Well it failed, but it seems more of an issue of the CI:
I didn't run the full suite locally, but executed tests for this module and it is fine. Any ideas @geoand ? |
I'll take a look, but it probably is an infra issue more than anything else |
I am good with this, but I'll let @dmlloyd have the final say |
Sure. I've released SmallRye Config 1.8.1 today and updated the PR with it. CI build looks betters, JDK 14 seems to have failed due to not executors available, but JDK 8 and 11 went fine. |
🎉 |
This PR is causing a problem in a custom Lines 313 to 338 in 3aa4346
In Quarkus 1.5.0 there were As a temporary solution I will change our code to detect the recursive call of |
cc @radcortez ^ |
I'll have a look. |
FWIW, when adding logic to detect any recursive call and just return |
@knutwannheden is this only happening in test / dev mode? Does this happen in runtime? |
@radcortez I didn't test it in production mode, but AFAICT it would be a problem there as well if a config source like |
The |
I see. I only tested with the |
What I was suspecting was that the problem is how |
What I'm wondering is if To clarify, you are unable to load profile based configuration in your |
#10322 Should fix this. @knutwannheden do you have any chance to pull it, build it locally and test it with your code? That would be super helpful. Thank you :) |
Sorry, I didn't get around to test the fix yet. I will try to do it tomorrow. |
I just tried this with the latest Quarkus SNAPSHOT build and my test still fails. I am however not convinced by the approach of |
Thanks @knutwannheden. Was this an issue with Quarkus before this PR? Or was already there? |
The problem with the property expansion was already there before. But our test case (for our own config source) worked in Quarkus 1.5 and fails with Quarkus 1.6.0.CR1. AFAICT the problem is that |
Yes, one of the reasons is that Quarkus "artificially" supported Profiles and Expansion with a wrapped ConfigSources. This in my opinion was wrong, because they are not truly ConfigSources but just transformations happening on top of sources. In the last version of SmallRye Config, we added Config interceptors to be able to support these cases and more easily implement behaviour on top of a configuration lookup (logging, relocation, fallback, etc). We also identified the issue about ConfigSources configuring themselves, and there was no good mechanism to do it, other than accessing the Sources or Config and then protecting the code to not fall into a cycle. Moving forward, once we release a new version of SmallRye Config, the recommended way is to use the https://github.com/smallrye/smallrye-config/blob/master/implementation/src/main/java/io/smallrye/config/ConfigSourceFactory.java, which should make implementing sources that configure themselves way cleaner. |
No description provided.