- Issue created by @tedbow
- @tedbow opened merge request.
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 12:24am 23 February 2023 - πΊπΈUnited States tedbow Ithaca, NY, USA
Rough but I think it proves it is possible
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This hardblocks π Tighten ComposerPluginsValidator: support only specified version constraint Fixed . See #3340022-10: [PP-1] Tighten ComposerPluginsValidator: support only specified version constraint β .
This is a critical follow-up to π Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed .
- Assigned to tedbow
- Status changed to Needs work
almost 2 years ago 12:08pm 23 February 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Reviewed. tl;dr: IMHO we should use
composer validate --check-lock --with-dependencies --no-interaction --ansi --no-cache --working-dir=PROJECT_ROOT
in both the fixture creator and when committing fixture manipulations. - πΊπΈUnited States tedbow Ithaca, NY, USA
@Wim Leers thanks for the review
This issue has only updated 1 validator to use `InstalledPackageList`
I think we may be able to bring in the changes to validators we made in this merge request we made in π Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed in before reduced the scope of that issue to not update the validators. In that merge request we still had
\Drupal\package_manager\ComposerInspector::getInstalledPackagesList
and I think it was pretty much the same API we shouldn't have to do all that work over again.I may look into do that if I address the other feedback I might unassign myself. But I think using the other MR should save alot of time because those changes already got some review
- πΊπΈUnited States tedbow Ithaca, NY, USA
I tried to get the changes from the merge request in #7 but it was not so easy. That was on 2.x and other changes have happened since this. I think we should get this current issue in with 1 validator swapped to prove it works and then do other validators in other isssues
- πΊπΈUnited States tedbow Ithaca, NY, USA
removing "attempt" since it seems we can do this
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
It's assigned to you, @tedbow, so you're working on this? If you want Kunal, Yash or Omkar to work on this tomorrow, please unassign π
- Issue was unassigned.
- πΊπΈUnited States tedbow Ithaca, NY, USA
Unassigning myself.
relating the 2 related issues I created. 1 is fixed and π Run `composer validate` after FixtureManipulator commits its changes Fixed can be worked on separately
- πΊπΈUnited States tedbow Ithaca, NY, USA
Uploaded patch without the changes to the validator to test performance changes of just the manipulator changes.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Merged in latest
3.0.x
because several commits happened, let's see if this still passes tests.π Run `composer validate` after FixtureManipulator commits its changes Fixed is RTBC. I was going to propose to wait with this one until that one is done, but β¦ there is no conflict at all! π
#12: no observable performance impact! π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Drupal\Tests\package_manager\Kernel\TestStageValidationException: PHP temp directory (/tmp) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini
Re-testingβ¦
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This hard-blocks #3342227-17: [PP-1] ScaffoldFilePermissionsValidator should use ComposerInspector instead of ComposerUtility β and #3337760-25: [PP-1] ComposerPatchesValidator should use ComposerInspector instead of ComposerUtility β , as well as in principle all of the other remaining work falling under π Remove our runtime dependency on composer/composer: remove ComposerUtility Fixed .
- @tedbow opened merge request.
- Assigned to wim leers
- πΊπΈUnited States tedbow Ithaca, NY, USA
@Wim Leers if you want to take on working the new MR when you start your day please do. I am not sure I left it in good enough place where it would be obvious what the next steps are. If it is all nonsense I can take it back when I start tomorrow.
Sorry the code is a bit sloppy(altered drupalci.yml). I wanted to work quickly to see if this approach was feasible at rather than spend days before we figured out it wasn't
But we are down to a few tests failures so I think this approach will work and is better.
Thoughts on some of the remain failures.
- FixtureManipulatorTest I expected this to fail because we are updating the FixtureManipulator. I fixed a couple but have not look at the others
- OverwriteExistingPackagesValidatorTest which has edge cases where we set specific package install paths. Hard to do now but I have left a couple ideas on how to test this https://git.drupalcode.org/project/automatic_updates/-/merge_requests/74.... but also open for better ideas.
- ComposerUtilityTest I think would a similar problem to FixtureManipulatorTest because we were relying setting
install_path
here also - ComposerPatchesValidatorTest I fixed a bunch of test cases but haven't looked at the last one
So probably could be fixed the same way
- πΊπΈUnited States tedbow Ithaca, NY, USA
Create follow-up π Optimize Composer calls in FixtureManipulator Closed: works as designed . We will need a todo in the code
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Pushed this forward. AFAICT the failures in both
FixtureManipulatorTest
andComposerUtilityTest
are caused by the tests checking theinstall_path
functionality, because that's whatComposerUtility
uses.So we're in a chicken-egg situation where we would not have to fix these if
install_path
were just not used anymore (ComposerInspector
does not!).So I think the easiest solution is to remove
package_manager/tests/fixtures/FixtureUtilityTraitTest/existing_correct_fixture
and update the test to usefake_site
instead? - Assigned to tedbow
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
As discussed, @tedbow is tackling
FixtureManipulatorTest
right now πWeird, locally
ComposerPatchesValidatorTest
passesTesting started at 2:56 PM ... PHPUnit 9.5.28 by Sebastian Bergmann and contributors. Testing /Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel .............. 14 / 14 (100%) Time: 00:31.460, Memory: 10.00 MB OK (14 tests, 68 assertions) Process finished with exit code 0
β¦ but not on DrupalCI π¬
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I think I found the solution for
ComposerPatchesValidatorTest
while not strengthening rather than weakening test coverage! π€ Calling it a day though, so I really hope I'm right π Otherwise, feel free to revert my commits sincebc89d35a
, which did make it pass but still has weakened test coverage. - Assigned to wim leers
- πΊπΈUnited States tedbow Ithaca, NY, USA
Assigning to @Wim Leers if you want to take a look.
Of the 3 failing testing in https://www.drupal.org/pift-ci-job/2606788 β . (I did not see later results yet)
- DeleteExistingUpdateTest now passing for me locally. I expect it to pass. It was a problem that I had put an `composer update` call in the fixture we didn't need. This test hit it because it staged an update cancelled and retried.
- FixtureManipulatorTest : I haven't had chance to look at these.
- ComposerUtilityTest : I commented here https://git.drupalcode.org/project/automatic_updates/-/merge_requests/74... and started that idea. But I am done for the day.
If you want to try, you are welcome to otherwise I will give it a try tomorrow.
UPDATE: see results from https://www.drupal.org/pift-ci-job/2607522 β that InstalledPackagesListTest is now failing π€¦πΌ
Here is commit with just a comment about this https://git.drupalcode.org/project/automatic_updates/-/merge_requests/74... different tests failed on this 1 line.π
- Assigned to tedbow
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
The first test run with
FixtureManipulatorTest
green is a fact! πππLocally, all tests failing on DrupalCI now pass except for:
ComposerUtilityTest
andComposerPatchesValidatorTest
.Leaving those to @tedbow.
PRETTY PLEASE HAVE THIS COMMITTED by the time I wake up π₯Ίπ₯Ίπ₯Ίπ₯Ί
- Status changed to RTBC
almost 2 years ago 5:01am 3 March 2023 - πΊπΈUnited States tedbow Ithaca, NY, USA
re #24 @Wim Leers
Leaving those to @tedbow.
PRETTY PLEASE HAVE THIS COMMITTED by the time I wake up π₯Ίπ₯Ίπ₯Ίπ₯Ί
Assuming this passes tests I am going to commit this. But since I am the one also who do the last work
@Wim Leers
PRETTY PLEASE HAVE REVIEW THE CHANGES SINCE YOUR LAST COMMIT πππππππBeside getting the last tests, passing it has been a lot of comment with todos. the major new part is in OverwriteExistingPackagesValidatorTest look for
// Confirm that meta-package will have an install path that is the same
@Wim Leers you also have commit access so you could revert it if need be.
-
tedbow β
authored 912f3d89 on 3.0.x
Issue #3343827 by tedbow, Wim Leers: Update FixtureManipulator to work...
-
tedbow β
authored 912f3d89 on 3.0.x
- Assigned to wim leers
- Status changed to Fixed
almost 2 years ago 5:13am 3 March 2023 - Assigned to tedbow
- Status changed to RTBC
almost 2 years ago 11:05am 3 March 2023 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π I reviewed it, all looks fine! In any case, there cannot be any doubt that this MR is a huge leap forward, and the follow-ups you created for refinements ensure it'll get better still π
Attached is a follow-up patch with nits fixed β assigning to @tedbow to review since he already knows this MR inside/out.
Since this MR, kernel tests roughly take ~1 min longer (from ~250 seconds to ~310 seconds), that seems totally reasonable for the added confidence! π π For test performance: bundle FixtureManipulator's `composer require` + `composer require --dev` calls Closed: duplicate will narrow that gap further.
Unpostponed:
- π ComposerPatchesValidator should use ComposerInspector instead of ComposerUtility Fixed
- π Tighten ComposerPluginsValidator: support only specified version constraint Fixed
- π ScaffoldFilePermissionsValidator should use ComposerInspector instead of ComposerUtility Fixed
This means that we should now be able to completely finish π Remove our runtime dependency on composer/composer: remove ComposerUtility Fixed ππ
-
Wim Leers β
authored a6d7f994 on 3.0.x
Issue #3343827 by tedbow, Wim Leers: Clean-up
-
Wim Leers β
authored a6d7f994 on 3.0.x
- Issue was unassigned.
- Status changed to Fixed
almost 2 years ago 1:38pm 3 March 2023 - πΊπΈUnited States tedbow Ithaca, NY, USA
@Wim Leers thanks for the clean up patch! Committed
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This unblocked π Optimize Composer calls in FixtureManipulator Closed: works as designed .
Automatically closed - issue fixed for 2 weeks with no activity.