-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #895 [recipes:update] Fixing bug where files failed to delete tha…
…t were modified previously (weaverryan) This PR was squashed before being merged into the 1.x branch. Discussion ---------- [recipes:update] Fixing bug where files failed to delete that were modified previously Hi! This fixes TWO `recipes:update` bugs: ## Bug 1️⃣ : sometimes deleted files caused patch to fail Small bug fix. The mystery is how I didn't catch this before... and how nobody seems to have hit this. The problem is fairly simple: A) The user gets a file (a long time ago) from a recipe (e.g. `config/bootstrap.php`). B) The user modifies (and commits) some change. C) A recipe update *deletes* that file. This, oddly, fails because the patch can't be applied. For example, when `config/packages/dev/framework.yaml` is deleted in `symfony/framework-bundle` recipe, this patch is correctly generated ```diff diff --git a/config/routes/dev/framework.yaml b/config/routes/dev/framework.yaml deleted file mode 100644 index bcbbf13..0000000 --- a/config/routes/dev/framework.yaml +++ /dev/null @@ -1,3 +0,0 @@ -_errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error ``` However, if the user's `framework.yaml` doesn't look EXACTLY like this, the patch will fail (not with a conflict like you might expect, it just completely fails to apply). The fix is quite simple: if a recipe update is *deleting* a file, instead of generating a "delete patch" for it, we run `git rm <filename>`. The downside is that the user won't get a nice "file conflict" if they ever modified the file... but apparently that is not possible. And the user will still review this change before they commit. ## Bug 2️⃣ : `bundles.php` environments didn't change If an upgraded recipe changed the environments that a bundle is configured in (e.g. https://github.com/symfony/recipes/pull/940/files), this was previously not taken into account: the update did not update the environments. Fixed now. Tested locally on a fairly complex project. Thanks! Commits ------- b33301a [recipes:update] Fixing bug where files failed to delete that were modified previously
- Loading branch information
Showing
7 changed files
with
97 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ jobs: | |
matrix: | ||
include: | ||
- php: '7.1' | ||
composer: 2.2.x | ||
- php: '7.2' | ||
- php: '7.3' | ||
- php: '7.4' | ||
|
@@ -33,11 +34,11 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: "Install PHP with extensions" | ||
uses: shivammathur/setup-php@2.7.0 | ||
uses: shivammathur/setup-php@2.18.0 | ||
with: | ||
coverage: "none" | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
tools: composer:${{ matrix.composer }} | ||
|
||
- name: "Validate composer.json" | ||
run: "composer validate --strict --no-check-lock" | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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