Problem/Motivation
Currently we have the sub-module package_manager which a thin wrapper around the composer_stager php library.
Eventually the project_browser will probably also use package_manager(when it is core directly) to install it's modules
There are several reason why instead of just wrapping composer_stager package_manager should also handle some drupal specific task
- sites should be prevented from updating core and installing a new module at the same time
- classes like
\Drupal\automatic_updates\Validation\ValidationResultmay make sense to be shared - firing events before different stages might be shared functionality
- path exclusion. excluded public and private file folders and certain settings files will be the same in both cases.
Proposed resolution
Move common functionality that is not specific to updating Drupal core
For instance ComposerExecutableValidator may make sense to be in `package_manager`
\Drupal\automatic_updates\Updater make need to extend ComposerRunner in package manager.
On way we could do this is to have a test module that installs new Drupal modules so that we would have use case for both an installer and an updater. We could remove this test module when `project_browser` starts to have this functionality.
API changes
Probably a lot.
Issue fork automatic_updates-3244939
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 #3
tedbowComment #4
tedbowComment #5
tedbowAssuming we will want the
Updaterinject aStagedComposerservice and theStagedComposerwould responsible for firing events we might want some way for modules to identify their own events.For instance our
UpdateVersionValidatorshould only respond to our own uses ofStagedComposerone idea would be when the
UpdatercallsStagedComposer::begin()that it would have to send a operation name or just it's module name.So something like
StagedComposer::begin(['drupal' => 9.8.1], 'automatic_updates')and then have
UpdateEvent::getModule()orUpdateEvent::getOperationName()so then our
UpdateVersionValidatorcould havethat way each module only validates events for it's own operations.
I like
getOperationName()better thangetModule()because some modules may want to multiple different types of operationsComment #6
tedbowComment #7
tedbowComment #8
phenaproximaComment #9
tedbow🎉