Fixed not working "--force" option if you want to reinstall a recipe#702
Fixed not working "--force" option if you want to reinstall a recipe#702malteschlueter wants to merge 1 commit intosymfony:mainfrom malteschlueter:bugfix/reinstall-with-force
Conversation
|
I'm 👎 sorry. As explained in #684 (comment), this will make updating recipes harder, because it will force ppl to review changes that don't need to be. As you spotted in #684 (comment), the description of the You should manually remove the symfony.lock file if you want this exact behavior. Note that this is not the last word on recipe updates, there are open discussions on the topic and things will improve I hope too. |
|
Okay, no problem. Maybe it would be useful to split installation and updates in 2 commands. |
|
I've a use case with Symfony Docker that could require this patch (we discussed this with @nicolas-grekas privately): I want people to be able to add the Docker configuration to existing projects. To do so, they have to copy the Docker-related files and to set Maybe could we have two separate flags such as |
|
I've changed my mind on this topic. I think that the new name of the command (recipes:install) changes the expectation and that'd I'm fine changing this behavior. No need to have two flags. @malteschlueter would you be able to rebase this PR and fix the CS issue? |
|
Actually, having the ability to not reinstall the recipes that haven't change is very useful for another projet I maintain: API Platform. In the API Platform distribution, we made some customizations to the generated config files, but we have to sync recipes with Symfony before each release. This option is useful in this case, it reduces the maintenance burden. |
without |
|
I mean reinstalling only the recipes that have changed, and not touching to the one that haven't changed. But maybe is it the default behavior? |
…but there is no update
|
Replaced by #795, thanks for the proposal and the discussion. |
…ed recipes back to their initial state (nicolas-grekas) This PR was merged into the 1.13-dev branch. Discussion ---------- Add --reset flag to recipes:install to reset all installed recipes back to their initial state Fix #777 Replaces #702, see discussion there. Commits ------- fc1998f Add --reset flag to recipes:install to reset all installed recipes back to their initial state
Fix #777
Sometimes it's necessary to reinstall a recipe but actually it's not possible if there is not update for a recipe. Also with the
--forceoption Flex won't reinstall/execute the recipe. Only if there is a update for a recipe.I figured out that the $recipes in Flex.php#L466 are empty. It can't find/collects the recipe because the existing ref and the "reinstall" ref are same, see in Flex.php#L817.
So i tried to fix it but to be honest i'm not sure it's a good solution.
What do you think?
To reproduce:
composer require symfony/flexcomposer require symfony/apache-packpublic/.htaccesscomposer recipes:install symfony/apache-pack --forcePrevious PR #684 was closed automatically after changing the default branch from master to main.