Skip to content

[recipes:update] Keep files modified in the app when the recipe removes them - #1106

Open
lyrixx wants to merge 1 commit into
symfony:2.xfrom
lyrixx:fix-recipe-update-deleted-modified-file
Open

lyrixx wants to merge 1 commit into
symfony:2.xfrom
lyrixx:fix-recipe-update-deleted-modified-file

Conversation

@lyrixx

@lyrixx lyrixx commented Oct 14, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #1105
License MIT

When a new version of a recipe no longer ships a file, recipes:update ran git rm on it even if it had been modified in the app, then reported "No files were changed as a result of the update."

Now, RecipePatcher::generatePatch() compares the file in the app with the one copied by the original recipe:

  • same content: the file is deleted, as before;

  • different content: the file is kept, and listed in a warning, like the files still referenced by other recipes:

    The following files were removed in the recipe, but they were kept because you modified them. You might need to remove them manually:
          - config/packages/workflow.yaml
    

Deleted files are now also taken into account to decide whether files were changed by the update.

Reporting this as a modify/delete conflict is not possible with git apply, which is why deletions were moved out of the patch in the first place.

I also fixed two tests: testGeneratePatch created the app files with touch (empty, so now seen as modified), and testIntegration checked the deletion of security.yaml at the wrong path, so the assertion always 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.

recipes:update deletes a modified file when the new recipe no longer ships it

1 participant