Repository navigation
Document the order of application and profile specific files - #3347
Merged
ryanjbaxter merged 1 commit intoOct 15, 2026
Merged
Conversation
The environment repository page explains the precedence rules in general terms, but it does not say where a file named after both the application and a profile, such as foo-dev.yml, ranks against application-dev.yml, foo.yml and application.yml. * List the order of these files for the sample client of the page, for native, Git and SVN repositories and one search location. * Add a NativeEnvironmentRepository test that pins this order. Fixes spring-cloudgh-1868 Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1868
The Environment Repository page explains the precedence rules in general terms. It does not say where a file named after both the application and a profile, such as
foo-dev.yml, ranks againstapplication-dev.yml,foo.ymlandapplication.yml. The issue asks exactly that.This adds an ordered list for the page's sample client (
foowith thedevandmysqlprofiles), from the highest precedence to the lowest:foo-mysql.ymlapplication-mysql.ymlfoo-dev.ymlapplication-dev.ymlfoo.ymlapplication.ymlThe list is scoped to native, Git and SVN repositories and to one search location. Those backends build a
NativeEnvironmentRepository, which setsspring.config.nametoapplication,{application}, so Spring Boot's rules give this order. I did not check the S3 backend, which builds itsEnvironmentdifferently.Testing
NativeEnvironmentRepositoryTestsgets a test with the six files in one classpath location. It asserts the order of the property sources for anordersapplication with thedev,mysqlprofiles, and that the first one isorders-mysql.yml. It pins existing behaviour, so it passed on the first run../mvnw -pl spring-cloud-config-server -am verify -Dtest=NativeEnvironmentRepositoryTestspasses, including Checkstyle and the Spring Java Format check.