SeparateApplicationYamlByProfile: merge into existing profile files#937
Merged
SeparateApplicationYamlByProfile: merge into existing profile files#937
Conversation
Jenson3210
commented
Feb 18, 2026
Jenson3210
commented
Feb 18, 2026
Jenson3210
commented
Feb 18, 2026
SeparateApplicationYamlByProfile would generate a new file even when
application-{profile}.yml already existed, creating a duplicate source
file that could overwrite the existing one when applied.
Now the scanner tracks existing application-*.yml files, generate()
only creates files that don't exist yet, and the visitor merges
extracted profile documents into existing files as new YAML documents.
Address review feedback: - Match both .yml and .yaml extensions for existing profile files - Use MergeYamlVisitor to deep-merge properties into existing profile files instead of appending separate YAML documents
97488e5 to
30ef19a
Compare
timtebeek
approved these changes
Feb 24, 2026
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.
Summary
SeparateApplicationYamlByProfilenow merges extracted profile content into existingapplication-{profile}.ymlfiles instead of generating duplicatesProblem
When
application.ymlcontains a profile section (e.g.spring.config.activate.on-profile: dev) andapplication-dev.ymlalready exists, the recipe'sgenerate()method creates a new source file with the same path. Since the framework tracks files by UUID rather than path, this results in a duplicate file that can overwrite the existing one when applied.Solution
application-*.ymlfiles and records their paths---separator) to existing profile filesTest plan
separateProfile,separateProfileList,leaveProfileExpressionsAlone)mergeIntoExistingProfileFile— verifies content is appended to existing profile filedoNotModifyExistingProfileFileWhenNoMatchingProfile— verifies unrelated profile files are untouched