spring-cloud / spring-cloud/spring-cloud-commons
Improve documentation for `override` remote property behaviour
@vermaayush680 is already working on this.
Since Mar 4, 2022.
- Dominant language
- Java
- Stars
- 751
- Forks
- 744
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Summary
The documentation of the properties used to control remote property overriding is missing key information and appears to contain conflicting statements. It is quite confusing.
To clarify, I'm specifically referring to the Overriding the Values of Remote Properties section of the documentation.
The properties:
spring.cloud.config.allowOverridespring.cloud.config.overrideNonespring.cloud.config.overrideSystemProperties
Specific details
1. overrideNone (and possibly overrideSystemProperties) must be set remotely
The docs state the following:
If you want to allow your applications to override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting spring.cloud.config.allowOverride=true (it doesn’t work to set this locally). Once that flag is set there are some finer grained settings to control the location...
☝️ This implies that once devs set the allowOverride = true remotely, overrideNone and overrideSystemProperties can be set locally. I only know that this is not the case due to the discussion in Issue spring-cloud/spring-cloud-config#573.
2. The affect of setting allowOverride to true or false is unclear
Does it enable / disable both of the other properties (overrideNone & overrideSystemProperties)?
The Appendix: Compendium of Configuration Properties describes allowOverride as follows:
Flag to indicate that {@link #isSystemPropertiesOverride() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true.
☝️ That seems clear - it enables overrideSystemProperties and does not affect overrideNone. But confusingly the description of overrideNone references this property:
Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is true, external properties should take lowest priority, and not override any existing property sources (including local config files). Default false.
... and the description of overrideSystemProperties does not:
Flag to indicate that the external properties should override system properties. Default true.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.