-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't try to parse aliases versions which doesn't contain exact version #76
Don't try to parse aliases versions which doesn't contain exact version #76
Conversation
e443591
to
77285ee
Compare
Codecov Report
@@ Coverage Diff @@
## master #76 +/- ##
============================================
+ Coverage 88.05% 88.08% +0.03%
Complexity 206 206
============================================
Files 7 7
Lines 385 386 +1
============================================
+ Hits 339 340 +1
Misses 46 46
Continue to review full report at Codecov.
|
77285ee
to
cc9fca3
Compare
fb541e8
to
7922406
Compare
I see 2 issues here:
IMO, the validation of the alias should be done by parsing it as a version (similar to what is done in some places in Composer), not by trying to apply some regex on the whole string to detect specific broken cases. |
@stof in fact it was doing this before, trying to parse it as version, so IMO trying to parse as a version at this point is not an option, do you think I could extend it to other operators like you said |
@adrianosferreira the alias is the part on the right of |
a563619
to
a8ea125
Compare
@stof right, I think it is better now. Can you double-check? I've called the normalizer method for the right side of the string (the alias) which then throws an exception in case we don't have an exact version.
|
Thanks |
@Seldaek thanks for merging. |
Too late but no big deal really.. |
@Seldaek I usually resolve with force push on my repos. However, not sure of the impact of force pushing in a widely used repo such as semver. |
There is no way I am force pushing :) Especially not after it's been tagged. |
@Seldaek oh yes, that's true! Thanks! |
This has been reported in: composer/composer#8338
Originally it was accepting such format "8.3.3 as ^8.3" when using
composer require
(it was taking the8.3.3
version) and then saving it oncomposer.json
. However, when you run any other command after, you were getting the message "the alias must be an exact version".So, I choose to throw an exception whenever an alias is used in the version without passing exact versions in order to comply with the message that we get.