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
Prevent auto-unlocked path repo packages from also unlocking their transitive deps when -w/-W is used #10157
Prevent auto-unlocked path repo packages from also unlocking their transitive deps when -w/-W is used #10157
Conversation
is there a way to test this ? |
You mean to write tests for it? It's kinda a pain as it requires a path repo which we don't support well in the |
fcdf013
to
2d10eda
Compare
OK now with test 👍🏻 |
To add a second more meaningful test more meaningful can you actually make the package in the path repo have requirements which change from one version to the next and what effect it has when that requirement changes but the requirement is locked? |
55aa41e
to
9ae5067
Compare
@naderman I modified the test to have more specific constraints and vary the constraints between locked and fresh path repo packages. The mirrored/transitive2 gets fully unlocked including 1.0.0 which I think is correct as mirrored/path-pkg in locked version requires symlinked/transitive2 however gets only 1.0.1+ unlocked via the root/update requirement which is >=1.0.1. The */transitive packages do not get unlocked as they are only referenced by path repo packages which now do not unlock transitive deps anymore. |
@Seldaek This helps. I was hoping for a second test which tests how this fails. So when a path repo changes its require constraints but because the transitive deps aren't updated its dependencies cannot be met and the thing errors. |
587e349
to
984ac9a
Compare
@naderman the last commit adds a full installer test with pretty much the same inputs as the poolbuilder test, which already fails because the new transitive requirements are for 2.x and the locked ones are 1.x, it just wasn't shown as failing in poolbuilder because that doesn't run the solver. I hope this is what you meant. |
...ver/Fixtures/poolbuilder/partial-update-unfixes-path-repo-replacer-with-transitive-deps.test
Show resolved
Hide resolved
42202dd
to
5e620f2
Compare
Rebased this on top of #10280, fixed some more bugs relating to my implementation here, and fixed the test ( |
5e620f2
to
3501964
Compare
The diff is a mess tho with the two PRs so let's focus on merging #10280 first :) |
3501964
to
5374a6e
Compare
OK the diff is back to a reviewable state. Most of the changes are actually to fix a bug in |
if (isset($this->pathRepoUnlocked[$name])) { | ||
foreach ($this->packages as $index => $package) { | ||
if ($package->getName() === $name) { | ||
$this->removeLoadedPackage($request, $repositories, $package, $index, false); |
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.
It's not clear to me why this shouldn't unlock alias packages if a remove is necessary?
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.
Actually it's not clear to me why unlockPackage was ever called in removeLoadedPackage - as it's only ever called from unlockPackage, it makes no sense. The aliases have the same name as the aliased package, and unlockPackage works only based on the name, so unlocking the same name again is useless. Removed this entirely in the last commit.
tests/Composer/Test/Fixtures/installer/partial-update-with-symlinked-path-repos.test
Outdated
Show resolved
Hide resolved
Tests look correct to me and seem to work. In general fine with this now, just the small notes I left you could still address. |
…ansitive deps when -w/-W is used
5374a6e
to
a6fc1ab
Compare
Refs #10093
As @stof said: