spring-cloud / spring-cloud/spring-cloud-commons

Support merging lists across property sources as well as overriding lists via separate property sources.

Open
#799 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting for votes
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

Describe the bug
We depend on spring cloud config server to externalize our configuration and we have two configured backends:

  • git
  • vault

We have existing configuration that loads credential objects in an array, for example:

infra:
  credentials:
    - name: some-credential
      secret: something-in-vault

We have depended on the ability for the config server to merge the vault and git configuration

# vault
infra.credentials[0].secret=something-in-vault
# git
infra.credentials[0].name=some-credential

Since upgrading our dependency of spring-cloud-commons to 2.2.3.RELEASE from 2.2.0.RELEASE, we noticed the change to PropertySourceBootstrapConfiguration. The use of CompositePropertySource was replaced with a List<PropertySource<?>> as part of https://github.com/spring-cloud/spring-cloud-commons/issues/611.

Opinion
Would there be interest in supporting both styles in just spring-cloud? Maybe take the List as a default but allow a feature toggle so that clients who are reliant on the merging of configurations via config server is maintained.
With the current implementation, we either need to do quite a bit of refactoring of existing configuration structures or migrate all of the configurations that was previously in git into vault which would hinder debugging and the developer experience.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the PropertySourceBootstrapConfiguration entry point and compare the previous CompositePropertySource behavior with the current List<PropertySource<?>> handling. Reproduce the git and vault examples that populate different fields of the same list element. Done means list values can be merged across property sources while preserving the current overriding behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.