Skip to content

fix: Modified incarnation report deletion conflict - #626

Merged
o1da merged 2 commits into
Roche:mainfrom
evrardj-roche:nact-2756
Aug 27, 2026
Merged

fix: Modified incarnation report deletion conflict#626
o1da merged 2 commits into
Roche:mainfrom
evrardj-roche:nact-2756

Conversation

@evrardj-roche

@evrardj-roche evrardj-roche commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

foxops silently drops template deletions of locally-modified files If a file was edited in an incarnation and later deleted in the template:
FoxOps keeps the local copy and never flags it as a conflict, (not even inside a ":construction: CONFLICT" MR)

It only surfaces modify/modify conflicts; modify/delete losses are silent. Result: clusters stay on versions that already removed a file, yet still carry it.

This is a problem, as it leads to a drift.

This fixes it by:

  • increasing the test coverage to guarantee that incaranation modified files are triggering a conflict upon their template's deletion
  • engine is raising the right signal in git diff patch.

Here is an example of the git apply --reject for an updated file that got deleted in a template:

$ git apply --reject ../patch
Checking patch README.md...
error: while searching for:
CONTENT

error: patch failed: README.md:1
error: removal patch leaves file contents
error: README.md: patch does not apply
Checking patch todo...
Applied patch todo cleanly.

Which you can see the new "patch does not apply" line. This works as git version 2.55.

However, this does NOT update the function to be more resilient to any future git operation message change.

foxops silently drops template deletions of locally-modified files
If a file was edited in an incarnation and later deleted in the template,
FoxOps keeps the local copy and never flags it as a conflict
(not even inside a ":construction: CONFLICT" MR)

It only surfaces modify/modify conflicts; modify/delete losses are silent.
Result: clusters stay on versions that already removed a file, yet still carry it.

This is a problem, as it leads to a drift.

This fixes it by:
- increasing the test coverage to guarantee that incaranation modified files are
  triggering a conflict upon their template's deletion
- engine is raising the right signal in git diff patch.

Here is an example of the git apply --reject for an updated file that
got deleted in a template:

```
$ git apply --reject ../patch
Checking patch README.md...
error: while searching for:
CONTENT

error: patch failed: README.md:1
error: removal patch leaves file contents
error: README.md: patch does not apply
Checking patch todo...
Applied patch todo cleanly.
```

Which you can see the new "patch does not apply" line.
This works as git version 2.55.

However, this does NOT update the function to be more resilient to any
future git operation message change.

Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard+rochepub@external.roche.com>
@evrardj-roche

Copy link
Copy Markdown
Contributor Author

@defreng you should have a look at this before continuing, to check if it all makes sense.

@evrardj-roche
evrardj-roche marked this pull request as ready for review August 20, 2026 12:20
@evrardj-roche
evrardj-roche requested a review from defreng as a code owner August 20, 2026 12:20
@evrardj-roche

Copy link
Copy Markdown
Contributor Author

WARNING: The second commit (e2e test) was AI generated.

@evrardj-roche

Copy link
Copy Markdown
Contributor Author

Retriggered CI.

@evrardj-roche

Copy link
Copy Markdown
Contributor Author

Retriggering CI

@evrardj-roche

Copy link
Copy Markdown
Contributor Author

yay, no issue on this run!

Can you review this @defreng ?

@evrardj-roche

Copy link
Copy Markdown
Contributor Author

@o1da can you review and merge this?

@o1da
o1da merged commit 8aaa4aa into Roche:main Aug 27, 2026
55 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants