Use an actually invalid version for test#6536
Merged
jeffwidman merged 1 commit intomainfrom Jan 29, 2023
Merged
Conversation
The previous string `"^3.0|4.1.x-dev as 3.0.0"` isn't actually an invalid version... because `4.1.x-dev` can technically be an exact version number. However, this passed unit tests just fine due to an upstream bug in `composer` which was fixed in composer/composer#11086 / composer/composer@8618f00. So when we upgrade to a newer version of `composer` that includes this fix, the test will start failing. On composer `2.4.1`, the version string `"^3.0|4.1.x-dev as 3.0.0"` throws: ``` {"error":"Invalid version string \"^3.0|4.1.x-dev\" in \"^3.0|4.1.x-dev as 3.0.0\", the alias source must be an exact version, if it is a branch name you should prefix it with dev-"} ``` Compare with `2.5.1`, where it parses that as a valid version string, and then fails because we're currently running `php` `7.4`: ``` {"error":"Your requirements could not be resolved to an installable set of packages.\n Problem 1\n - monolog\/monolog dev-main requires php >=8.1 -> your php version (7.4.33) does not satisfy that requirement.\n - monolog\/monolog 3.x-dev is an alias of monolog\/monolog dev-main and thus requires it to be installed too.\n - Root composer.json requires monolog\/monolog ^3.0|4.1.x-dev as 3.0.0 -> satisfiable by monolog\/monolog[3.0.0-RC1, ..., 3.x-dev (alias of dev-main)].\n"} ``` I double-checked with the upstream `composer` team in composer/composer#11282 and they [confirmed this behavior](composer/composer#11282 (comment)).
Member
Author
|
I broke this out separate from #6385 because while that uncovered this issue, it's not tied-together... we should be fixing this regardless... ie, if we run into any unexpected issues with that |
This was referenced Jan 29, 2023
Unit test started failing because invalid version string now parsed as valid
composer/composer#11282
Closed
deivid-rodriguez
approved these changes
Jan 29, 2023
alcere
pushed a commit
that referenced
this pull request
Feb 20, 2023
The previous string `"^3.0|4.1.x-dev as 3.0.0"` isn't actually an invalid version... because `4.1.x-dev` can technically be an exact version number. However, this passed unit tests just fine due to an upstream bug in `composer` which was fixed in composer/composer#11086 / composer/composer@8618f00. So when we upgrade to a newer version of `composer` that includes this fix, the test will start failing. On composer `2.4.1`, the version string `"^3.0|4.1.x-dev as 3.0.0"` throws: ``` {"error":"Invalid version string \"^3.0|4.1.x-dev\" in \"^3.0|4.1.x-dev as 3.0.0\", the alias source must be an exact version, if it is a branch name you should prefix it with dev-"} ``` Compare with `2.5.1`, where it parses that as a valid version string, and then fails because we're currently running `php` `7.4`: ``` {"error":"Your requirements could not be resolved to an installable set of packages.\n Problem 1\n - monolog\/monolog dev-main requires php >=8.1 -> your php version (7.4.33) does not satisfy that requirement.\n - monolog\/monolog 3.x-dev is an alias of monolog\/monolog dev-main and thus requires it to be installed too.\n - Root composer.json requires monolog\/monolog ^3.0|4.1.x-dev as 3.0.0 -> satisfiable by monolog\/monolog[3.0.0-RC1, ..., 3.x-dev (alias of dev-main)].\n"} ``` I double-checked with the upstream `composer` team in composer/composer#11282 and they [confirmed this behavior](composer/composer#11282 (comment)).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The previous string
"^3.0|4.1.x-dev as 3.0.0"isn't actually an invalid version... because4.1.x-devcan technically be an exact version number.However, this passed unit tests just fine due to an upstream bug in
composerwhich was fixed in composer/composer#11086 / composer/composer@8618f00. So when we upgrade to a newer version ofcomposerthat includes this fix, the test will start failing.On composer
2.4.1, the version string"^3.0|4.1.x-dev as 3.0.0"throws:Compare with
2.5.1, where it parses that as a valid version string, and then fails because we're currently runningphp7.4:I double-checked with the upstream
composerteam in composer/composer#11282 and they confirmed our test fixture is incorrect.