Merge conflict handling for etc-merge#2286
Open
Johan-Liebert1 wants to merge 5 commits into
Open
Conversation
We would have unmergable paths if a modified file was changed to a directory in the new etc or vice-versa. One of the major issues was that we were erroring out during "merge" which is not ideal. A new vector now keeps track of all unmergable paths and the reason they're not mergable. Ref: composefs/composefs-rs/issues/335 Signed-off-by: Pragyan Poudyal <[email protected]>
Currently we have a hard error whenever we find a merge conflict in etc. Introduce MergeStrategy enum with Fail, Skip and Replace variants which fail, skip copying and replace file/directory in the new etc respectively upon encountering a merge conflict. The deafult, while finalizing, is to still fail; next step would be making this configurable Signed-off-by: Pragyan Poudyal <[email protected]>
Signed-off-by: Pragyan Poudyal <[email protected]>
Before we write the staged deployment file at `/run/composefs` we now compute the etc diff in advance to check whethere we will face any merge conflicts while finalizing the deployment. We accept the merge strategy either from the Cli or from config file at `/usr/lib/bootc/finalize.toml`. If we find conflicts and merge strategy is to Fail, we fail early on upgrade/switch and not while finalizing the deployment. Write the merge strategy to the staged file to use during finalization Signed-off-by: Pragyan Poudyal <[email protected]>
The test was largely AI generated Signed-off-by: Pragyan Poudyal <[email protected]>
cgwalters
requested changes
Jul 8, 2026
cgwalters
left a comment
Collaborator
There was a problem hiding this comment.
Marking as requested changes per discussion in the issue
Collaborator
Author
|
Opened #2301 splitting out "Compute etc diff before staging" commit |
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.
See #2285 for the implementation details
Closes: #2285