Problem/Motivation
Follow-up to #3343827: Update FixtureManipulator to work with InstalledPackagesList, real composer show command where we change our manipulator to use real composer commands
Right now if you do this.
(new ActiveFixtureManipulator())
->addPackage([
'name' => "drupal/dependency",
'version' => '9.8.0',
'type' => 'drupal-library',
])
->addPackage([
'name' => "drupal/semver_test",
'version' => '8.1.0',
'type' => 'drupal-module',
])
->commitChanges();
It will result in 2 calls to `composer require` when it could be done in 1
Proposed resolution
Change Fixture Manipulator to only make as many Composer as needed.
We should be able to group calls for `require` and `remove` commands. We would have to also group by dev and non-dev packages.
Comments
Comment #2
tedbowComment #3
wim leers#3343827: Update FixtureManipulator to work with InstalledPackagesList, real composer show command needs to land before this can be actionable.
Comment #4
wim leers#3343827: Update FixtureManipulator to work with InstalledPackagesList, real composer show command landed! And since this could help address #3338789-28: Random failure: "PHP temp directory (/tmp) does not exist or is not writable to Composer.", pulling into the sprint…
Comment #5
wim leersComment #6
wim leersComment #7
wim leersComment #8
omkar.podey commentedComment #11
omkar.podey commentedUnfortunately, the test timings are not consistent and it seems that grouping require calls don't help much.
Comment #12
omkar.podey commentedThe conclusion.
addPackage()calls as group calls but since the test times are pretty much similar to the3.0.xbaseline it seems to make little to no difference to the performance so complicating it doesn't make sense.addPackage()with same structure that i used to make group calls possible, Thoughts?Comment #13
omkar.podey commentedComment #14
tedbow@omkar.podey thanks for working on this. Yes, I don't think with the minimal performance this something we should probably spend anymore time on.
I think we can leave it open from now but set the priority to minor removing the
sprint. If someone really wants to tackle this they could try to figure how to make it better they are willing to try.but I think to if we were to commit a fix for this it could not make the class that much harder to understand. So I am doubtful that can be done.
Comment #15
tedbowComment #16
wim leersHuh, it feels like comments of mine have been deleted from this issue? 😳
I'd swear we've had a conversation both via audio and here with at least @tedbow about closing this instead of leaving it open like #14 says since if it's not worth doing now, it never will be.
Comment #17
wim leersAlso, the April 6 comment at #14 was marked as "new" for me here, which seems impossible? 🤪
Either way, assigning to @tedbow for hopefully marking this as I suggested in #16.
Comment #18
tedbow@Wim Leers I think we might have chatted in slack