-
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
Expanding ${keycloak.url}/realms/quarkus/
when keycloak.url
is not defined leads to null
value
#42392
Comments
/cc @pedroigor (keycloak), @sberyozkin (keycloak) |
Hum, that does not make much sense to me. If the Config system cannot expand a partial expression, we throw an exception: I'll see what is going on. |
Ah, maybe the confusion is about how quarkus/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java Lines 119 to 122 in 78045ea
For |
If I remember correctly, when we added For Dev Services, we used that check, so we assumed that if a property was there (no matter what), someone would provide the expected value and the Dev Service will not start. |
But shouldn't the behavior be consistent with what will be done at runtime? TBH, I'm not exactly happy with the fact that we had to special case the dev services case. I don't see a way out but still it's weird to have to put a default value there. |
Basically, wondering it we could find a way to start the test resources first and then make sure the config is out there when we are testing if the property is present. But in some cases, you might want the test resource to be started after the dev services. |
How so? The problem is that we are looking for runtime configurations that may or may not be available at build time.
While #41326 fixed #41128, it made us less consistent, and I would probably argue that it was not the proper fix. The way we implemented Dev Services is to check if a connection or URL property is set to either start or skip the Dev Service. These properties are usually runtime, and Dev Services are set up during build time. The problem is that there is no reliable way to check if a runtime property is available at build time (obviously). The old implementation checked only if the property existed and then started the Dev Service. Even if the property was not available at build time, the runtime property could be available via a runtime-only source (for instance, a Vault or Database source). This could cause a Dev Service to be started without being required. Ultimately, this is not a big issue because when you run in Dev or Test, it is unlikely to provide such properties in this way. The new implementation not only checks for empty but also requires expressions to be expanded, effectively making the Dev Services check properties mandatory if they exist during build time. While it worked for the original user request, it uncovered that issue with Keycloak, and it is likely to cause breaks to existent user configuration. In the Keycloak test, the test resource supplies the configuration for runtime, and of course, it is only available at runtime. Because we are now checking the value, the expansion needs to be valid, so we need to supply a default value for So what can we do? My recommendation for #41128 would be to keep everything as is and have the user create specific profiles. Be less smart, and add properties to force the start of the Dev Services, complementing the old behavior. |
I stumbled upon this behavior when looking at #41326 and I was surprised by it.
I want to discuss this with Roberto when he's back. Creating this as a reminder.
The text was updated successfully, but these errors were encountered: