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

Command icon 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

tedbow created an issue. See original summary.

tedbow’s picture

Title: The Composer project must pass validation in order to user Package Manager » The Composer project must pass validation in order to use Package Manager
Issue summary: View changes
kunal.sachdev’s picture

Assigned: Unassigned » kunal.sachdev

wim leers’s picture

The 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 validate failing, 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 validate to be absolutely certain, but that seems pointless?)

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Title: The Composer project must pass validation in order to use Package Manager » ComposerInspector::validate() should run `composer validate`

Re #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.

wim leers’s picture

🤞

phenaproxima’s picture

Assigned: kunal.sachdev » tedbow
Status: Active » Needs review
rohan-sinha’s picture

Reviewed the latest MR, and found that issue has been fixed, able to validate the composer.
Will move to RTBC done once the tests completes.

tedbow’s picture

Assigned: tedbow » Unassigned
Status: Needs review » Needs work

Looking good, just a couple things

tedbow’s picture

Status: Needs work » Reviewed & tested by the community

Looks good!

phenaproxima’s picture

phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.