You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we do not officially support accessing runtime configuration during build time, but unofficially we do it.
When we map a configuration with either ConfigPhase#BUILD_TIME, ConfigPhase#BUILD_AND_RUN_TIME_FIXED, or ConfigPhase#RUN_TIME, it tells us where the configuration may be applied, and we do some validations on top. For instance, if someone tries to set a configuration during runtime that is marked ConfigPhase#BUILD_AND_RUN_TIME_FIXED, you get a warning:
foo.bar is set to 'runtime', but it is build-time fixed to 'build'. Did you change the property foo.bar after building the application?
But we don't have the opposite (validate that we are accessing runtime configuration available during build time), so it is possible to do it. One example is Dev Services:
Dev Services do the work during build-time
We check for a well-known service configuration (like ...url or similar), which in most cases is a runtime property.
If the property is there, we move on; if not, we try to be smart and start the Dev Service
This has been causing some annoying issues (and probably more):
Checking for runtime properties during build is error-prone, obviously because the runtime configuration may be completely different.
There are other scenarios where we access runtime configuration to populate / generate descriptions that later on are again updated at runtime on configuration change. Still, I didn't identify all of these scenarios yet.
Dumb down Dev Services and always enable them during Dev mode. To connect to a specific service, you must disable that Dev Service explicitly. It will worsen the experience, but it is the easiest solution I can think of. I still need to analyze other scenarios where runtime properties are used during build-time.
Maybe we can change the Dev Services configuration slightly. We still do all the work, but config verification would happen at runtime. I didn't do any analysis to check if this is feasible or not. There may be other requirements that I'm not fully aware.
Regardless, this is for us to start a conversation on the matter and see if we need to change something.
The text was updated successfully, but these errors were encountered:
Description
Currently, we do not officially support accessing runtime configuration during build time, but unofficially we do it.
When we map a configuration with either
ConfigPhase#BUILD_TIME
,ConfigPhase#BUILD_AND_RUN_TIME_FIXED
, orConfigPhase#RUN_TIME
, it tells us where the configuration may be applied, and we do some validations on top. For instance, if someone tries to set a configuration during runtime that is markedConfigPhase#BUILD_AND_RUN_TIME_FIXED
, you get a warning:foo.bar is set to 'runtime', but it is build-time fixed to 'build'. Did you change the property foo.bar after building the application?
But we don't have the opposite (validate that we are accessing runtime configuration available during build time), so it is possible to do it. One example is Dev Services:
...url
or similar), which in most cases is a runtime property.This has been causing some annoying issues (and probably more):
${keycloak.url}/realms/quarkus/
whenkeycloak.url
is not defined leads tonull
value #42392Checking for runtime properties during build is error-prone, obviously because the runtime configuration may be completely different.
There are other scenarios where we access runtime configuration to populate / generate descriptions that later on are again updated at runtime on configuration change. Still, I didn't identify all of these scenarios yet.
Implementation ideas
What should we do?
Leave it as is and acknowledge the status quo, properly document and support it. I don't want to complicate things, but we should mark such configuration properties and lock and warn against unexpected access. Cases such as Expanding
${keycloak.url}/realms/quarkus/
whenkeycloak.url
is not defined leads tonull
value #42392 (comment) are not going to work.Dumb down Dev Services and always enable them during Dev mode. To connect to a specific service, you must disable that Dev Service explicitly. It will worsen the experience, but it is the easiest solution I can think of. I still need to analyze other scenarios where runtime properties are used during build-time.
Maybe we can change the Dev Services configuration slightly. We still do all the work, but config verification would happen at runtime. I didn't do any analysis to check if this is feasible or not. There may be other requirements that I'm not fully aware.
Regardless, this is for us to start a conversation on the matter and see if we need to change something.
The text was updated successfully, but these errors were encountered: