symfony / flex

Composer plugin for Symfony
MIT License
4.15k stars 181 forks source link

Private bundle 99999.99999 version when branch doesn't contain specific recipe version. #983

Open gspirov opened 1 year ago

gspirov commented 1 year ago

Hi folks!

First of all my issue is related to this one https://github.com/symfony/flex/issues/887 which seems unresolved.

The issue happens to me as well.

When I use private bundle + private recipe repository and the composer.json in "require" section contains "my-org/my-bundle":"dev-master" on the 1st composer install (or update regarding if there is a composer.lock file) all other recipes from symfony 3rd party bundles are installed. At this moment my custom recipe for the particular custom bundle is postponed.

After a bit research inside Symfony\Flex\Downloader I saw that all of the bundles containing recipes when they are on branch (dev-master, dev-trunk, dev-develop, etc) it searches for branch aliasing for this package and when there is no such alias set, it automatically transforms the current version of the recipe to (master|develop|trunk, etc).999999 and lately version_compare function is invoked in order to check if the version (this with .999999) is lower than the version from the recipe. If the version is lower then the recipe is never generated and you need to run it manually. Although manually run, the recipe is written in the symfony.lock file with version 99999.99999 which lately on each of the commands throws:

In VersionParser.php line 186:

  Invalid version string "9999999.9999999"  

A workaround for this is to create branch-alias for your dev-master: 1.0-dev inside the bundle's repository.

But my question here is, imagine that you're working in organisation where you have a custom bundle + custom recipe for it and during development the dev- branches in the root project which points to the custom bundle are subject of changing (which is normal, like testing specific change in the core bundle on staging). How in this case would you manage branch changes and running the composer commands which interact particularly with the recipes version?

Thanks in advance.