spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

Improve documentation for `override` remote property behaviour

Open joeltoby opened this issue 5 years ago • 5 comments

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.allowOverride
  • spring.cloud.config.overrideNone
  • spring.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.

joeltoby avatar Oct 15 '20 09:10 joeltoby

I'm happy to raise a PR to address this if that helps? I just need a bit of clarity on the open questions.

joeltoby avatar Oct 15 '20 10:10 joeltoby

spring-cloud/spring-cloud-config#573 is an edge case of embedding config server in an app.

spencergibb avatar Mar 30 '21 18:03 spencergibb

PRs welcome

spencergibb avatar Mar 30 '21 18:03 spencergibb

Hi @OlgaMaciaszek, I can't seem to find the documentation associated with this issue. Can you help me find it? I would love to contribute here.

vermaayush680 avatar Mar 03 '22 19:03 vermaayush680

Hello, @vermaayush680 the section is here in the published docs and this is the .adoc file that you need to apply the changes to for your PR. If you are an OpneForce 2022 participant, please write in the spring-cloud channel of the OpenForce event if you have any more questions or need any help.

OlgaMaciaszek avatar Mar 04 '22 10:03 OlgaMaciaszek