Add new setting for how unattended updates will be run

Created on 11 May 2023, over 1 year ago
Updated 2 June 2023, over 1 year ago

Problem/Motivation

Right now we have 1 setting automatic_updates.settings.cron which has 3 values disabled, patch and security
But since πŸ“Œ Add Drush command to allow running cron updates via console and by a separate user, for defense-in-depth Fixed there are 2 ways to run cron

Proposed resolution

Settings

Remove automatic_updates.settings.cron in favor of 2 new settings

  1. automatic_updates.settings.unattended.method which will currently have 2 possible values: background, console

    I am not sure "background" is the best but I don't to be "cron" because in πŸ“Œ For web server dependent unattended updates run the entire life cycle in a separate process that will not be affected by hosting time limits Fixed is going separate from cron.
    I would like "console" also not be "drush" so that if have both symfony console or drush options the admin doesn't have to switch the setting both should work if automatic_updates.settings.method === "console"

  2. automatic_updates.settings.unattended.level
    This would could be either: disabled, patch or security

No it doesn't. See #8.

Hook requirements/status report

βœ… Change how \Drupal\automatic_updates\Validation\StatusCheckRequirements::getRequirements to NOT run the status checks directly but used the cached version. This is because running the status checks as the web user would likely cause validation errors if the file system is not writable because the admin choose to use the console option. This will also help with πŸ› [PP-1] \Drupal\automatic_updates\Validation\StatusCheckRequirements makes admin/reports/status 10x slower! Postponed , since we would usually be using cached results.

βœ… Only show the Rerun readiness checks now now link on the status report if the user has selected the "background"

AutomaticUpdatesCommands

βœ… Update \Drupal\automatic_updates\Commands\AutomaticUpdatesCommands::autoUpdate to run the status checks which will cache them.
If there is an update the status checks should be run after the update. The same checks will be run in pre-create. If there is no update the status checks should always be run.

automatic_updates_cron

βœ… In automatic_updates_cron we should only run the status if both these are true:

  1. automatic_updates.settings.method === "webserver"(or whatever name we use)
  2. The process is not CLI.

    The CLI run might have different file permissions

Remaining tasks

In πŸ“Œ Enable unattended updates Fixed we would actually provide the form for these settings
and probably add some help text

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

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

Comments & Activities

Production build 0.71.5 2024