Problem/Motivation

Support for Drush 12 isn't just natively happening. Let's fix that.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

heddn created an issue. See original summary.

heddn’s picture

Status: Active » Needs review
StatusFileSize
new14.63 KB

Status: Needs review » Needs work

The last submitted patch, 2: 3372643.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new15.21 KB
new602 bytes
heddn’s picture

StatusFileSize
new15.03 KB
new602 bytes
dinarcon’s picture

Thanks for working on this!

I applied the patch and got the migrate_tools versions of the commands while using Druah 12. Per https://www.drush.org/12.x/commands/#attributes-or-annotations it says either PHP8 Attributes or Annotations are valid ways to declare a command. The current patch adds PHP8 Attributes on top of the existing Annotations. Shall we remove the latter?

For the record, I tested removing the PHP8 Attributes and the commands indeed worked with just the annotations. I guess my questions is if migrate_tools should try to match the PHP requirements from the Drush versions that it supports. Per https://www.drush.org/12.x/install/#drupal-compatibility, Drush 12 requires PHP 8.1. If we keep the annotation version only, we can support Drush 11 and 12 at the same time without requiring PHP 8.1, right?

heddn’s picture

I ran a few more tests of various version combinations. I'll have to update the project page to list the supported version combinations. But Drush 11 and 12 and PHP 7.4/8+ all seem to work together. Drush 10 doesn't seem to be functional at this point, but that was EOL months ago. I think we're good to commit this.

  • heddn committed 748cc794 on 6.0.x
    Issue #3372643 by heddn, dinarcon, moshe: Drush 12 support
    

heddn credited moshe.

heddn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

norman.lol’s picture

The command is supposed to live inside src/Drush/Commands/.

See https://www.drush.org/12.x/commands/

  1. Drush 12 expects commandfiles to use a create() method to inject Drupal and Drush dependencies. Prior versions used a drush.services.yml file which is now deprecated and will be removed in Drush 13.
  2. Drush 12 expects all commandfiles in the <module-name>/Drush/<Commands|Generators> directory. The Drush subdirectory is a new requirement.

We should reopen and fix it.

norman.lol’s picture

StatusFileSize
new1.61 KB
norman.lol’s picture