Making conflict smarter: choose an older recipe to apply #865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
Flex recipes support a
conflictkey - e.g. https://github.com/symfony/recipes/blob/ee79aec15811a380b09c53d058972c74e77e25d9/doctrine/doctrine-bundle/2.4/manifest.json#L48-L50In this case, we added that so that we could use
when@devin the recipe, but that requiressymfony/framework-bundle5.3 or greater.Anyways, the current
conflictbehavior is overly simple: if a recipe conflicts with a package you have installed, it simply skips the recipe entirely. This, for example, makes the following fail right now:If you try this, the
doctrine/doctrine-bundlewill be skipped entirely.This PR makes that behavior smarter. For each recipe that conflicts with your app (e.g.
doctrine/doctrine-bundle2.4 recipe), it will try the next oldest recipe version (e.g.doctrine/doctrine-bundle2.3) until it finds one that does not conflict. So, you will always get the latest recipe version without any conflicts. If no compatible recipes are found, none would be installed (but I don't believe we have this situation anywhere anyways).Tested locally on an app also.
Cheers!