I get this message when running migrations

[debug] pathauto should have an extra.drush.services section in its composer.json.
See http://docs.drush.org/en/master/commands/#specifying-the-services-file. [0.16 sec, 11.95 MB]

Comments

marcelovani created an issue. See original summary.

marcelovani’s picture

Status: Active » Needs review
StatusFileSize
new766 bytes

I just realised, the module didn't have a composer.json

Please review

idebr’s picture

shubham.prakash’s picture

StatusFileSize
new765 bytes

This patch should fixed the issue.

marcelovani’s picture

shubham, I can't see any difference between #3 and #1

shubham.prakash’s picture

Removed extra comma at the end of line 13, sorry for not uploading interdiff.

marcelovani’s picture

Cool, thanks

brayfe’s picture

I'm surprised this hasn't made more traction. After updating to Drush 9 in my build environments, I'm seeing this warning everywhere. A composer.json file is easy to add. I'm linking another, more recently logged, issue that also supplies a patch. I suggest a module maintainer review both and determine the most viable approach.

Hope to get this in soon!

jungle’s picture

StatusFileSize
new1.09 KB
+++ b/composer.json
@@ -0,0 +1,26 @@
+    "suggest": {
+        "redirect:redirect": "When installed Pathauto will provide a new \"Update Action\" in case your URLs change. This is the recommended update action and is considered the best practice for SEO and usability."
+    },

Should add the suggest section to match the project page's Recommended modules

+++ b/composer.json
@@ -0,0 +1,26 @@
+        "documentation": "https://www.drupal.org/docs/8/modules/pathauto",

Add documentation

+++ b/composer.json
@@ -0,0 +1,26 @@
+        "drupal/ctools": "^3.2",
+        "drupal/token": "^1.6"

Update required modules to a newer version

berdir’s picture

Status: Needs review » Needs work
  1. +++ b/composer.json
    @@ -0,0 +1,26 @@
    +    "suggest": {
    +        "redirect:redirect": "When installed Pathauto will provide a new \"Update Action\" in case your URLs change. This is the recommended update action and is considered the best practice for SEO and usability."
    +    },
    

    this doesn't seem right, this should be drupal/redirect? composer doesn't about drupal project/module naming.

  2. +++ b/composer.json
    @@ -0,0 +1,26 @@
    +    "extra": {
    +        "drush": {
    +            "services": {
    +                "drush.services.yml": "^9"
    +            }
    +        }
    +    }
    +}
    

    lets include drush 10 compatibility.

jungle’s picture

StatusFileSize
new1.09 KB
new914 bytes

Thanks @Berdir for reviewing!

Addressed #10

#10.1 yes, my bad. copied and pasted, did not notice that.

jungle’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Fixed

Thanks.

After more thinking, I'd prefer to not include the require definition for now. The generated information looks like this:

requires
drupal/core ^8.8 || ^9
drupal/ctools *
drupal/token *

Since we don't have any specific version requirement on those modules, I think that's good enough. Adding this would make it harder to e.g. test new major versions or so. Removed that part before committing. If we ever remove or add dependencies it's one place less to update.

  • Berdir committed 7933705 on 8.x-1.x authored by jungle
    Issue #3056567 by jungle, marcelovani, shubham.prakash, Berdir: Pathauto...
jungle’s picture

Re #13 I am good with that, the drupal composer repository does not rely on composer.json to compute the dependencies as I read from somewhere I could not remember. Please correct me if I were wrong.

If composer.json is used to compute dependencies, it's good to have dependencies under the require section. So that, on a fresh installation, running drupal require drupal/pathauto only could get those relevant modules ready at the same time. or have to expand the composer require command to include them.

berdir’s picture

Not quite sure what you mean. If it's not there, then it will be added to the generated information automatically, composer require drupal/pathauto will definitely install all required dependencies, the only exception would be if you don't use the drupal.org composer repository but install it directly from a git repository or so.

jungle’s picture

@Berdir, what I meant is I was good with the removal you've made during committing. And your comment #16, confirmed that without dependencies under the require section of composer.json, composer require drupal/pathauto will install all required dependencies, that's the main reason I did agree with the removal.

Thanks!

Status: Fixed » Closed (fixed)

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