I have spring cloud config server configured with access to 2 git repositories.

Configuration example:

spring:
  profiles:
    active: composite
  cloud:
    config:
      server:
        composite:
          -
            type: git
            uri: https://github.com/myrepo/settings.git
            username: user
            password: pass
          -
            type: git
            uri: https://github.com/myrepo/dictionaries.git
            username: user
            password: pass

Also I have different profiles in both repositories. For example:

https://github.com/myrepo/settings.git
      application.properties
      application-production.properties

https://github.com/myrepo/dictionaries.git
      application.properties
      application-production.properties

When I add spring.profiles.include=production into application.properties from the first repository I got both files (application.properties, application-production.properties) from first repository and only one (application.properties) from second. And vice versa.

Is it possible to apply `spring.profiles.include' defined in one repository to all other repositories?

Comment From: ryanjbaxter

It is an interesting use case but I don't know if we could ever achieve a perfect solution to this problem.

What if the last repository in the list had spring.profiles.include set, we are not going to go back through the list again looking for other properties files. That could be quite costly as that could end up in a cascade of searching for properties files over and over again.

Is it not possible for you to set the included profiles in bootstrap.properties (or via environment variables etc) when the app starts?

Comment From: igor-ermolenko

It's difficult to use bootstrap.properties because we are going to use service in different environments. And depends from environment we want to use different dictionaries.

It will be ok if we can define order how to apply spring.profiles.include. For example profiles from first repo applied to all repos. From second - to all except first, etc.

Comment From: spencergibb

We are limited by what spring boot provides us. We have moved to a new API on config server that uses the new config file processing. Can you try those new options with spring cloud 2020.0 and see if that is enough?

Comment From: spring-cloud-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.