-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Passing the latest allowable version as package constraints #10018
Passing the latest allowable version as package constraints #10018
Conversation
$constraint = $versionParser->parseConstraints($latestAllowableVersion); // your version constraint | ||
$packageLink = new Link($package->getName(), $dependencyName, $constraint); | ||
|
||
$requires = $package->getRequires(); | ||
$requires[$dependencyName] = $packageLink; | ||
|
||
$package->setRequires($requires); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand what is going on here, but it looks like you are overriding the constraint from the composer.json
file with $latestAllowableVersion
. I don't know what $latestAllowableVersion
contains, but at a guess it's the latest version obtained from the registry? Should it not combine that with the existing constraint instead of overriding it? Does this work properly with dev constraints or is this going to introduce a non-dev constraint when updating dev requirements?
I suspect this is probably the cause of #10033
What are you trying to accomplish?
Passing the latest allowable version to native helper and using it as a composer require constraints
Anything you want to highlight for special attention from reviewers?
Functionality was tested with smoke test, and the existing unit tests are updated as per the functionality change.
How will you know you've accomplished your goal?
Error reproduced in local
Given the solution and tested via smoke test.
Checklist