Please DO NOT push to this branch. See How to Help for instructions for working in the contrib module.
The latest work for Automatic is happening in the Automatic Updates Contrib module. There is conversion process but it is not being run constantly so the contrib module is the place for now to review the latest code see #30(should we just postpone?)
The latest work for Package Manager is happening in the Automatic Updates Contrib module. There is conversion process but it is not being run constantly so the contrib module is the place for now to review the latest code see #37(should we just postpone?)
#3319030: Drupal Core Roadmap for Package Manager and Update Manager
Problem/Motivation
Automatic Updates is one of Drupal Core current strategic initiatives. For full details of the initiative, see #2940731: Automatic Updates Initiative overview and roadmap.
Currently the work on the module is happening in 3.1.x branch of the Automatic Updates contrib module.
This issue is to bring in the current version of the 3.1.x branch of the contrib module into core as an Alpha level experimental module.
Proposed resolution
This merge request also includes the Package Manager module which it depends on from #3346707: Add Alpha level Experimental Package Manager module
The merge request on this issue is created automatically from the 3.1.x branch of the contrib module.
Since this is will be a very large merge request we will continue to create issues and make improvements in the contrib module 3.1.x branch and convert that work via the conversion script to commits here. @tedbow or @phenaproxima will make the conversion daily if there are commits to the contrib module.
#3346707: Add Alpha level Experimental Package Manager module will have to be committed first, but this issue is open so that reviewers of that issue can see the Package Manager's API in use by Automatic Updates.
What does Automatic Updates do?
Package Manager does the underlying heavy lifting of automatic updates (that is, copying the codebase to a sandbox, making changes there, then bringing those changes back into the main codebase), but it provides no UI of its own. Package Manager has some basic restrictions about changes that can be made via Composer. For example it will check the at all Drupal extensions are secure and supported.
Here's what Automatic Updates itself does:
- Provides a UI. It replaces the core Update module forms with a form that lists available updates and invokes Package Manager to kick off an update, assuming all the required preconditions are met. For example, a number of constraints are enforced here: are you on a stable release of core (you cannot update from a dev snapshot)? Is the filesystem writable? Once you start an update, Automatic Updates sets up a batch job for it, which calls Package Manager as needed to guide the user through the process. If a user updates in the UI, they also have the option to the next minor version of core (for example, from 10.1.3 to 10.2.0) -- although, for safety's sake, this functionality has to be enabled by a config flag.
- Provides the ability to do updates in the background, unattended. They can either be kicked off by Automated Cron (or the /system/cron page), or by an additional crontab entry that calls a terminal command we supply,
core/scripts/drupal. The benefit of this is security -- it allows the codebase to be modified by a different system user than whichever one the web server runs as. The trade-off is that it's more complicated to set up. Background updates are more tightly scoped than UI updates -- when doing a background update, you can only update to new patch releases in the same minor, since updating across minors is riskier. Background updates can also be configured to happen only if there's a new security update -- this is the default behavior, because we're assuming that your main goal, as a site maintainer, is to keep Drupal secure. Background updates will not update if the update needs database updates, though a email will be sent explaining this if happens. - If background updates fail, or cannot be started at all due to unfulfilled preconditions, Automatic Updates will notify the site owners by email. It will also notify the site owners when a background update is successfully completed.
- One thing Automatic Updates doesn't do is update contrib modules and themes. There are some unresolved problems with this, and it's not in scope for the initiative. The functionality does exist in contrib, as the Automatic Updates Extensions module. (Currently this is a submodule of Automatic Updates, but will be a separate project in contrib once Automatic Updates is in core.)
- Another caveat is that we don't allow background updates on Windows systems, because they have to be executed differently than on *nix environments. Since #3358248: [policy, no patch] Drop support for IIS in Drupal 11 we probably will never support background updates on Windows.
What can you update?
Automatic Updates only updates Drupal core in this first interation. It imposes many constraints on what versions of core you can update to and from. This isn't exhaustive, but here's the basic idea:
- You cannot update if you are running a dev snapshot of core.
- You cannot update to a different major version.
- You can't downgrade. That is not a thing in Drupal.
- You cannot update to a release of core that is unpublished, unsupported, or insecure.
Background updates have even more restrictions:
- You must be running a stable version of core to do a background update. You cannot be running an alpha, beta, or RC.
- You also have to be updating to a stable version of core. You can't update to an alpha, beta, or RC.
- You cannot do a background update to a newer minor version of core; there is too much of a risk of things breaking without your knowledge.
- You cannot do a background update to a version of core that has database updates. Because of the potential for serious breakage, you have to use the UI to do these sorts of updates. Unfortunately, this is something we can only detect while we're in the middle of the update (we statically analyze the incoming version of core to see if it has any database updates, and if it does, we delete the sandbox and fail with an error).
These rules are enforced by \Drupal\auto_updates\Validator\VersionPolicyValidator(). This is final class because we don't considered these rules an API.
How to test Automatic Updates
The easiest way to test Automatic Updates is to create a new Composer project from a slightly older version of Drupal. For example, composer create-project drupal/recommended-project:10.1.0.
You can then install Automatic Updates like any other module: composer require drupal/automatic_updates:^3@alpha. Since A
Once you install Drupal, go check for available updates. On the /admin/reports/updates/update, you should see an available update to Drupal 10.1.5 (or whatever is the current 10.1.x version when you test this), and a button to make it happen.
You can also test it at the command line by running vendor/bin/auto-update. By default, this will only update if the latest version of core is a security release; otherwise, it will say "no update available" and exit. To get around that, go to /admin/reports/updates/settings and "Unattended background updates" to "All patch releases". After that, running the auto-update command again should start an update to the latest version of core.
To test updating to the next minor version of core...create the project from Drupal 10.0.x (composer create-project drupal/recommended-project:~10.0.0), and install Drush. Once that's done, and you've installed Drupal, set a hidden config flag: drush cset automatic_updates.settings allow_core_minor_updates true. Then, when you visit /admin/reports/updates/update (you may need to force core to check for available updates first), you should see the option to update to the latest version of Drupal 10.1.x. Give it a try! (Note that the auto-update command will NEVER update across minor versions; it is strictly meant for updating between stable, patch-level releases in the same minor.)
How to help
Feel free to leave feedback on this merge request. If you would like to help address the feedback please search the 3.1.x issue queue to see if any existing issue exists and if not create one in that project.
User interface

Update form showing update for current minor

Update form showing update for current and next minor

Downloading update

Update is staged, no database updates

Update is staged, with database updates

Applying updates

Status report, no problem

Status report, example problem

Config setting on Update module form
Remaining tasks
Core bugs
- #3392196: Exceptions in batch no longer are shown on the page when Javascript is disabled: affects our functional tests. We have a possible fix for that issue in this merge requests to allow our functional tests to pass. The only reason core tests are not currently failing in HEAD is because Core currently has no test coverage for how errors are shown on batch form
Core Policy Questions
- Review the patch
- Framework manager sign-off
- Release manager sign-off
| Comment | File | Size | Author |
|---|
Issue fork drupal-3253158
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 #2
tedbowComment #4
tedbowComment #6
tedbowComment #7
phenaproximaAfter discussion in Slack with @tedbow and @AaronMcHale, I removed the
hidden: trueflag from Package Manager's info file. By doing this, we won't need to change existing core tests to make this merge request green.Here's the discussion from Slack, for reference:
Comment #8
tedbowAfter #7 I realized that Package Manager is just like the Serialization module. They both provide no UI and have no reason to be installed unless another module depends on them. The tricky part is that a module could check that they are enabled and add extra functionality if they are installed. So you can't say 100% there is no reason to have it on if another module doesn't list it as a dependency
Comment #9
tedbowComment #10
tedbowComment #12
phenaproximaCrediting @kunal.sachdev for contributions in the contrib version of this module.
Comment #13
tedbowComment #14
gábor hojtsyThe issue summary explains lots of technicalities about how the MR is produced, but not what the module is doing, the features, ie. why would this module be added to core. Is there another place where this is explained? Screenshots would also help to asses the extent of this issue as well as use for promoting it for review. Also, tips as to what to review would help in getting reviews.
Comment #15
gábor hojtsyAlso adding release manager tag, since that was already in the issue summary as a list item.
Comment #16
aaronmchaleMight be good to also do a final UX review before this is committed.
Comment #19
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #20
wim leersBecause Automatic Updates needs a comprehensive review, including a security review. But that means drupal.org's PHP-TUF support needs to be deployed, otherwise core committers would need to do multiple security review rounds: once for the Automatic Updates module, once for the d.o PHP-TUF support.
Follow #3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly if you want to be notified of when that is ready.
This is why the decision was made to aim to first land Package Manager (which provides the necessary infrastructure for Automatic Updates) as alpha-experimental in #3346707: Add Alpha level Experimental Package Manager module.
Comment #22
effulgentsia commented#3316617: Add a validator to check that PHP-TUF's Composer integration is present and configured correctly landed, so this now has only one blocker, #3346707: Add Alpha level Experimental Package Manager module, though that issue has several (see the top section of #3319030: Drupal Core Roadmap for Package Manager and Update Manager for details).
Comment #23
tedbowComment #24
phenaproximaComment #25
phenaproximaComment #26
phenaproximaComment #27
phenaproximaComment #28
tedbowComment #29
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #30
tedbowThe current merge request is not up-to-date with the work in the contrib module
There is automated script to convert module it but it is still a fair amount of work. For this reason and because we aren't actually getting reviews, nobody outside of the team working on the contrib module has commented since February, I am going stop running conversions.
If you want to review the code I would suggest reviewing the contrib module which the MR here has always been a automated conversion of. https://www.drupal.org/project/automatic_updates
When core reviewers have time especially the product, release and framework managers and if you would like to review the module here instead of the contrib module please contact me or comment here and I can run the conversion again.
I am tempted to postpone but I won't for now
Comment #31
tedbowComment #32
lauriiiComment #33
catchIt's hard to tell from the issue summary what work is remaining before AU is ready for alpha commit.
#3319030: Drupal Core Roadmap for Package Manager and Update Manager is now linked from the issue summary (it wasn't before), but it's not very scannable to see e.g. that #3392196: Exceptions in batch no longer are shown on the page when Javascript is disabled is blocking - I think it would be help to link those issues directly here - especially ones that will require changes to AU code but also any core bugs that aren't specific to AU.
Comment #34
tedbowComment #35
catchThe MR is green again, should this be needs review? If not, what is blocking a review here?
Comment #36
tedbowComment #37
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #38
tedbowPushing up the new conversion.
I do expect
\Drupal\Tests\package_manager\Kernel\StageBaseTest::testDestroyDuringApplyto fail. There is some serialization problem that is not happening the contrib module against 11.x. Not sure whyBut I think it is still reviewable
Comment #39
tedbowAdded screenshots
Comment #40
tedbowRemoving "[PP-1] " not postponed as far as reviewing. #3346707: Add Alpha level Experimental Package Manager module still needs to be committed first
Issue summary clean-up
Comment #41
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #42
catch#3346707: Add Alpha level Experimental Package Manager module is in.
At and after DrupalCon Barcelona, we discussed that instead of renaming 'Automatic updates' to 'auto_updates' for core, we should instead rename it to 'Update Manager'. The main reason for this was that a lot of experienced developers are sceptical about 'automatic updates' in the sense of unattended, and might not even look at this if they assume all it does. But the module also does 'attended updates' which will run the various composer commands locally, and then developers can commit composer.lock changes and deploy from their without anything automatic happening on production. Update manager is more neutral from that standpoint.
The secondary and even longer term reason is that some point we may want to merge or otherwise clarify the relationship between update status and update manager. In HEAD update status includes 'update manager' tarball support which is very much deprecated and confuses things even further, but without that, one gives you statuses about updates, and one manages the updates - it's not too bad considering the somewhat crowded namespace area with package_manager and project_browser on top.
Comment #43
andypostUpdate manager+++
Comment #44
gábor hojtsyUpdate Manager sounds good and is in line with the rest of the core and contrib features in this area. Also with Package Manager.
Comment #45
dww+1 to not calling the new thing “auto”. Side note, +1 to make it so it can be configured to only update when a human says so, and never “automatically”.
However, for what it’s worth, “Update Manager” is already the human name for update.module in core. Once upon it time (D5 contrib) it was called “Update status”. When moved into core in D6, Dries wanted it called “Update Manager” since he had dreams of it actually updating your site. Those dreams were (partially) realized in D7 when we added all the authorize.php stuff and contrib updating. The machine name is still only
update, but help text, .info.yml name, and reams of documentation and countless issues & comments all call it “Update manager”.So, if we go forward calling the renamed auto_updates “Update manager”, we have to pick from:
Comment #46
dwwTo vote on my own poll from the previous comment, I’m totally fine with option #2 and changing the human readable name of update.module back to “Update status”, add CR and release notes, fix documentation, and hope for the best that it won’t be too confusing. But I don’t personally have time or any funding to do all that work myself. so if y’all decide that’s best, I’d appreciate some help getting it all done. Thanks!
Comment #47
gábor hojtsyIndeed, good point! I think renaming the existing one's human readable name back to Update Status is a good way forward. Internally it reflects that naming already.
Comment #48
catchOption #2 sounds good. I know the authorize.php-related stuff was called update manager, but completely missed that was the human readable module name too.
Comment #49
dwwhttps://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/updat...
Comment #50
catchOpened #3483501: Rename update module back to Update Status.
Comment #51
dwwI opened an MR to get started on #3483501, but there are a bunch of open questions in the issue for release and/or framework managers to weigh in on. Thanks!
Comment #52
andypostwhat is a fate of
authorize.phpas it looks not deprecated yet?Comment #53
catch@andypost we need an issue to deprecate it, I thought there already is one, but I can't find it.
#3417136: Remove adding an extension via a URL removed installation via URL but not updates.
Comment #54
dwwSee #3483501-5: Rename update module back to Update Status where I asked similar.
Comment #55
catchTried and failed again to find an existing issue, so I went ahead and opened #3491731: [META] Remove the ability to update modules and themes via authorize.php.
Comment #56
andypostComment #57
dwwUpdate: both #3483501: Rename update module back to Update Status and #3491731: [META] Remove the ability to update modules and themes via authorize.php are now done, in time for 11.2.0-alpha1. So there's nothing in the legacy "Update Manager" to worry about for moving this forward.