Problem/Motivation
Follow up to #3344039: Add a validate() method to ComposerInspector to ensure that Composer is usable
I talked to @effulgentsia about this and he agreed it would be reasonable for us to require that the composer project pass validation in order to use Package Manager.
Proposed resolution
Add a composer validate command to \Drupal\package_manager\ComposerInspector::validate. This will make sure that no other methods of ComposerInspector are usable unless you have usable valid set-up.
#3344127: Run `composer validate` after FixtureManipulator commits its changes to see the command needed to run validation
Depending on how we solve #3312960: Create an API for base requirement validators which run before other validators and stop event propagation if they fail this will mean that no other validator that uses Composer will have to deal with invalid setups.
Remaining tasks
Issue fork automatic_updates-3344595
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tedbowComment #3
kunal.sachdev commentedComment #5
wim leersThe scope of this issue is not entirely clear to me.
AFAICT the direction that you proposed at #3312960-33: Create an API for base requirement validators which run before other validators and stop event propagation if they fail means much of what this issue's title implies would be covered by that? So AFAICT this issue's scope is broader: it's saying that in case of
composer validatefailing, we should not even bother continuing?If that's the case, doesn't that mean that #3312960: Create an API for base requirement validators which run before other validators and stop event propagation if they fail becomes obsolete? 🤔 (Other than re-running
composer validateto be absolutely certain, but that seems pointless?)Comment #6
phenaproximaComment #7
phenaproximaRe #5: I don't think this is broader than #3312960: Create an API for base requirement validators which run before other validators and stop event propagation if they fail.
All this would do is ensure that any public methods of ComposerInspector are running from a sane state. It would not account for other conditions not related to Composer (like whether we have enough disk space, are in a multisite, Packgae Manager disabled by an environment variable, etc.) All of that would be covered by the other issue.
I'm re-titling for clarity.
Comment #8
wim leers🤞
Comment #9
phenaproximaComment #10
rohan-sinha commentedReviewed the latest MR, and found that issue has been fixed, able to validate the composer.
Will move to RTBC done once the tests completes.
Comment #11
tedbowLooking good, just a couple things
Comment #12
tedbowLooks good!
Comment #13
phenaproximaComment #15
phenaproxima