Giter Club home page Giter Club logo

ddev-drupal-contrib's Introduction

DDEV logo with light and dark mode variants

CircleCI project is maintained Gitpod Ready-to-Code Open in GitHub Codespaces

DDEV is an open-source tool for running local web development environments for PHP, Python and Node.js, ready in minutes. Its powerful, flexible per-project environment configurations can be extended, version controlled, and shared. DDEV allows development teams to adopt a consistent Docker workflow without the complexities of bespoke configuration.

Documentation

To check out live examples, docs, contributor live training, guides and more visit ddev.com and ddev.readthedocs.io

Questions

If you need help, our friendly community provides great support.

Wonderful Sponsors

DDEV is an Apache License 2.0 open-source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider sponsoring DDEV development.

DDEV Sponsor logos with light and dark mode variants

Contributing

See “How can I contribute to DDEV?” in the FAQ, and the Contributing page.

Overview of GitHub contributions

Get Started

  1. Check System Requirements: macOS (Intel and Apple Silicon), Windows 10/11, WSL2, Linux, Gitpod, and GitHub Codespaces.
  2. Install a Docker provider and DDEV.
  3. Try a CMS Quick Start Guide.

Additionally, https://ddev.com/get-started/ provides an up-to-date getting-started guide.

Highlighted Features

  • Quickly create local web development environments based on code repositories, with minimal configuration.
  • Import a database to any of your local environments.
  • Import upload files to match the project (e.g. Drupal sites/default/files or WordPress wp-content/uploads).
  • Customizable integration with hosting platforms like Platform.sh, Pantheon, Acquia and others.
  • Run commands within the Docker environment using ddev exec.
  • View logs from the web and database containers.
  • Use ddev ssh to explore the Linux environment inside the container.
  • List running projects with ddev list.
  • Snapshot databases with ddev snapshot.
  • Temporarily share your development website with others using ddev share.
  • Create custom commands as simple shell scripts.
  • Enjoy effortless, trusted HTTPS support.
  • Extend and customize environments as much (or as little!) as you need to.

Run ddev to see all the commands.

ddev-drupal-contrib's People

Contributors

claudiu-cristea avatar donquixote avatar gitressa avatar jonhattan avatar kekkis avatar kreynen avatar markdorison avatar mscieszka avatar pcambra avatar rfay avatar tyler36 avatar weitzman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ddev-drupal-contrib's Issues

Compatibility with new Ddev 1.23.0 `type: drupal`

Ddev 1.23.0 introduced a new generic type: drupal and deprecated type: drupal10.

If you update your ddev config using the recommended method, the type will be changed automatically:

ddev config --update
You are reconfiguring the project at /path/to/contrib_module_name.
The existing configuration will be updated and replaced.
Auto-updating project configuration because update is requested.
Configuring a 'drupal' project with docroot 'web' at /path/to/contrib_module_name/web
Configuration complete. You may now run 'ddev start'.

If you then restart and try to run ddev poser, it detects the wrong Drupal version (Drupal 9 is detected, but cannot be installed due to requirements).

ddev poser
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6310  100  6310    0     0   9186      0 --:--:-- --:--:-- --:--:--  9184
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/core-recommended 9.1.0-rc1 requires laminas/laminas-feed 2.12.3 -> satisfiable by laminas/laminas-feed[2.12.3].
    - drupal/core-recommended[9.1.0-rc2, ..., 9.1.x-dev] require laminas/laminas-feed 2.13.0 -> satisfiable by laminas/laminas-feed[2.13.0].
    - drupal/core-recommended 9.2.0-alpha1 requires laminas/laminas-feed 2.14.0 -> satisfiable by laminas/laminas-feed[2.14.0].
    - drupal/core-recommended[9.2.0-beta1, ..., 9.2.x-dev] require laminas/laminas-feed 2.14.1 -> satisfiable by laminas/laminas-feed[2.14.1].
    - drupal/core-recommended[9.3.0-alpha1, ..., 9.3.x-dev] require laminas/laminas-escaper 2.9.0 -> satisfiable by laminas/laminas-escaper[2.9.0].
    - drupal/core-recommended[9.4.0, ..., 9.5.8] require laminas/laminas-feed ~2.17.0 -> satisfiable by laminas/laminas-feed[2.17.0, 2.17.x-dev].
    - drupal/core-recommended[9.4.0-alpha1, ..., 9.4.0-rc2] require laminas/laminas-feed 2.17.0 -> satisfiable by laminas/laminas-feed[2.17.0].
    - drupal/core-recommended[9.0.13, ..., 9.0.x-dev] require typo3/phar-stream-wrapper v3.1.4 -> satisfiable by typo3/phar-stream-wrapper[v3.1.4].
    - drupal/core-recommended[9.1.0-alpha1, ..., 9.1.0-beta1] require typo3/phar-stream-wrapper v3.1.5 -> satisfiable by typo3/phar-stream-wrapper[v3.1.5].
    - drupal/core-recommended[9.0.0, ..., 9.0.12] require symfony/routing v4.4.9 -> satisfiable by symfony/routing[v4.4.9].
    - drupal/core-recommended[9.0.0-beta3, ..., 9.0.0-rc1] require symfony/console v4.4.8 -> satisfiable by symfony/console[v4.4.8].
    - drupal/core-recommended[9.4.15, ..., 9.5.x-dev] require longwave/laminas-diactoros ~2.14.2 -> satisfiable by longwave/laminas-diactoros[2.14.2, 2.14.x-dev].
    - drupal/core-recommended 9.0.0-alpha1 requires composer/installers v1.7.0 -> satisfiable by composer/installers[v1.7.0].
    - drupal/core-recommended[9.0.0-alpha2, ..., 9.0.0-beta2] require composer/installers v1.8.0 -> satisfiable by composer/installers[v1.8.0].
    - laminas/laminas-feed[2.12.2, ..., 2.12.x-dev] require php ^5.6 || ^7.0 -> your php version (8.3.6) does not satisfy that requirement.
    - laminas/laminas-feed[2.13.0, ..., 2.14.x-dev] require php ^7.3 || ~8.0.0 -> your php version (8.3.6) does not satisfy that requirement.
    - laminas/laminas-escaper[2.9.0, ..., 2.9.x-dev] require php ^7.3 || ~8.0.0 || ~8.1.0 -> your php version (8.3.6) does not satisfy that requirement.
    - laminas/laminas-feed[2.17.0, ..., 2.17.x-dev] require php ^7.3 || ~8.0.0 || ~8.1.0 -> your php version (8.3.6) does not satisfy that requirement.
    - typo3/phar-stream-wrapper[v3.1.3, ..., v3.1.5] require php ^7.0 -> your php version (8.3.6) does not satisfy that requirement.
    - symfony/routing[v4.3.0-BETA1, ..., v4.4.10] require php ^7.1.3 -> your php version (8.3.6) does not satisfy that requirement.
    - symfony/console[v4.4.0-BETA1, ..., v4.4.8] require php ^7.1.3 -> your php version (8.3.6) does not satisfy that requirement.
    - longwave/laminas-diactoros[2.14.2, ..., 2.14.x-dev] require php ^7.3 || ~8.0.0 || ~8.1.0 || ~8.2.0 -> your php version (8.3.6) does not satisfy that requirement.
    - composer/installers[v1.0.23, ..., v1.8.0] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.6.0] but it does not match the constraint.
    - Root composer.json requires drupal/core-recommended ^9 -> satisfiable by drupal/core-recommended[9.0.0-alpha1, ..., 9.5.x-dev].

rm: cannot remove 'composer.contrib.lock': No such file or directory
Failed to run poser : exit status 1

How to run a single PHPUnit test?

I have tried with several combinations, using the path, or test name, but all tests are run ...

List tests:

$ ddev phpunit --list-tests
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Available test(s):
 - Drupal\Tests\config_enforce_devel\Functional\DefaultTargetModuleTest::testDefaultTargetModuleCreated
 - Drupal\Tests\config_enforce_devel\Functional\FormAlterImplementationOrderTest::testFormAlterImplementationOrder
 - Drupal\Tests\config_enforce_devel\Functional\ThemeSettingsFormTest::testThemeSettingsFormSubmit

Run a single test:

$ ddev phpunit Drupal\Tests\config_enforce_devel\Functional\DefaultTargetModuleTest::testDefaultTargetModuleCreated
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Default Target Module (Drupal\Tests\config_enforce_devel\Functional\DefaultTargetModule)
 ✔ Default target module created

Form Alter Implementation Order (Drupal\Tests\config_enforce_devel\Functional\FormAlterImplementationOrder)
 ✔ Form alter implementation order

Theme Settings Form (Drupal\Tests\config_enforce_devel\Functional\ThemeSettingsForm)
 ✔ Theme settings form submit

Time: 00:27.124, Memory: 4.00 MB

OK (3 tests, 20 assertions)

Using path like this also runs all tests:

$ ddev phpunit ./tests/src/Functional/DefaultTargetModuleTest.php 

How can I run a single test? For this module, it's all right to run all tests, but other modules such as Simplenews has a much larger number of tests.

Difference between `ddev-drupal-contrib` and `ddev-selenium-standalone-chrome`?

I tried the awesome ddev-selenium-standalone-chrome add-on yesterday. Shortly after that, I heard about ddev-drupal-contrib.

It looks like they may overlap, so how does ddev-drupal-contrib compare to ddev-selenium-standalone-chrome -- like where do they overlap, and what makes them different from each other?

It looks like they both allow running PHPUnit and Nightwatch tests, but ddev-drupal-contrib may be only for contrib modules, and with a simpler syntax ... ?

If ddev-drupal-contrib allowed running also core, contrib and individual tests like below, that would be awesome. Or maybe that's already possible, but not documented on the README?

As it works currently, run tests from within a contrib module folder:
ddev phpunit

Is this possible? Run a group of tests or a single test, from anywhere:

  • ddev phpunit --group olivero
  • ddev phpunit web/core/modules/contrib/simplenews/tests/src/Functional/SimplenewsSendTest.php

If not, it would be a fantastic feature, since the ddev-selenium-standalone-chrome syntax is slightly unwieldy:

ddev exec -d /var/www/html/web "../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist ./modules/contrib/simplenews/tests/src/Functional/SimplenewsSendTest.php"

Or maybe it's the other way around, and the short commands such as ddev phpunit --group olivero could be allowed to work in ddev-selenium-standalone-chrome?

How to install modules, for example upgrade_status for D10 compatibility

Just some notes of what I'm doing for this workflow.

The composer.json file is untouched after dev poser, but if you need additional modules, or upgrade/downgrade the drupal core version, all the stuff ends up in vendor.

This is what my composer.json looks like to install upgrade_status on D9:

{
    "name": "drupal/${WHATEVER_MODULE}",
    "description": "Description text.",
    "type": "drupal-module",
    "license": "GPL-2.0-or-later",
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    },
    "require": {
        "drupal/core": "^9",
        "composer/installers": "^1.9",
        "drupal/upgrade_status": "^4.0",
        "drush/drush": "^11.6"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "extra": {
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/{$name}": [
                "type:drupal-drush"
            ]
        }
    },
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "dealerdirect/phpcodesniffer-composer-installer": true,
            "cweagans/composer-patches": true,
            "drupal/core-composer-scaffold": true
        }
    },
    "require-dev": {
        "drupal/core-dev": "^9",
        "phpspec/prophecy-phpunit": "^2"
    }
}

The bits require are the composer/installers package together with the extra/installer-paths, and the repositories.

Maybe we could have a way to emulate what poser does with expand composer json (https://git.drupalcode.org/project/gitlab_templates/-/raw/1.0.x/scripts/expand_composer_json.php) to install a module or change the core version?

How do I run `ddev poser` with no interaction?

How do I run ddev poser with no interaction? Currently, it asks me to allow plugins.

...
Package operations: 168 installs, 0 updates, 0 removals
  - Downloading drupal/ctools (4.0.4)
  - Downloading drupal/token (1.13.0)
  - Installing composer/installers (v2.2.0): Extracting archive
  - Installing cweagans/composer-patches (1.7.3): Extracting archive
  - Installing drupal/core-composer-scaffold (10.2.3): Extracting archive
php-http/discovery contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] 

In this comment, I can see that most ddev commands allow -y flag. There is also DDEV_NO_INTERACTION=TRUE environment variable. Neither of those work for ddev poser. In addition, there's no "help" argument for ddev poser to see what flags are available. If I run ddev poser -h or ddev poser --help, it just runs as if there was no flag.

Please consider adding a -y flag and help flags.

PHP warnings when running `ddev poser`

I configured DDEV to use PHP 8.2, and I'm getting these warnings when running ddev poser.

$ ddev poser
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5182  100  5182    0     0  21325      0 --:--:-- --:--:-- --:--:-- 21325
PHP Warning:  file_get_contents(composer.json): Failed to open stream: No such file or directory in /var/www/html/expand_composer_json.php on line 16

Warning: file_get_contents(composer.json): Failed to open stream: No such file or directory in /var/www/html/expand_composer_json.php on line 16
PHP Warning:  foreach() argument must be of type array|object, null given in /var/www/html/expand_composer_json.php on line 148

Warning: foreach() argument must be of type array|object, null given in /var/www/html/expand_composer_json.php on line 148
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 152 installs, 0 updates, 0 removals
...

... (everything continues and runs)

`ddev eslint` breaks due to hyphens in project name

Problem Statement

I see the following error:

$ ddev eslint
/mnt/ddev_config/commands/web/eslint: line 16: cd: web/modules/custom/my-module: No such file or directory
Failed to run eslint : exit status 1

The problematic line is this one:

cd "$DDEV_DOCROOT/modules/custom/$DDEV_SITENAME"

Ddev doesn't allow you to create a project name with underscores in it, because it creates an invalid domain name. Therefore, module names that contain underscores (eg "my_module") must be converted to hyphens for the Ddev project name.

When this happens the module name (my_module) is not the same as the Ddev project name (my-module, and so cd web/modules/custom/my-module will fail.

Proposed resolution

If possible refactor the eslint command file to execute eslint from the project root folder ( like all of the other commands currently do). Pass in the path to the project folder as a flag or option to the eslint command, ideally using wildcard syntax $DDEV_DOCROOT/modules/custom/* so that we don't have to decypher the actual project folder name. (I don't think we have an environment variable for this).

Simplenews and Admin Toolbar tests are failing

After following the steps in the README and installing DDEV Selenium Standalone Chrome, there are few failing tests in the Simplenews and Admin Toolbar modules.

I am not sure if DDEV Drupal Contrib, or tests in the contrib module need to be updated? I can create issues in the module issue queues, if that's where they belong.

Result of SimpleNews test
user:~/dev/simplenews$ ddev phpunit
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Simplenews Demo (Drupal\Tests\simplenews_demo\Functional\SimplenewsDemo)
 ✔ Installed

Simplenews Administration (Drupal\Tests\simplenews\Functional\SimplenewsAdministration)
 ✘ Newsletter settings
   │
   │ Behat\Mink\Exception\ResponseTextException: The text "Simplenews adds elements to the newsletter node add/edit" was not found anywhere in the text of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:907
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:293
   │ /var/www/html/tests/src/Functional/SimplenewsAdministrationTest.php:271
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Subscription management
 ✘ Content types
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save content type" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsAdministrationTest.php:725
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Subscriber status filter
 ✔ Newsletter issues overview
 ✔ Access

Simplenews Field Ui (Drupal\Tests\simplenews\Functional\SimplenewsFieldUi)
 ✔ Content type creation

Simplenews I18n (Drupal\Tests\simplenews\Functional\SimplenewsI18n)
 ✘ Newsletter issue translation
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save content type" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsI18nTest.php:125
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Simplenews Personalization Forms (Drupal\Tests\simplenews\Functional\SimplenewsPersonalizationForms)
 ✔ Synchronize subscribe register
 ✘ Synchronize register subscribe
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Confirm" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsPersonalizationFormsTest.php:87
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Subscribe request password
 ✔ Disable account
 ✔ Delete account
 ✘ Blocked subscribe
   │
   │ Behat\Mink\Exception\DriverException: Only string values can be used for a radio input.
   │
   │ /var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:415
   │ /var/www/html/vendor/behat/mink/src/Element/NodeElement.php:118
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:96
   │ /var/www/html/tests/src/Functional/SimplenewsPersonalizationFormsTest.php:171
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Simplenews Recipient Handler (Drupal\Tests\simplenews\Functional\SimplenewsRecipientHandler)
 ✔ Site mail
 ✔ New users
 ✔ Subscribers by role

Simplenews Send (Drupal\Tests\simplenews\Functional\SimplenewsSend)
 ✔ Programmatic newsletter
 ✔ Send now no cron
 ✔ Send multiple no cron
 ✔ Send now cron throttle
 ✔ Send now cron
 ✔ Send publish no cron
 ✔ Update newsletter
 ✔ Send fail
 ✔ Reason
 ✔ Delete
 ✔ Impersonation
 ✔ Newsletter theme
 ✔ Html escaping

Simplenews Source (Drupal\Tests\simplenews\Functional\SimplenewsSource)
 ✔ Send minimal source implementation
 ✔ Send caching
 ✔ Send html
 ✔ Send hidden
 ✔ Send no caching
 ✔ Send missing node
 ✔ Send missing subscriber
 ✔ Skip

Simplenews Subscribe (Drupal\Tests\simplenews\Functional\SimplenewsSubscribe)
 ✘ Subscribe multiple
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">m*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:68
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Confirm immediate
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Subscription changes confirmed for <em class="placeholder">[email protected]</em>." was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:171
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Subscribe anonymous
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">d*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:260
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Subscribe anonymous single
 ✘ Subscribe anonymous redirect
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">e*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:525
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Subscribe authenticated
 ✔ Simplenews subscription block
 ✔ Admin create
 ✘ Hash auth
   │
   │ Behat\Mink\Exception\ResponseTextException: The text "Subscriptions for [email protected]" was not found anywhere in the text of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:907
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:293
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:779
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Formatting
 ✔ Duplicate
 ✔ Block settings

Simplenews Synchronize Fields Form (Drupal\Tests\simplenews\Functional\SimplenewsSynchronizeFieldsForm)
 ✔ Subscriber form field sync

Simplenews Uninstall (Drupal\Tests\simplenews\Functional\SimplenewsUninstall)
 ✔ Uninstall

Simplenews Kernel (Drupal\Tests\simplenews\Kernel\SimplenewsKernel)
 ✔ Masking

Simplenews Monitoring (Drupal\Tests\simplenews\Kernel\SimplenewsMonitoring)
 ✔ Sensors

Simplenews Synchronize Fields (Drupal\Tests\simplenews\Kernel\SimplenewsSynchronizeFields)
 ✔ Synchronize base fields
 ✔ Synchronize configurable fields
 ✔ Set shared field automatically
 ✔ Disable sync
 ✔ User recursion prevention

Time: 10:13.697, Memory: 6.00 MB

Summary of non-successful tests:

Simplenews Administration (Drupal\Tests\simplenews\Functional\SimplenewsAdministration)
 ✘ Newsletter settings
   │
   │ Behat\Mink\Exception\ResponseTextException: The text "Simplenews adds elements to the newsletter node add/edit" was not found anywhere in the text of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:907
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:293
   │ /var/www/html/tests/src/Functional/SimplenewsAdministrationTest.php:271
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Content types
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save content type" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsAdministrationTest.php:725
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Simplenews I18n (Drupal\Tests\simplenews\Functional\SimplenewsI18n)
 ✘ Newsletter issue translation
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save content type" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsI18nTest.php:125
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Simplenews Personalization Forms (Drupal\Tests\simplenews\Functional\SimplenewsPersonalizationForms)
 ✘ Synchronize register subscribe
   │
   │ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Confirm" not found.
   │
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:144
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:78
   │ /var/www/html/tests/src/Functional/SimplenewsPersonalizationFormsTest.php:87
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Blocked subscribe
   │
   │ Behat\Mink\Exception\DriverException: Only string values can be used for a radio input.
   │
   │ /var/www/html/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php:415
   │ /var/www/html/vendor/behat/mink/src/Element/NodeElement.php:118
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:96
   │ /var/www/html/tests/src/Functional/SimplenewsPersonalizationFormsTest.php:171
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Simplenews Subscribe (Drupal\Tests\simplenews\Functional\SimplenewsSubscribe)
 ✘ Subscribe multiple
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">m*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:68
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Confirm immediate
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Subscription changes confirmed for <em class="placeholder">[email protected]</em>." was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:171
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Subscribe anonymous
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">d*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:260
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Subscribe anonymous redirect
   │
   │ Behat\Mink\Exception\ExpectationException: The string "Are you sure you want to confirm your subscription for <em class="placeholder">e*****@e*****.com</em>?" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:525
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✘ Hash auth
   │
   │ Behat\Mink\Exception\ResponseTextException: The text "Subscriptions for [email protected]" was not found anywhere in the text of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:907
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:293
   │ /var/www/html/tests/src/Functional/SimplenewsSubscribeTest.php:779
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

ERRORS!
Tests: 60, Assertions: 1372, Errors: 10.
Failed to run phpunit : exit status 2
Result of Admin Toolbar test
user:~/dev/admin_toolbar$ ddev phpunit
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Admin Toolbar Search Setting (Drupal\Tests\admin_toolbar_search\Functional\AdminToolbarSearchSetting)
 ✔ Toolbar search

Admin Toolbar Search (Drupal\Tests\admin_toolbar_search\FunctionalJavascript\AdminToolbarSearch)
 ✔ Toolbar search
 ✔ No access

Admin Toolbar Tools Search (Drupal\Tests\admin_toolbar_search\FunctionalJavascript\AdminToolbarToolsSearch)
 ✘ Toolbar search
   │
   │ Behat\Mink\Exception\ElementHtmlException: The string "/admin/structure/media/manage/zora/fields" appears in the HTML of the element matching css "#toolbar-administration", but it should not.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:927
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:600
   │ /var/www/html/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php:190
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Admin Toolbar Tools Alter (Drupal\Tests\admin_toolbar_tools\Functional\AdminToolbarToolsAlter)
 ✔ Admin toolbar tools

Admin Toolbar Admin Menu (Drupal\Tests\admin_toolbar\Functional\AdminToolbarAdminMenu)
 ✔ Module status change subtrees hash cache clear
 ✔ Menu link update subtrees hash cache clear
 ✔ User role update subtrees hash cache clear
 ✔ Non current user account updates
 ✔ Locale translation subtrees hash cache clear
 ✘ Subtrees json request
   │
   │ TypeError: Behat\Mink\Session::setRequestHeader(): Argument #1 ($name) must be of type string, int given, called in /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php on line 235
   │
   │ /var/www/html/vendor/behat/mink/src/Session.php:199
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:235
   │ /var/www/html/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php:387
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

 ✔ Language switching
 ✔ Back to site link
 ✔ External link

Admin Toolbar Alter (Drupal\Tests\admin_toolbar\Functional\AdminToolbarAlter)
 ✘ Admin toolbar
   │
   │ Behat\Mink\Exception\ExpectationException: The string "class="toolbar-icon toolbar-icon-user-admin-index"" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/AdminToolbarAlterTest.php:56
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Admin Toolbar Tools Sort (Drupal\Tests\admin_toolbar\Functional\AdminToolbarToolsSort)
 ✔ Menu update
 ✔ Menu sorting

Time: 03:49.179, Memory: 6.00 MB

Summary of non-successful tests:

Admin Toolbar Tools Search (Drupal\Tests\admin_toolbar_search\FunctionalJavascript\AdminToolbarToolsSearch)
 ✘ Toolbar search
   │
   │ Behat\Mink\Exception\ElementHtmlException: The string "/admin/structure/media/manage/zora/fields" appears in the HTML of the element matching css "#toolbar-administration", but it should not.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:927
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:600
   │ /var/www/html/admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php:190
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Admin Toolbar Admin Menu (Drupal\Tests\admin_toolbar\Functional\AdminToolbarAdminMenu)
 ✘ Subtrees json request
   │
   │ TypeError: Behat\Mink\Session::setRequestHeader(): Argument #1 ($name) must be of type string, int given, called in /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php on line 235
   │
   │ /var/www/html/vendor/behat/mink/src/Session.php:199
   │ /var/www/html/web/core/tests/Drupal/Tests/UiHelperTrait.php:235
   │ /var/www/html/web/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php:387
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

Admin Toolbar Alter (Drupal\Tests\admin_toolbar\Functional\AdminToolbarAlter)
 ✘ Admin toolbar
   │
   │ Behat\Mink\Exception\ExpectationException: The string "class="toolbar-icon toolbar-icon-user-admin-index"" was not found anywhere in the HTML response of the current page.
   │
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:888
   │ /var/www/html/vendor/behat/mink/src/WebAssert.php:363
   │ /var/www/html/web/core/tests/Drupal/Tests/WebAssert.php:540
   │ /var/www/html/tests/src/Functional/AdminToolbarAlterTest.php:56
   │ /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
   │

ERRORS!
Tests: 17, Assertions: 382, Errors: 3.
Failed to run phpunit : exit status 2

Documentation is unclear on how composer.json is changed

From the current README where it describes ddev poser:

Edits composer.json so that drupal/core-recommended becomes a dev dependency.

However, when I run ddev poser, it does not change composer.json. I saw it temporarily created composer.contrib.json and installed Drupal core as expected (I am unsure how composer install can read composer.contrib.json with no changes to composer.json, but that's a different question). It didn't write anything to composer.json. I thought this was a bug until I saw this being discussed in #12 in an off-hand way and now I am not sure.

I was expecting that composer.json would be modified based on my understanding of the documentation. Am I missing something here?

Add support in poser command for ddev's new "drupal" project type

At the moment, poser relies on ddev's $DDEV_PROJECT_TYPE which, beginning DDEV v1.23.0 will always be just drupal instead of the previous versions' drupal8, drupal9, or drupal10.

I'm not sure which would be the best way to get around this change but something needs to change in poser for it to work properly again. At the moment at least for me personally ddev poser seems to install Drupal 9 by default.

(Relevant bit of code in .ddev/commands/web/expand-composer-json:

[[ $DDEV_PROJECT_TYPE == "drupal10" ]] && export _TARGET_CORE=^10
[[ $DDEV_PROJECT_TYPE == "drupal9" ]] && export _TARGET_CORE=^9
[[ $DDEV_PROJECT_TYPE == "drupal8" ]] && export _TARGET_CORE=^8

Module machine name is not a valid project name

The README says to run ddev config --project-name=[contrib module] --project-type=drupal10 --docroot=web --create-docroot --php-version=8.1. However, contrib modules often have underscores in the machine name, and that makes them invalid project names.

Example error:

Project name (ip_consumer_auth): 
ip_consumer_auth is not a valid project name. Please enter a project name in your configuration that will allow for a valid hostname. See https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames for valid hostname requirements

Could the documentation be improved, or could a wrapper be used that will automatically replace underscores with hyphens? Maybe that could be done in DDEV itself?

Also, as a suggestion, it would be nice if, when getting set up with a contrib project, if a .gitignore file could also be created that excludes the vendor and web folders and the .editorconfig and .gitattributes files. Maybe an optional line for excluding .ddev/ as well.

Drush can't find docroot

I'm having a problem running drush with this plugin using DDEV 1.22.0.

git clone https://git.drupal.org/project/entity_usage.git
cd entity_usage/
ddev config --project-name=entityusage --project-type=drupal9 --docroot=web --create-docroot --php-version=8.1
ddev get ddev/ddev-drupal-contrib
ddev restart
ddev poser
ddev drush si -vvv

Expected result: the site installs.
Actual result:

$ ddev drush si -vvv
 [preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml
 [preflight] Alias paths: 
 [preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src
 [info] Starting bootstrap to root [0.16 sec, 2.64 MB]

In BootstrapHook.php line 36:
                                                                      
  [Exception]                                                         
  Bootstrap failed. Run your command with -vvv for more information.  
                                                                      

Exception trace:
  at /var/www/html/vendor/drush/drush/src/Boot/BootstrapHook.php:36
 Drush\Boot\BootstrapHook->initialize() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:44
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->doInitializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:36
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:29
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:376
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /var/www/html/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1039
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:275
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:124
 Drush\Runtime\Runtime->doRun() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:51
 Drush\Runtime\Runtime->run() at /var/www/html/vendor/drush/drush/drush.php:79
 require() at /var/www/html/vendor/drush/drush/drush:4
 include() at /var/www/html/vendor/bin/drush:119

Failed to run drush si -vvv: exit status 1
Full output
~ $ git clone https://git.drupal.org/project/entity_usage.git
Cloning into 'entity_usage'...
warning: redirecting to https://git.drupalcode.org/project/entity_usage.git/
remote: Enumerating objects: 2087, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 2087 (delta 1), reused 7 (delta 1), pack-reused 2080
Receiving objects: 100% (2087/2087), 396.35 KiB | 1.36 MiB/s, done.
Resolving deltas: 100% (1199/1199), done.
~ $ cd entity_usage/
~/entity_usage (8.x-2.x) $ ddev config --project-name=entityusage --project-type=drupal9 --docroot=web --create-docroot --php-version=8.1
Creating a new ddev project config in the current directory (/home/andy/Code/drupal/tmp/entity_usage) 
Once completed, your configuration will be written to /home/andy/Code/drupal/tmp/entity_usage/.ddev/config.yaml
 
Created docroot at /home/andy/Code/drupal/tmp/entity_usage/web 
You have specified a project type of 'drupal9' but no project of that type is found in /home/andy/Code/drupal/tmp/entity_usage/web 
No settings.php file exists, creating one 
Configuration complete. You may now run 'ddev start'. 
~/entity_usage (8.x-2.x) $ ddev get ddev/ddev-drupal-contrib
Installing ddev/ddev-drupal-contrib:1.0.0-rc11 
Downloading https://api.github.com/repos/ddev/ddev-drupal-contrib/tarball/1.0.0-rc11 
1.0.0-rc11_1469318163.tar.gz 74.05 KiB / ? [--------------------------------------------------------------------------------------------------=-----------] 758.25% 0s 

Installing project-level components: 
👍 commands/web/eslint 
👍 commands/web/expand-composer-json 
👍 commands/web/nightwatch 
👍 commands/web/phpcs 
👍 commands/web/phpunit 
👍 commands/web/poser 
👍 commands/web/stylelint 
👍 commands/web/symlink-project 
👍 config.contrib.yaml 

Installed DDEV add-on ddev/ddev-drupal-contrib, use `ddev restart` to enable. 
Please read instructions for this addon at the source repo at
https://github.com/ddev/ddev-drupal-contrib
Please file issues and create pull requests there to improve it. 
Installed ddev-drupal-contrib:1.0.0-rc11 from ddev/ddev-drupal-contrib 
~/entity_usage (8.x-2.x) $ ddev restart
Restarting project entityusage... 
 Network ddev-entityusage_default  Created 
 Container ddev-entityusage-db  Created 
 Container ddev-entityusage-web  Created 
 Container ddev-entityusage-web  Started 
 Container ddev-entityusage-db  Started 
mkcert may not be properly installed, we suggest installing it for trusted https support, `brew install mkcert nss`, `choco install -y mkcert`, etc. and then `mkcert -install` 
 Container ddev-router  Created 
 Container ddev-router  Started 
Restarted entityusage 
Your project can be reached at http://entityusage.ddev.site http://127.0.0.1:49217 
~/entity_usage (8.x-2.x) $ ddev poser
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4334  100  4334    0     0  28701      0 --:--:-- --:--:-- --:--:-- 28701
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 159 installs, 0 updates, 0 removals
  - Locking asm89/stack-cors (1.3.0)
  - Locking behat/mink (v1.10.0)
  - Locking behat/mink-selenium2-driver (v1.6.0)
  - Locking brianium/paratest (v6.3.3)
  - Locking chi-teck/drupal-code-generator (2.6.2)
  - Locking composer/ca-bundle (1.3.6)
  - Locking composer/composer (2.2.21)
  - Locking composer/installers (v2.2.0)
  - Locking composer/metadata-minifier (1.0.0)
  - Locking composer/pcre (1.0.1)
  - Locking composer/semver (3.3.2)
  - Locking composer/spdx-licenses (1.5.7)
  - Locking composer/xdebug-handler (3.0.3)
  - Locking consolidation/annotated-command (4.9.1)
  - Locking consolidation/config (2.1.2)
  - Locking consolidation/filter-via-dot-access-data (2.0.2)
  - Locking consolidation/log (2.1.1)
  - Locking consolidation/output-formatters (4.3.2)
  - Locking consolidation/robo (4.0.2)
  - Locking consolidation/self-update (2.2.0)
  - Locking consolidation/site-alias (3.1.7)
  - Locking consolidation/site-process (4.2.1)
  - Locking cweagans/composer-patches (1.7.3)
  - Locking dealerdirect/phpcodesniffer-composer-installer (v1.0.0)
  - Locking dflydev/dot-access-data (v3.0.2)
  - Locking doctrine/annotations (1.13.3)
  - Locking doctrine/deprecations (v1.1.1)
  - Locking doctrine/instantiator (2.0.0)
  - Locking doctrine/lexer (1.2.3)
  - Locking doctrine/reflection (1.2.4)
  - Locking drupal/block_field (1.0.0-rc4)
  - Locking drupal/ckeditor (1.0.2)
  - Locking drupal/coder (8.3.21)
  - Locking drupal/core (9.5.10)
  - Locking drupal/core-composer-scaffold (9.5.10)
  - Locking drupal/core-dev (9.5.10)
  - Locking drupal/core-recommended (9.5.10)
  - Locking drupal/dynamic_entity_reference (1.16.0)
  - Locking drupal/embed (1.6.0)
  - Locking drupal/entity_browser (2.9.0)
  - Locking drupal/entity_browser_block (1.3.0)
  - Locking drupal/entity_embed (1.4.0)
  - Locking drupal/entity_reference_revisions (1.10.0)
  - Locking drupal/inline_entity_form (1.0.0-rc15)
  - Locking drupal/paragraphs (1.15.0)
  - Locking drupal/webform (6.1.5)
  - Locking drush/drush (11.6.0)
  - Locking easyrdf/easyrdf (1.1.1)
  - Locking egulias/email-validator (3.2.6)
  - Locking enlightn/security-checker (v1.10.0)
  - Locking friends-of-behat/mink-browserkit-driver (v1.6.1)
  - Locking grasmash/expander (2.0.3)
  - Locking guzzlehttp/guzzle (6.5.8)
  - Locking guzzlehttp/promises (1.5.3)
  - Locking guzzlehttp/psr7 (1.9.1)
  - Locking instaclick/php-webdriver (1.4.16)
  - Locking justinrainbow/json-schema (5.2.12)
  - Locking laminas/laminas-escaper (2.12.0)
  - Locking laminas/laminas-feed (2.21.0)
  - Locking laminas/laminas-stdlib (3.17.0)
  - Locking league/container (4.2.0)
  - Locking longwave/laminas-diactoros (2.14.2)
  - Locking masterminds/html5 (2.7.6)
  - Locking mikey179/vfsstream (v1.6.11)
  - Locking myclabs/deep-copy (1.11.1)
  - Locking nikic/php-parser (v4.16.0)
  - Locking pear/archive_tar (1.4.14)
  - Locking pear/console_getopt (v1.4.3)
  - Locking pear/pear-core-minimal (v1.10.13)
  - Locking pear/pear_exception (v1.0.2)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.2.1)
  - Locking php-parallel-lint/php-parallel-lint (v1.3.2)
  - Locking phpdocumentor/reflection-common (2.2.0)
  - Locking phpdocumentor/reflection-docblock (5.3.0)
  - Locking phpdocumentor/type-resolver (1.7.2)
  - Locking phpspec/prophecy (v1.17.0)
  - Locking phpstan/phpdoc-parser (1.23.0)
  - Locking phpunit/php-code-coverage (9.2.27)
  - Locking phpunit/php-file-iterator (3.0.6)
  - Locking phpunit/php-invoker (3.1.1)
  - Locking phpunit/php-text-template (2.0.4)
  - Locking phpunit/php-timer (5.0.3)
  - Locking phpunit/phpunit (9.6.10)
  - Locking psr/cache (1.0.1)
  - Locking psr/container (1.1.2)
  - Locking psr/http-factory (1.0.2)
  - Locking psr/http-message (1.0.1)
  - Locking psr/log (1.1.4)
  - Locking psy/psysh (v0.11.20)
  - Locking ralouphie/getallheaders (3.0.3)
  - Locking react/promise (v2.10.0)
  - Locking sebastian/cli-parser (1.0.1)
  - Locking sebastian/code-unit (1.0.8)
  - Locking sebastian/code-unit-reverse-lookup (2.0.3)
  - Locking sebastian/comparator (4.0.8)
  - Locking sebastian/complexity (2.0.2)
  - Locking sebastian/diff (4.0.5)
  - Locking sebastian/environment (5.1.5)
  - Locking sebastian/exporter (4.0.5)
  - Locking sebastian/global-state (5.0.6)
  - Locking sebastian/lines-of-code (1.0.3)
  - Locking sebastian/object-enumerator (4.0.4)
  - Locking sebastian/object-reflector (2.0.4)
  - Locking sebastian/recursion-context (4.0.5)
  - Locking sebastian/resource-operations (3.0.3)
  - Locking sebastian/type (3.2.1)
  - Locking sebastian/version (3.0.2)
  - Locking seld/jsonlint (1.10.0)
  - Locking seld/phar-utils (1.2.1)
  - Locking sirbrillig/phpcs-variable-analysis (v2.11.16)
  - Locking slevomat/coding-standard (8.13.4)
  - Locking squizlabs/php_codesniffer (3.7.2)
  - Locking stack/builder (v1.0.6)
  - Locking symfony-cmf/routing (2.3.4)
  - Locking symfony/browser-kit (v4.4.44)
  - Locking symfony/console (v4.4.49)
  - Locking symfony/css-selector (v4.4.44)
  - Locking symfony/debug (v4.4.44)
  - Locking symfony/dependency-injection (v4.4.49)
  - Locking symfony/deprecation-contracts (v2.5.2)
  - Locking symfony/dom-crawler (v4.4.45)
  - Locking symfony/error-handler (v4.4.44)
  - Locking symfony/event-dispatcher (v4.4.44)
  - Locking symfony/event-dispatcher-contracts (v1.1.13)
  - Locking symfony/filesystem (v4.4.42)
  - Locking symfony/finder (v4.4.44)
  - Locking symfony/http-client-contracts (v2.5.2)
  - Locking symfony/http-foundation (v4.4.49)
  - Locking symfony/http-kernel (v4.4.50)
  - Locking symfony/lock (v4.4.46)
  - Locking symfony/mime (v5.4.13)
  - Locking symfony/phpunit-bridge (v5.4.26)
  - Locking symfony/polyfill-ctype (v1.27.0)
  - Locking symfony/polyfill-iconv (v1.27.0)
  - Locking symfony/polyfill-intl-grapheme (v1.27.0)
  - Locking symfony/polyfill-intl-idn (v1.27.0)
  - Locking symfony/polyfill-intl-normalizer (v1.27.0)
  - Locking symfony/polyfill-mbstring (v1.27.0)
  - Locking symfony/polyfill-php72 (v1.27.0)
  - Locking symfony/polyfill-php73 (v1.27.0)
  - Locking symfony/polyfill-php80 (v1.27.0)
  - Locking symfony/process (v4.4.44)
  - Locking symfony/psr-http-message-bridge (v2.1.4)
  - Locking symfony/routing (v4.4.44)
  - Locking symfony/serializer (v4.4.47)
  - Locking symfony/service-contracts (v2.5.2)
  - Locking symfony/string (v6.3.2)
  - Locking symfony/translation (v4.4.47)
  - Locking symfony/translation-contracts (v2.5.2)
  - Locking symfony/validator (v4.4.48)
  - Locking symfony/var-dumper (v5.4.26)
  - Locking symfony/yaml (v4.4.45)
  - Locking theseer/tokenizer (1.2.1)
  - Locking twig/twig (v2.15.5)
  - Locking typo3/phar-stream-wrapper (v3.1.7)
  - Locking webflo/drupal-finder (1.2.2)
  - Locking webmozart/assert (1.11.0)
  - Locking webmozart/path-util (2.3.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 159 installs, 0 updates, 0 removals
  - Installing composer/installers (v2.2.0): Extracting archive
  - Installing cweagans/composer-patches (1.7.3): Extracting archive
  - Installing drupal/core-composer-scaffold (9.5.10): Extracting archive
  - Installing squizlabs/php_codesniffer (3.7.2): Extracting archive
  - Installing dealerdirect/phpcodesniffer-composer-installer (v1.0.0): Extracting archive
  - Installing symfony/polyfill-php80 (v1.27.0): Extracting archive
  - Installing symfony/process (v4.4.44): Extracting archive
  - Installing symfony/deprecation-contracts (v2.5.2): Extracting archive
  - Installing psr/container (1.1.2): Extracting archive
  - Installing symfony/service-contracts (v2.5.2): Extracting archive
  - Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.27.0): Extracting archive
  - Installing symfony/console (v4.4.49): Extracting archive
  - Installing sebastian/environment (5.1.5): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (3.2.1): Extracting archive
  - Installing sebastian/resource-operations (3.0.3): Extracting archive
  - Installing sebastian/recursion-context (4.0.5): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.6): Extracting archive
  - Installing sebastian/exporter (4.0.5): Extracting archive
  - Installing sebastian/diff (4.0.5): Extracting archive
  - Installing sebastian/comparator (4.0.8): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.1): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing nikic/php-parser (v4.16.0): Extracting archive
  - Installing sebastian/lines-of-code (1.0.3): Extracting archive
  - Installing sebastian/complexity (2.0.2): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.27): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.11.1): Extracting archive
  - Installing doctrine/instantiator (2.0.0): Extracting archive
  - Installing phpunit/phpunit (9.6.10): Extracting archive
  - Installing brianium/paratest (v6.3.3): Extracting archive
  - Installing composer/ca-bundle (1.3.6): Extracting archive
  - Installing composer/metadata-minifier (1.0.0): Extracting archive
  - Installing composer/spdx-licenses (1.5.7): Extracting archive
  - Installing psr/log (1.1.4): Extracting archive
  - Installing composer/pcre (1.0.1): Extracting archive
  - Installing composer/xdebug-handler (3.0.3): Extracting archive
  - Installing consolidation/log (2.1.1): Extracting archive
  - Installing symfony/finder (v4.4.44): Extracting archive
  - Installing dflydev/dot-access-data (v3.0.2): Extracting archive
  - Installing consolidation/output-formatters (4.3.2): Extracting archive
  - Installing symfony/polyfill-ctype (v1.27.0): Extracting archive
  - Installing symfony/filesystem (v4.4.42): Extracting archive
  - Installing composer/semver (3.3.2): Extracting archive
  - Installing consolidation/self-update (2.2.0): Extracting archive
  - Installing typo3/phar-stream-wrapper (v3.1.7): Extracting archive
  - Installing symfony/polyfill-php72 (v1.27.0): Extracting archive
  - Installing twig/twig (v2.15.5): Extracting archive
  - Installing symfony/yaml (v4.4.45): Extracting archive
  - Installing symfony/translation-contracts (v2.5.2): Extracting archive
  - Installing symfony/validator (v4.4.48): Extracting archive
  - Installing symfony/translation (v4.4.47): Extracting archive
  - Installing symfony/serializer (v4.4.47): Extracting archive
  - Installing symfony/routing (v4.4.44): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.27.0): Extracting archive
  - Installing symfony/polyfill-intl-idn (v1.27.0): Extracting archive
  - Installing symfony/mime (v5.4.13): Extracting archive
  - Installing symfony/http-foundation (v4.4.49): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing symfony/psr-http-message-bridge (v2.1.4): Extracting archive
  - Installing symfony/polyfill-iconv (v1.27.0): Extracting archive
  - Installing symfony/http-client-contracts (v2.5.2): Extracting archive
  - Installing symfony/event-dispatcher-contracts (v1.1.13): Extracting archive
  - Installing symfony/event-dispatcher (v4.4.44): Extracting archive
  - Installing symfony/var-dumper (v5.4.26): Extracting archive
  - Installing symfony/debug (v4.4.44): Extracting archive
  - Installing symfony/error-handler (v4.4.44): Extracting archive
  - Installing symfony/http-kernel (v4.4.50): Extracting archive
  - Installing symfony/dependency-injection (v4.4.49): Extracting archive
  - Installing symfony-cmf/routing (2.3.4): Extracting archive
  - Installing stack/builder (v1.0.6): Extracting archive
  - Installing pear/pear_exception (v1.0.2): Extracting archive
  - Installing pear/console_getopt (v1.4.3): Extracting archive
  - Installing pear/pear-core-minimal (v1.10.13): Extracting archive
  - Installing pear/archive_tar (1.4.14): Extracting archive
  - Installing masterminds/html5 (2.7.6): Extracting archive
  - Installing psr/http-factory (1.0.2): Extracting archive
  - Installing longwave/laminas-diactoros (2.14.2): Extracting archive
  - Installing laminas/laminas-stdlib (3.17.0): Extracting archive
  - Installing laminas/laminas-escaper (2.12.0): Extracting archive
  - Installing laminas/laminas-feed (2.21.0): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing guzzlehttp/psr7 (1.9.1): Extracting archive
  - Installing guzzlehttp/promises (1.5.3): Extracting archive
  - Installing guzzlehttp/guzzle (6.5.8): Extracting archive
  - Installing doctrine/lexer (1.2.3): Extracting archive
  - Installing egulias/email-validator (3.2.6): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing doctrine/annotations (1.13.3): Extracting archive
  - Installing doctrine/reflection (1.2.4): Extracting archive
  - Installing asm89/stack-cors (1.3.0): Extracting archive
  - Installing drupal/core (9.5.10): Extracting archive
  - Installing drupal/block_field (1.0.0-rc4): Extracting archive
  - Installing drupal/ckeditor (1.0.2): Extracting archive
  - Installing symfony/phpunit-bridge (v5.4.26): Extracting archive
  - Installing symfony/lock (v4.4.46): Extracting archive
  - Installing symfony/dom-crawler (v4.4.45): Extracting archive
  - Installing symfony/css-selector (v4.4.44): Extracting archive
  - Installing symfony/browser-kit (v4.4.44): Extracting archive
  - Installing webmozart/assert (1.11.0): Extracting archive
  - Installing phpstan/phpdoc-parser (1.23.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing doctrine/deprecations (v1.1.1): Extracting archive
  - Installing phpdocumentor/type-resolver (1.7.2): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
  - Installing phpspec/prophecy (v1.17.0): Extracting archive
  - Installing mikey179/vfsstream (v1.6.11): Extracting archive
  - Installing justinrainbow/json-schema (5.2.12): Extracting archive
  - Installing instaclick/php-webdriver (1.4.16): Extracting archive
  - Installing behat/mink (v1.10.0): Extracting archive
  - Installing friends-of-behat/mink-browserkit-driver (v1.6.1): Extracting archive
  - Installing easyrdf/easyrdf (1.1.1): Extracting archive
  - Installing slevomat/coding-standard (8.13.4): Extracting archive
  - Installing sirbrillig/phpcs-variable-analysis (v2.11.16): Extracting archive
  - Installing drupal/coder (8.3.21): Extracting archive
  - Installing seld/phar-utils (1.2.1): Extracting archive
  - Installing seld/jsonlint (1.10.0): Extracting archive
  - Installing react/promise (v2.10.0): Extracting archive
  - Installing composer/composer (2.2.21): Extracting archive
  - Installing behat/mink-selenium2-driver (v1.6.0): Extracting archive
  - Installing drupal/core-dev (9.5.10)
  - Installing drupal/core-recommended (9.5.10)
  - Installing drupal/dynamic_entity_reference (1.16.0): Extracting archive
  - Installing drupal/entity_browser (2.9.0): Extracting archive
  - Installing drupal/entity_browser_block (1.3.0): Extracting archive
  - Installing drupal/embed (1.6.0): Extracting archive
  - Installing drupal/entity_embed (1.4.0): Extracting archive
  - Installing drupal/inline_entity_form (1.0.0-rc15): Extracting archive
  - Installing drupal/entity_reference_revisions (1.10.0): Extracting archive
  - Installing drupal/paragraphs (1.15.0): Extracting archive
  - Installing drupal/webform (6.1.5): Extracting archive
  - Installing webflo/drupal-finder (1.2.2): Extracting archive
  - Installing psy/psysh (v0.11.20): Extracting archive
  - Installing league/container (4.2.0): Extracting archive
  - Installing enlightn/security-checker (v1.10.0): Extracting archive
  - Installing webmozart/path-util (2.3.0): Extracting archive
  - Installing grasmash/expander (2.0.3): Extracting archive
  - Installing consolidation/config (2.1.2): Extracting archive
  - Installing consolidation/site-alias (3.1.7): Extracting archive
  - Installing consolidation/site-process (4.2.1): Extracting archive
  - Installing consolidation/annotated-command (4.9.1): Extracting archive
  - Installing consolidation/robo (4.0.2): Extracting archive
  - Installing consolidation/filter-via-dot-access-data (2.0.2): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.27.0): Extracting archive
  - Installing symfony/string (v6.3.2): Extracting archive
  - Installing chi-teck/drupal-code-generator (2.6.2): Extracting archive
  - Installing drush/drush (11.6.0): Extracting archive
  - Installing php-parallel-lint/php-parallel-lint (v1.3.2): Extracting archive
43 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
87 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.md from assets/scaffold/files/drupal.README.md
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
PHP CodeSniffer Config installed_paths set to ../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard
~/entity_usage (8.x-2.x) $ ddev drush si -vvv
 [preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml
 [preflight] Alias paths: 
 [preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src
 [info] Starting bootstrap to root [0.16 sec, 2.64 MB]

In BootstrapHook.php line 36:
                                                                      
  [Exception]                                                         
  Bootstrap failed. Run your command with -vvv for more information.  
                                                                      

Exception trace:
  at /var/www/html/vendor/drush/drush/src/Boot/BootstrapHook.php:36
 Drush\Boot\BootstrapHook->initialize() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:44
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->doInitializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:36
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:29
 Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:145
 Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:376
 Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /var/www/html/vendor/symfony/console/Command/Command.php:221
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1039
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:275
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:124
 Drush\Runtime\Runtime->doRun() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:51
 Drush\Runtime\Runtime->run() at /var/www/html/vendor/drush/drush/drush.php:79
 require() at /var/www/html/vendor/drush/drush/drush:4
 include() at /var/www/html/vendor/bin/drush:119

Failed to run drush si -vvv: exit status 1

First raised in Slack: https://drupal.slack.com/archives/C5TQRQZRR/p1691064087290309

Initial debugging from Slack

  • If I ddev ssh in and run the command it still fails, I tried in /var/www/html/web as well as /var/www/html
  • With drush list I get the message

    Drupal root not found. Pass --root or a @siteAlias in order to see Drupal-specific commands.

  • Looking at \DrupalFinder\DrupalFinder::isValidRoot() I can see it's trying to find the site composer.json, but I'm not sure I have one
    andy@entityusage-web:/var/www/html$ find -maxdepth 3 -name composer.json 
    ./composer.json
    ./web/core/composer.json
    
    (The one in the current directory is the module composer.json rather than the site's)
  • IIUC that's by design:
    export COMPOSER=composer.contrib.json
    .ddev/commands/web/expand-composer-json "$DDEV_PROJECT_NAME"
    composer install
    rm composer.contrib.json composer.contrib.lock
  • It looks like ddev poser creates a transient composer file just for installation and then deletes it
  • It feels a bit dirty and I'm not sure what side-effects it might have, but it looks like I can get by with echo '{}' > /var/www/html/web/composer.json from inside the container, so it does seem connected with the Drupal finder.

Thanks for a super helpful plugin ❤️

DDEV not finding new commands

I might be missing a step installing this, but when I run ddev get ddev/ddev-drupal-contrib, I get...

Downloading https://api.github.com/repos/ddev/ddev-drupal-contrib/tarball/1.0.0-rc11 
1.0.0-rc11_2362468473.tar.gz 74.05 KiB / ? [-----------------------------=----------------------------------] 758.25% 0s 

Installing project-level components: 
👍 commands 
👍 config.contrib.yaml 

Installed DDEV add-on ddev/ddev-drupal-contrib, use `ddev restart` to enable. 

I run ddev restart, but I when I try to run ddev poser or ddev symlink-project, the response is Error: unknown command "poser" for "ddev"

I'm running ddev version v1.21.6 if that matters.

`ddev phpcs` reports failures unrelated to module code

Problem statement

ddev phpcs appears to be scanning the .ddev folder, and finds issues with .ddev/xhprof/xhprof_prepend.php.


FILE: /var/www/html/web/modules/custom/svg/.ddev/xhprof/xhprof_prepend.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
 22 | WARNING | Line exceeds 80 characters; contains 85 characters (Drupal.Files.LineLength.TooLong)
 41 | WARNING | Line exceeds 80 characters; contains 92 characters (Drupal.Files.LineLength.TooLong)
 48 | ERROR   | Doc comment short description must end with a full stop (Drupal.Commenting.DocComment.ShortFullStop)
 48 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph (Drupal.Commenting.DocComment.ShortSingleLine)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 462ms; Memory: 6MB


PHP CODE SNIFFER REPORT SUMMARY
-----------------------------------------------------------------------------------------
FILE                                                                     ERRORS  WARNINGS
-----------------------------------------------------------------------------------------
/var/www/html/web/modules/custom/svg/.ddev/xhprof/xhprof_prepend.php     2       2
-----------------------------------------------------------------------------------------
A TOTAL OF 2 ERRORS AND 2 WARNINGS WERE FOUND IN 1 FILE
-----------------------------------------------------------------------------------------


PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
----------------------------------------------------------------------
SOURCE                                                           COUNT
----------------------------------------------------------------------
Drupal.Files.LineLength.TooLong                                  2
Drupal.Commenting.DocComment.ShortFullStop                       1
Drupal.Commenting.DocComment.ShortSingleLine                     1
----------------------------------------------------------------------
A TOTAL OF 4 SNIFF VIOLATIONS WERE FOUND IN 3 SOURCES
----------------------------------------------------------------------

Proposed resolution

I suppose technically we could open an upstream issue to fix this in Ddev's repo, but the file appears to be written with non-Drupal PHP standards, so it might not be accepted and ddev phpcbf would then continue to incorrectly try to apply Drupal formatting to the file anyway.

Should we instead open an issue to exclude .ddev/xhprof folder in

https://git.drupalcode.org/project/gitlab_templates/-/blob/main/assets/phpcs.xml.dist

Open to other approaches

Drupal 11 support for `ddev phpunit`

I have installed Drupal 11.0-dev to investigate issues with the phpunit (next major) pipeline in https://gitlab.com/drupalspoons/devel/-/jobs/7146821758. Pipeline from gitlab templates invokes phpunit differently than ddev-drupal-contrib:

sudo -u www-data -E vendor/bin/phpunit  --bootstrap /builds/drupalspoons/devel/web/core/tests/bootstrap.php /builds/drupalspoons/devel/web/modules/custom/devel --log-junit /builds/drupalspoons/devel/junit.xml  

When I try to run phpunit in my local project using ddev phpunit, I get the following error:
obraz

The PHPUnit 10.5 documentation seems to indicate that there is no --printer flag.

In .ddev/commands/phpunit there is the following code:
phpunit --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@"

I have noticed that HtmlOutputPrinter is present in Drupal 10.3, but has been moved/removed/modified in 11.x.

After some digging I have found Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger that might be helpful.

However, simply removing --printer="\Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger" part of the command so that only phpunit --bootstrap $PWD/$DDEV_DOCROOT/core/tests/bootstrap.php --testdox $DDEV_DOCROOT/modules/custom "$@" remains, allows phpunit to run properly (still, I am not sure if output is formatted/handled as expected):
obraz

Where are the generated HTML-pages saved?

After running PHPUnit tests with DDEV Selenium Standalone Chrome, a lot of helpful HTML-pages are available in the web/sites/simpletest/browser_output folder.

Is it also possible to get those pages generated in this project as well? Or maybe they already exist?

"web/sites/simpletest/browser_output" folder
$ ddev exec -d /var/www/html/web "../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist --group olivero"
PHPUnit 9.6.15 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.13
Configuration: ./core/phpunit.xml.dist

Testing 
............                                                      12 / 12 (100%)

Time: 01:08.996, Memory: 148.00 MB

OK (12 tests, 166 assertions)

HTML output was generated
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-64-46741147.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-65-81885199.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-66-81885199.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-67-81885199.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-68-81885199.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-69-92476413.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-70-92476413.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-71-92476413.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-72-92476413.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-73-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-74-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-75-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-76-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-77-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-78-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-79-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-80-72834784.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-81-92586057.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-82-92586057.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-83-92586057.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalTests_Theme_OliveroTest-84-92586057.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-1-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-2-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-3-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-4-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-5-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-6-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-7-66562622.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-8-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-9-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-10-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-11-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-12-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-13-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-14-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-15-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-16-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-17-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-18-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-19-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-20-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-21-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-22-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-23-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-24-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-25-56519317.html
https://drupal10.ddev.site/sites/simpletest/browser_output/Drupal_FunctionalJavascriptTests_Theme_OliveroMessagesTest-26-56519317.html

Remaining self deprecation notices (1)

  1x: The Drupal\Tests\field\Traits\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941
    1x in KernelTestSuite::suite from Drupal\Tests\TestSuites

Failed to execute command ../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist --group olivero: exit status 1

Document `ddev phpcbf`

The README mentions ddev phpcs, but ddev phpcbf works as well and should be documented.

Provide single-command setup documentation

Description

I would love to be able to offer folks wanting to set this up a single-command solution of some kind. I wrote the following bash script below which I am testing locally, but I am trying to determine a better way to provide something that could live in this repo. The problem is that folks won't have this repo (nor should they need it) when they are setting this up on a contrib project. 🤔

#!/bin/bash
set -ex

read -p "Enter project name: " projectname
ddev config --project-name=$projectname --project-type=drupal10 --docroot=web --create-docroot --php-version=8.1
ddev get ddev/ddev-drupal-contrib
ddev start
ddev poser
ddev symlink-project

DDEV `drush` command not found

I'm working on a contrib module using this add-on. The module's composer.json has no Drush dependency.

After doing all stuff from README, I realize that I want to install the site

$ ddev drush si
Error: unknown command "drush" for "ddev"

Did you mean this?
	push

Run 'ddev --help' for usage.

That makes totally sense. I guess because Drush is not installed.

$ ddev composer require --dev drush/drush

I restart DDEV $ ddev restart and run again $ ddev poser

Let's try again...

$ ddev drush si
Error: unknown command "drush" for "ddev"

Did you mean this?
	push

Run 'ddev --help' for usage.

Feature Request: `ddev poser` should install Drush

If you run ddev poser, and then try to run Drush, you can't because it's not installed. If you then try to install it with ddev composer require drush/drush, it won't work, because composer.json isn't expanded.

https://github.com/ddev/ddev-drupal-contrib/blob/main/commands/web/poser

Consider this:

export COMPOSER=composer.contrib.json
.ddev/commands/web/expand-composer-json "$DDEV_PROJECT_NAME"
composer install
composer require drush/drush
rm composer.contrib.json composer.contrib.lock
yarn --cwd $DDEV_DOCROOT/core install
touch $DDEV_DOCROOT/core/.env

ddev phpunit Producing Different Results Compared to GitLab CI

Description

Running ddev phpunit produces different results than when PHPUnit is run via GitLab CI

While attempting to enable GitLab CI testing to the remote_stream_wrapper_widget Drupal module, PHPUnit tests finish with two errors. I am trying to reproduce the failures locally using ddev-drupal-contrib, but when I run ddev phpunit the tests pass.

To Reproduce

  1. Run the installation steps defined in this module's README:
    1. Clone remote_stream_wrapper_widget.
    2. ddev config --project-name=remote-stream-wrapper-widget --project-type=drupal10 --docroot=web --create-docroot --php-version=8.1
    3. ddev get ddev/ddev-drupal-contrib
    4. ddev start
    5. ddev poser
    6. ddev symlink-project
  2. Fetch issue fork:
    git remote add remote_stream_wrapper_widget-3402509 [email protected]:issue/remote_stream_wrapper_widget-3402509.git git fetch remote_stream_wrapper_widget-3402509
  3. Checkout issue branch:
    git checkout -b '3402509-enable-gitlab-ci' --track remote_stream_wrapper_widget-3402509/'3402509-enable-gitlab-ci'
  4. Run ddev phpunit

Expected Behavior

I expect(? hope? 😄) to get the same results when running ddev phpunit using this integration as I see when GitLab CI is run with the default Drupal.org configuration.

Screenshots

GitLab CI Failures

CleanShot 2023-11-17 at 16 49 50@2x

DDEV Passes

CleanShot 2023-11-17 at 16 53 32@2x

Improve installation instructions

The installation instructions say

Configure DDEV for Drupal 10 using ddev config --project-name=[contrib module] --docroot=web --php-version=8.1

Much later on there is a troubleshooting section which says

The commands from this addon are available when the project type a valid drupal type. [sic]

To avoid the commands from failing, the need for the troubleshooting section, and general sadness, you could update the config command to ddev config --project-name=[contrib module] --docroot=web --php-version=8.1 --project-type=drupal for the situation when the type autodetection does not work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.