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
Document devtool property file profile restrictions #19972
Comments
You're right @ddcruver. I don't think the |
The fact that I would argue the fact that DevTool YAML files work differently than YAML configuration files in other places causes more inconsistency. Also Some people prefer one or the other format so seeing continued support for both would be good and since these files are local to a developer they have more freedom to use whichever they want in their development environment. |
I agree with Madhura that we should not support this. The documentation already contains a note about profiles:
We should expand upon this to note that profile-specific configuration is not supported in general. That feels consistent to me as this isn’t an application.(properties|yaml) file.
We’ve discussed this before: #16042 (comment). We prefer to align with that standard and use a consistent location across platforms. |
@wilkinsona I think there is a little miss understanding here.
I do agree with it being in
I am not asking for devtools configuration files to activate any profiles, just that profiles contained in them should be filtered like any other YAML file. I understand that activating profiles would cause confusion and adds lots of complexity to the code. I have been debugging the property loading lately and understand a lot is going on. Right now you can add an arbitrary YAML file on your spring.config.location and it will support filtering of inactive profile YAML documents. To be clear I am only talking about Multi-profile YAML Documents. Not anything like Also I am not imply that I just saw it as a value add for those that don't like YAML and partly because mbhave said this:
|
We have been focusing on what it was doing and what it should be doing but I haven't even expressed my use case: I would like to have DevTools contain multiple configuration for different environments and allow me to pass the profiles to my Microservices in order to activate one or more but not all of the profiles in my This could be emulated by commenting out lines or swapping in different |
The We'll expand the existing note in the documentation to clarify when profile-specific configuration is and is not available. |
I think it would be a good idea to log a warning if any |
While loading of YAML files in home directory was fixed in #19081 it appears it is ignoring the profiles defined by the spring.profiles property and loading in all YAML documents (the sections in a YAML file) as property sources.
When running the example application with the example spring-boot-devtools.yaml with no profiles activate I would expect only one YAML document to be loaded, the top one which should be "default" property scope.
Example Project:
devtools-profile-loading.zip
I have added log statements to enumerate the loading property sources and just by starting up the example project you can see that all documents in spring-boot-devtools.yaml are loaded.
Example ~/.config/spring-boot/spring-boot-devtools.yaml:
spring-boot-devtools.yaml.txt
The text was updated successfully, but these errors were encountered: