-
-
Notifications
You must be signed in to change notification settings - Fork 196
Description
Current situation
As we already know it today, there is no upgrade point for Symfony applications.
With Standard Edition, we need to copy/paste code from the SE into our app when we want to "follow the SE upgrade path".
With Flex, it's gonna be the same in the case of the skeleton composer.json
file, but worst part is for the recipes.
Upgrade example
Let's imagine a case that can easily occur in real life:
I'm using SF3.3 today with the good ol' Standard Edition. I'm upgrading to Flex in November when it releases. Fine, a few days of work to adapt it, it's a big app, but it seems ok, and I can deploy on prod.
A few days/weeks/months/years/whatever later, I need to upgrade my app to Symfony 4.
We all know the huge amount of changes in Symfony best practices since Symfony 3.0, maybe my app was using old practices that are highly deprecated, and in order to avoid having to spend hundreds of hours debugging my code etc., I'd like at least to upgrade my packages without them to throw deprecations in their own code because I'm using old config.
And I don't want to run composer update
and make it fail everytime because a package is badly configured.
So I might need the "new" configuration for every package that is covered by a recipe.
Proposal
My idea is to create a command in the Flex plugin to do something like this:
$ composer flex:recipe:reset [--diff] [--overwrite] [packages...]
This command would download the full recipe of the package's currently installed version, and may, depending on the best / easily doable solutions:
- Maybe uninstall & reinstall recipe files. The advantage is that it would avoid having files that are no longer used by the new version of the recipe.
- Just reinstall the recipe without removing old files, but instead, overwrite all files of the recipe that have to be installed.
- Maybe compare files, it seems like a very hard challenge, but actually,
apt
is doing so when package config files are updated in your/etc
folder (let's say,php.ini
😄)
Any of these options can be harmless for the end-user when using versionning, because any git diff
in CLI allow seeing the changes, any visual Git diff application (like the PHPStorm's bundled one) can help debugging the upgrade changes and adapt them to our needs.
And as said before, this diff can also be handled directly in the command line, even though it's not the best option to me, but it has the advantage of being used programmatically by any CI or even by symfony.sh's bot for testing purposes.
Maybe other ideas about this might come, but with this first shot, what do you think?
Are the use cases relevant enough?