Skip to content

Merge conflict handling for etc-merge#2286

Open
Johan-Liebert1 wants to merge 5 commits into
bootc-dev:mainfrom
Johan-Liebert1:etc-merge-bugfix
Open

Merge conflict handling for etc-merge#2286
Johan-Liebert1 wants to merge 5 commits into
bootc-dev:mainfrom
Johan-Liebert1:etc-merge-bugfix

Conversation

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator

See #2285 for the implementation details

Closes: #2285

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]>
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]>
@Johan-Liebert1 Johan-Liebert1 requested a review from cgwalters July 7, 2026 09:41
@Johan-Liebert1 Johan-Liebert1 added the ci/tier-1 Run CI for tier-1 OS (centos-10) only label Jul 7, 2026
@github-actions github-actions Bot added the area/documentation Updates to the documentation label Jul 7, 2026
@bootc-bot bootc-bot Bot requested a review from gursewak1997 July 7, 2026 09:42

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as requested changes per discussion in the issue

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

Opened #2301 splitting out "Compute etc diff before staging" commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation ci/tier-1 Run CI for tier-1 OS (centos-10) only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolving conflicts for etc merge

2 participants