Drush 12 deprecations

Created on 30 January 2024, 5 months ago
Updated 13 February 2024, 5 months ago

Problem/Motivation

Remaining tasks

  • Move Commands directory into a Drush directory
  • Adapt namespace in MailerCommands
  • Inject dependencies through the create() method
  • Adapt symfony_mailer.commands path in drush.services.yml
πŸ“Œ Task
Status

Needs work

Version

1.4

Component

Code

Created by

πŸ‡«πŸ‡·France MacSim

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

Merge Requests

Comments & Activities

  • Issue created by @MacSim
  • Merge request !85Issue #3417913: Drush 12 compatibility β†’ (Open) created by MacSim
  • Status changed to Needs review 5 months ago
  • Pipeline finished with Success
    5 months ago
    Total: 230s
    #84515
  • πŸ‡«πŸ‡·France MacSim

    Note: When we'll want to drop Drush 11 support, we'll just have to remove the drush.services.yml file.

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

    Great thanks. Did you test with both Drush 11 and 12?

    > Note: When we'll want to drop Drush 11 support, we'll just have to remove the drush.services.yml file.
    Please could you raise an issue?

  • Status changed to Needs work 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    AFAICS it works without this change in Drush 12. According to https://www.drush.org/12.x/commands/, the old way is deprecated in Drush 12 and will be removed in Drush 13. This change is still a good idea, it would be clearer to update the IS and title.

    To prove this patch works I suggest that we need a version that removes the services file. We won't commit it however we can check that it's working.

  • πŸ‡«πŸ‡·France MacSim

    @AdamPS

    Did you test with both Drush 11 and 12?

    Nope I didn't. I thought reviewers would do it.

    Please could you raise an issue?

    I can but I would say that it should be done in a 1.5.x version which doesn't exist right now.
    We would also need to add the following lines to the composer.json:

         "conflict": {
            "drush/drush": "<12"
         }
    
    AFAICS it works without this change in Drush 12.

    Did you tried to use the command on 1.4.1 with drush 12?
    Cause it should throw a "mailer:override command is undefined" error.

    The doc says that drush.services.yml is deprecated in drush 12 and will be removed in Drush 13.
    But it also says that

    • Drush 12 expects commandfiles to use a create() method to inject Drupal and Drush dependencies.
    • Drush 12 expects all commandfiles in the /Drush/ directory. The Drush subdirectory is a new requirement.

    Those changes are required to run a command with drush 12.

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

    Did you tried to use the command on 1.4.1 with drush 12?

    Yes it is working fine for me.

Production build 0.69.0 2024