Finish deprecating 'Update Manager' related code in Update Status

Created on 24 April 2025, 27 days ago

Problem/Motivation

While grepping for ๐Ÿ“Œ Rename update module back to Update Status Active and looking around, I noticed a few more spots in core/modules/update that are code for the old authorize.php 'Update Manager' that we missed during ๐Ÿ“Œ Deprecate authorize.php and the FileTransfer system Active

Steps to reproduce

Proposed resolution

Deprecate the following:

  1. The update.root service and src/UpdateRoot.php
  2. _update_manager_extract_directory()
  3. _update_manager_cache_directory()
  4. update_clear_update_disk_cache()
  5. update_delete_file_if_stale()

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

update.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States dww

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

Merge Requests

Comments & Activities

  • Issue created by @dww
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww
  • Pipeline finished with Failed
    27 days ago
    Total: 189s
    #481510
  • Pipeline finished with Failed
    27 days ago
    Total: 203s
    #481527
  • Pipeline finished with Failed
    27 days ago
    Total: 183s
    #481530
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    Minor comments.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Thanks! Applied suggestions. Leaving the thread about moving the test into a new class open to see if anyone else has a strong opinion.

  • Pipeline finished with Failed
    27 days ago
    #481658
  • Pipeline finished with Failed
    27 days ago
    Total: 159s
    #481665
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Thanks to our new gitlab bug I can't drill down into the test failures.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    There are no failures. The failure was the pipeline never started. Longwave and Drumm seem to have sorted it out.
    Iโ€™ll push a no-op commit to hopefully trigger a new pipeline.

  • Pipeline finished with Failed
    26 days ago
    Total: 782s
    #482121
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Yay, the pipeline really ran. However, there seem to be failures, after all. ๐Ÿ˜‚ Iโ€™ll look more closely when Iโ€™m at my laptop.

  • Pipeline finished with Success
    26 days ago
    Total: 5228s
    #482183
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Was calling the deprecated method from hook cron, which caused any tests that enable update.module and invoke cron to trigger deprecation notices. Removed that from cron, and now the pipeline is all green. Back to NR.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    What is the full status of this initiative? Does this change need a CR?
    If this piece is just clean up then I think we're ok, however, since we're deprecating things I think we need to notify people that disk cleanup won't happen anymore.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    All the new deprecations reference the CR from the parent issue. If weโ€™re happy and this lands, Iโ€™ll update that CR to mention these other deprecations. Assuming this ships in 11.2, seemed silly to use a separate CR for it. See the parent issue and linked CR for more.

    Thanks!
    -Derek

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    p.s. This specific disk cache cleanup method is only cleaning up a cache of tarballs downloaded for the deprecated and removed โ€œUpdate Managerโ€ stuff. So nothing would be populating this cache, so no need to garbage collect it.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    12 answers my question, I thought that was true, but wanted confirmation.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    To make #11 explicit, adding the tag. I hereby solemnly swear to make the updates once this is committed...

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Added a remaining task, probably for release managers:

    Decide if we should explicitly mark the allow_authorize_operations setting itself deprecated in sites/default/default.settings.php and core/assets/scaffold/files/default.settings.php

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    Do you want to just do it to be safe? Or open a follow up? I'm hesitant to mark this as ready until then.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Added a few more remaining tasks for decisions, and tagging for release manager review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Per @berdir in Slack, ๐Ÿ“Œ Convert Convert Template Preprocess hooks in core/includes Active is related. We also forgot the authorize-report template and preprocess. I pushed 2 commits for those, 1 to properly deprecate the template and preprocess, and another to add @deprecated comments to authorize-report.twig.html files (both system and stable9). Can revert the last one if that's not desirable for some reason.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Add authorize-report to summary, and move the list of deprecations to the API changes section.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance andypost

    I find it better to file specific CR as all this changes make sense and disruptive enough to reference for developers, moreover summary is perfect!

  • Pipeline finished with Success
    21 days ago
    Total: 4371s
    #486173
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Regarding point #2. Having a change record associated with the single issue where the change was made makes sense. It is then easier for anyone who wants to know more to read that one issue instead of searching several issues. The text of the change record can always add a reference to other issues.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    That's 2 votes in favor of a new CR for this issue. Created https://www.drupal.org/node/3522119 โ†’ and moved all the deprecations to point there. Removing the tag.

    Noticed I also missed _update_manager_unique_identifier(). That's not used for the fetch URL to be able to aggregate anonymous usage stats per site. It's only used for the name of the disk cache subdirectories.

  • Pipeline finished with Success
    21 days ago
    #486332
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    _update_manager_unique_identifier doesn't need to be deprecated though, it starts with an underscore.

    Maybe we need an issue to track everything that should be deleted outside the deprecations?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    For the final point 3. I think we do want a post update hook but that would be part of drupal 12, so maybe a follow up for that, you want it to run after you cannot possibly add new files there.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Re #23: see ๐Ÿ“Œ [12.x] Remove all legacy code related to authorize.php and FileTransfer Postponed from 2 parent issues up. Yeah, we probably donโ€™t *need* to deprecate all of this, but it seems safer to be complete at this point.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Yes a follow-up for #24 for once Drupal 12 is open sounds good.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    I'm not convinced the post_update() needs to be in 12.0. We've already removed all the UI that could trigger any of the code paths that put files in these temp directories. Some of that shipped in a previous release, the rest will be in 11.2.0. Can't we have a post_update() in 11.2 itself that removes these directories? Why leave them around for years? We mention cleaning them out at the CR. Probably also would in release notes. Why wait another major release for a post_update() to automate that? Once a site is running 11.2.0 or higher, nothing could be populating these directories unless we now believe there are contribs or custom code out there using any of this plumbing. Seems like those folks are on their own, and can be responsible for removing the directories again when they're really done.

    But core will already be done the moment we're on 11.2.0. So if we're going to do a post_update() at all, seems best to do it right here in this issue.

    Meanwhile, any release manager thoughts on remaining task #1: allow_authorize_operations setting?

    Thanks!
    -Derek

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Re point #1: allow_authorize_operations setting:

    My proposal would be to remove it from the default.settings.php files for new sites, but not formally "deprecate" the setting and generate warnings if sites have used it to opt-out of the Update Manager already. No real harm in leaving it in settings.php files, even if it's being ignored, right?

    Maybe that is worth a D12 follow-up to formally deprecate the setting and trigger warnings about still having it defined?

  • Pipeline finished with Failed
    20 days ago
    Total: 634s
    #486835
  • Pipeline finished with Canceled
    20 days ago
    Total: 385s
    #486871
  • Pipeline finished with Failed
    20 days ago
    Total: 543s
    #486873
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Per Slack discussion with @nicxvan, decided to:

    • Add update_post_update_clear_disk_cache() here to clean out the cache already. Then we don't have to mention that in any release notes. Updated the CR accordingly.
    • Added a note to ๐Ÿ“Œ [12.x] Remove all legacy code related to authorize.php and FileTransfer Postponed about a duplicate post_update in D12 once all the code is also gone, just in case.
    • Remove allow_authorize_operations from default.settings.php.

    I'm reluctant to already deprecate the setting. In theory, if any contrib or custom code is still using any of the deprecated code paths, the allow_authorize_operations killswitch still might be validly preventing weirdness. So we don't want people to remove that from their settings.php files until all the code that it kills is already dead and gone. Wearing my former security team hat, any site that already used $settings['allow_authorize_operations'] = FALSE; gets a gold star for wanting to manage their site code in a better way. I don't want to nag them to remove that killswitch until we're absolutely sure nothing is relying on it.

  • Pipeline finished with Success
    20 days ago
    Total: 627s
    #486887
  • Pipeline finished with Failed
    20 days ago
    Total: 164s
    #486896
  • Pipeline finished with Success
    20 days ago
    Total: 1418s
    #486903
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I think it's OK to do ๐Ÿ“Œ [pp-1] [12.x] Deprecate the 'allow_authorize_operations' setting Postponed , the point about waiting to bother people who already opted out makes sense.

    #27 is a good point, if we don't think anything can populate those directories, might as well remove in 11.2

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Great, thanks! Crossed 1 off the remaining tasks.

    Last point that needs a decision is remaining task 4:

    Decide if update_post_update_clear_disk_cache() needs automated tests.

    Then I think a release manager can remove the โ€œ Needs release manager reviewโ€ tag and this could be RTBC.

    Thanks!
    -Derek

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I don't think we need explicit test coverage for that - we have implicit test coverage in that the update will run during update tests. Removing the RM review tag.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Great, thanks again!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nicxvan

    This looks great, I confirmed it deprecates what it claims, all messages look right.
    Confirmed the CR outlines all deprecations.
    All deprecation messages look correct.

    • catch โ†’ committed 28357f55 on 11.x
      Issue #3521059 by dww, nicxvan: Finish deprecating 'Update Manager'...
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Some of the methods here probably don't really need deprecating, like underscored functions, but also deprecating them means we don't need to find them all again to remove in 12.0.0 and it doesn't do any harm.

    Committed/pushed to 11.x, thanks!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States dww

    Fantastic, thanks!

    I published the CR โ†’ . I also added a note to the 1st Update Manager deprecation CR โ†’ to link to this CR.

    Glad this landed so we can cleanly remove all this stuff once 12.x is open. ๐ŸŽ‰

    Thanks again!
    -Derek

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024