8000 XCOMMONS-3289: Allow overwritting xwiki.properties and xwiki.cfg properties via environment variable and Java system properties by tmortagne · Pull Request #1315 · xwiki/xwiki-commons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

XCOMMONS-3289: Allow overwritting xwiki.properties and xwiki.cfg properties via environment variable and Java system properties #1315

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
8000
from

Conversation

tmortagne
Copy link
Member
@tmortagne tmortagne commented Apr 18, 2025

The xwiki-platform side of things can be reviewed on xwiki/xwiki-platform#4069.

Jira URL

https://jira.xwiki.org/browse/XCOMMONS-3289

Changes

Description

The idea is to allow overwriting any xwiki.cfg and xwiki.properties values through environment variable or Java system properties. In practice, it means new System properties and environment oriented ConfigurationSource were introduces, and they should be used in any ConfigurationSource which would like to allow being overwritten by system properties and env variables.

I also added new ConfigurationSource#getKeys(String prefix) and isEmpty(String prefix) APIs, which are mainly helpers to directly get keys starting with a specific prefix.

Clarifications

See https://forum.xwiki.org/t/add-a-generic-way-to-overwrite-some-configuration-through-environment-variables-and-java-system-properties/16711 for more details

Screenshots & Video

Executed Tests

New unit tests in xwiki-commons-configuration-default (92% coverage).

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches: No

* located before other sources take priority.
*
* @version $Id$
* @since 7.4M1
Copy link
Member Author
@tmortagne tmortagne Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version may look a bit strange, but it's actually a move from platform.

* before other sources take priority.
*
* @version $Id$
* @since 2.0M1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version may look a bit strange, but it's actually a move from platform.

@tmortagne tmortagne force-pushed the feature-systemconfiguration branch from ef44a1d to 8395e0e Compare April 22, 2025 15:48
@tmortagne tmortagne marked this pull request as ready for review April 22, 2025 15:49
@tmortagne tmortagne force-pushed the feature-systemconfiguration branch from ec7cca2 to 34c4bc9 Compare April 23, 2025 11:49
tmortagne added 7 commits May 14, 2025 18:39
…erties via environment variable and Java system properties
…erties via environment variable and Java system properties$

* add missing `@Unstable`
* use a more consistent hint
* add missing javadoc
…erties via environment variable and Java system properties

* environment variable are actually case sensitive
* add documentation
…erties via environment variable and Java system properties

* add documentation
…erties via environment variable and Java system properties

* improve documentation
…erties via environment variable and Java system properties

* master moved to 17.4.0-SNAPSHOT
…erties via environment variable and Java system properties

* won't be ready for 17.4.0RC1
* provide an abstract to help support system overwrite
@tmortagne tmortagne force-pushed the feature-systemconfiguration branch from 34c4bc9 to 8ab0a06 Compare May 15, 2025 07:23
tmortagne added 2 commits May 15, 2025 09:27
…erties via environment variable and Java system properties

* won't be ready for 17.4.0RC1
…erties via environment variable and Java system properties

* introduce a new MapConfigurationSource helper
* various minor improvements and bugfixes
…erties via environment variable and Java system properties

* codestyle
* add missing javadoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0