Skip to content

(#5046) Implement DDev#5091

Merged
bryanpizzillo merged 1 commit into
developfrom
ticket/5046-ddev
Feb 18, 2026
Merged

(#5046) Implement DDev#5091
bryanpizzillo merged 1 commit into
developfrom
ticket/5046-ddev

Conversation

@bryanpizzillo
Copy link
Copy Markdown
Member

@bryanpizzillo bryanpizzillo commented Dec 23, 2025

This updates the tech stack to use MySQL 8, but also it is a refresh of the dev stack to be easier to use.

Closes #5046

Notes

DB Persistence

The DB contents survive on restart and rebuild.

Addons

With DDev, most add-ons seem to be separate services, OR, maybe better put, what one might think should be installed in the web service might not be done that way, but added as a separate service.

  • ddev-selenium-standalone-chrome is a perfect example of this. It is an add-on for installing selenium and chrome, but it actually is a headless chrome browser running in a separate container. This add-on sets up everything for drupal testing. (Kernel, Functional, Functional Javascript, and Nightwatch.
    • This means requests actually hit the web service from another container, which required some slight changes to a js_app_module test.
  • There is a lovely addon for cypress, https://github.com/ddev/ddev-cypress
    • but it does not do what we want:
      1. It just mounts the e2e folder into a cypress service, which does not allow for our setup. (plugins and support)
      2. It adds in a separate service/container with preinstalled software, so no cypress-parallel.
    • It does have hints on how to run cypress interactively though...

Mutagen

DDev by default uses mutagen to handle file synchronization. It is supposed to be faster than normal bind mounting. In fact an install took like 4:30 on my M1.
There is a major downside that we need to evaluate: if you switch branches or make other edits when the container is down, upon restart, the files in the container are synchronized back to the host. I can see this cause all kinds of issues.

@bryanpizzillo
Copy link
Copy Markdown
Member Author

bryanpizzillo commented Feb 10, 2026

@blairlearn to test:

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a DDEV-based local development stack and updates supporting configuration to align with a MySQL 8 / PHP 8.3 workflow, including Drupal settings integration and updated browser-testing container wiring.

Changes:

  • Add DDEV configuration (core config, mounts, hooks, selenium-chrome addon configs, helper command, and web-build customization).
  • Adjust Drupal settings layering to load DDEV settings via Acquia Recommended Settings/global includes.
  • Update a functional test to tolerate different SIMPLETEST_BASE_URL hosts, and adjust PHPUnit output printer.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
phpunit.xml Switch PHPUnit result printer implementation.
docroot/sites/settings/global.settings.php Load settings.ddev.php from a global settings include when running under DDEV.
docroot/sites/default/settings/default.local.settings.php Refresh local settings template and adjust paths/assertion handling.
docroot/sites/default/settings/default.includes.settings.php Update guidance/comments and add phpcs:ignore for requires.
docroot/sites/default/settings.php Add an early return; to prevent DDEV from re-injecting its include; relies on global include instead.
docroot/sites/default/settings.ddev.php Add DDEV-managed Drupal settings (DB config, logging, mail transport overrides, etc.).
docroot/modules/custom/cgov_js_app_module/tests/src/Functional/JSOnlyAppModulePluginBuildTest.php Normalize expected config output across varying base URLs.
.ddev/web-build/pre.Dockerfile.certificates Attempt to install NIH root certs during web image build.
.ddev/docker-compose.selenium-chrome_extras.yaml DDEV selenium-chrome routing/external link wiring.
.ddev/docker-compose.selenium-chrome.yaml Add selenium standalone chromium service and link it to web.
.ddev/docker-compose.mounts.yml Mount host auth files into the web container for npm/composer.
.ddev/config.yaml Define DDEV project config, hooks, MySQL 8, PHP 8.3, node version, and extra packages.
.ddev/config.selenium-standalone-chrome.yaml Provide environment variables for Drupal browser testing via selenium container.
.ddev/commands/web/blt Add a ddev blt helper command.
.ddev/addon-metadata/ddev-selenium-standalone-chrome/manifest.yaml Track installed DDEV addon metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docroot/sites/default/settings/default.local.settings.php Outdated
Comment thread .ddev/docker-compose.selenium-chrome.yaml
Comment thread .ddev/web-build/pre.Dockerfile.certificates Outdated
Comment thread .ddev/config.yaml
Comment thread .ddev/config.yaml
Comment thread .ddev/config.yaml Outdated
Comment thread docroot/sites/default/settings.php
Comment thread docroot/sites/default/settings.ddev.php
## https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token
## You should only need read:packages if you are not someone
## that works with it frequently enough to know what this
## iss. (For read-only don't follow the npm login steps)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "iss." → "is."

Suggested change
## iss. (For read-only don't follow the npm login steps)
## is. (For read-only don't follow the npm login steps)

Copilot uses AI. Check for mistakes.
Comment thread docroot/sites/default/settings.php Outdated
@blairlearn
Copy link
Copy Markdown
Contributor

On my system, CyLance (antivirus) blocks attempts to install certificates with mkcert.
To work around this:

  1. In the .ddev directory, create config.local.yaml. Settings in this file override those in config.yaml.
  2. Add the line outer_https_port: "".
    • This prevents ddev from attempting to use HTTPS and port 443.
    • There will still be a warning that mkcert has not been installed.
  3. When you run ddev, sites will be available using http:// instead of https://.

@blairlearn
Copy link
Copy Markdown
Contributor

Does the old stack run?

Yes. With some hacking.

These steps assume you have NOT run any ddev commands.

  1. Clone the repo
  2. Switch to the ticket/5046-ddev branch (eventually develop)
  3. composer cgov-init
  4. composer install
  5. docker compose -f ./docker/docker-compose.yml up -d
  6. docker compose -f ./docker/docker-compose.yml exec web bash
  7. blt setup --no-interaction
    • This command will fail.
    • Continue to the next step.
  8. Add these lines at the top of docroot/sites/default/settings/default.local.settings.php
    $db_name = '${drupal.db.database}';
    
    if (isset($_acsf_site_name)) {
      $db_name .= '_' . $_acsf_site_name;
    }
    
    /**
     * Database configuration.
     */
    $databases = array(
      'default' =>
      array(
        'default' =>
        array(
          'database' => $db_name,
          'username' => '${drupal.db.username}',
          'password' => '${drupal.db.password}',
          'host' => '${drupal.db.host}',
          'port' => '${drupal.db.port}',
          'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
          'driver' => 'mysql',
          'prefix' => '',
        ),
      ),
    );
  9. blt cgov:reinstall --no-interaction

@blairlearn
Copy link
Copy Markdown
Contributor

Can you XDebug?

Yes; with notes.

The obvious: Change your .vscode/launch.json to use:

            "port": 9003,
            "pathMappings": {
              "/var/www/html/docroot": "${workspaceRoot}/docroot",
              "/var/www/html/vendor": "${workspaceRoot}/vendor"
            }

The non-obvious: Our docker/web/build/php-conf/xdebug.ini is ignored. In fact, ddev supplies its own copies of everything in the mods-available directory, so that should be removed from the Dockerfile as well as the docker/web/build/php-conf directory.

- Needed to update settings.php to support ddev.
- Changed PHPUnit printerClass to default so excess html files are not created each run.
- Needed to allow ddev host in js app module config to as it uses something different than our old code did.

Closes #5046
@bryanpizzillo bryanpizzillo marked this pull request as ready for review February 18, 2026 15:08
@bryanpizzillo bryanpizzillo requested a review from a team as a code owner February 18, 2026 15:08
@bryanpizzillo bryanpizzillo merged commit 4101248 into develop Feb 18, 2026
6 checks passed
@bryanpizzillo bryanpizzillo deleted the ticket/5046-ddev branch February 18, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Docker and CI/CD to Acquia Cloud Next tech (ddev)

3 participants