Allow attended core updates to skip sandboxing

Created on 20 May 2025, 16 days ago

Problem/Motivation

In Drupal core 11.2, Package Manager has added support for a "direct-write" mode, which allows changes to be made directly on the live site: ✨ Make Package Manager more friendly to local development by allowing stages to operate directly on the codebase in some situations Active

Individual implementers of Package Manager need to specifically opt into it for it if they want to support it. Automatic Updates implements three different types of sandbox:

  1. Unattended core updates
  2. Attended core updates
  3. Attended contrib updates (Automatic Updates Extensions)

This issue is solely to consider the benefits and risks of adding direct-write support to #2 (attended core updates).

✨ Feature request
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Comments & Activities

  • Issue created by @phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Attended updates only update Drupal core. They always have a human in the loop (that's what makes them "attended"), and they are the equivalent of running the following:

    composer require drupal/core-recommended:NEW_VERSION --no-update
    composer update --with-all-dependencies --optimize-autoloader --minimal-changes drupal/core-recommended:NEW_VERSION
    

    The risk here is that installed contrib extensions could be updated, although --minimal-changes should, well, keep that to a minimum. But if there are bad and dangerous constraints in the site's composer.json (e.g., unbounded constraints like drupal/pathauto:>=1), then this could immediately break a site if done in direct-write mode.

    One possible mitigation here is for Automatic Updates (or maybe just Package Manager itself) to refuse to even start the update process in direct-write mode if any unbounded constraints are present.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    Not to be a broken record, but I hope "direct-write" means "add to the queue for the cron job that runs as the user that owns your files" in the security-in-depth world where httpd does not have direct write access to your codebase, right? πŸ˜…

  • πŸ‡¬πŸ‡§United Kingdom catch

    @dww I think we need a new issue for that. There is a console command that can do unattended updates (I think) and an issue to document it, but I don't think there's an issue for queuing attended updates. We'd also need an equivalent issue for project browser to add similar functionality there for adding new code too.

Production build 0.71.5 2024