Update deploy:pre-hook command to use batch system

Created on 24 November 2023, about 1 year ago
Updated 23 May 2024, 7 months ago

Problem/Motivation

The original deploy:pre-hook implementation passed the $sandbox variable to the deploy hooks to have the same signature as the post_update hooks. But we faked the batch process. However after using this for a while we found that it is necessary to do the batching in order to reduce the memory consumption that is unavoidable due to lots of static caches not being able to be cleared.

Relevant upstream drush issue: https://github.com/drush-ops/drush/pull/4800

Steps to reproduce

Create a hook_predeploy_NAME(&$sandbox) implementation which is fairly long running/memory intensive e.g. loading all the entities you have in the system and manipulating it and you'll likely run out of memory.

Proposed resolution

Use the batch system API instead.

Remaining tasks

Provide issue fork/patch.

API changes

The use of:

drush:
  include:
  - ${env.PWD}/web/modules/contrib/drush_pre_deploy/src/global

is somewhat redundant and will be deprecated in the future, and we can make the command/hook automatically available by registering it within the DrushCommands namespace as a PSR4 declaration in the composer.json file.

Data model changes

N/A

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024