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

spring.profiles.include must be a comma separated value in contrast to to non-cloud usage

Open
#1,417 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
According to the documentation for spring.profiles.include the value for spring.profiles.include is a list.

spring.profiles.include[0]=common
spring.profiles.include[1]=local

But using this in a configuration file provided via cloud config it does not work. Instead it expects the value to be a comma separated string value:

spring.profiles.include=common,local

The offending code:

https://github.com/spring-cloud/spring-cloud-commons/blob/main/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java#L306-L317

In Spring Boot the configuration setting is processed as a string list:

https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironment.java#L291-L310

The difference in behavior is not documented anywhere.

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 in spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java at lines 306-317, then compare the list processing in Spring Boot's ConfigDataEnvironment.java at lines 291-310. Verify how indexed and comma-separated spring.profiles.include values are handled for cloud configuration, and ensure the behavior is consistent or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.