Skip to content

fix: install project-type-specific web image utilities only when needed, fixes #8824 - #8828

Merged
rfay merged 11 commits into
mainfrom
20260914_rfay_utilities_extra_layer
Sep 23, 2026
Merged

rfay merged 11 commits into
mainfrom
20260914_rfay_utilities_extra_layer

Conversation

@rfay

@rfay rfay commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

WP-CLI, Drush 8, the Backdrop Drush extension, magerun, magerun2, and Symfony CLI were baked into every web image regardless of project type. They're now installed only for the project types that use them, following the pattern the shopware-cli PR (#8597) already established.

The Issue

How This PR Solves The Issue

pkg/ddevapp/project_tools.go adds projectToolsInstallDockerfile(), which maps app.Type to the Dockerfile fragment(s) that install its tools: WP-CLI for wordpress/wp-bedrock, magerun for magento, magerun2 for magento2, Drush 8 for drupal6/drupal7/backdrop, the Backdrop Drush extension additionally for backdrop, and Symfony CLI for symfony. config.go calls this in place of the old shopware6-only special case, so shopware6 now also picks up Symfony CLI in addition to shopware-cli, since Shopware 6 is itself built on the Symfony framework (symfony/framework-bundle, bin/console) and can use its console proxy and requirement checks. The corresponding installs are removed from containers/ddev-webserver/Dockerfile.

Modern Drupal (8+) and other project types that merely consume individual Symfony components internally (TYPO3, Laravel, Silverstripe, Magento 2) are left out: none of them expose a bin/console or use symfony/framework-bundle, so Symfony CLI wouldn't have anything to attach to.

Manual Testing Instructions

  • Use ddev utililty download-ddev --pr 8828 to get this PR's ddev binary; then use the provided env override to use it.
  • ddev config --project-type=wordpress && ddev start, then ddev exec which wp wp-cli should succeed; on a php project type it should fail.
  • Same check for magerun/magento, magerun2/magento2, drush8/drupal7, symfony/symfony binary, and shopware-cli + symfony binary/shopware6.
  • docker exec <ddev-webserver container> command -v wp wp-cli magerun magerun2 drush8 symfony shopware-cli should all fail against the shared image directly (covered by the new bats test).
  • Compare the ddev/ddev-webserver size for this PR with the one for v1.25.5.

Automated Testing Overview

  • go test ./pkg/ddevapp/ -run TestProjectToolsDockerfile covers every project type's generated .webimageBuild/Dockerfile.
  • containers/ddev-webserver/tests/ddev-webserver/general.bats gained a test asserting none of these tools exist in the shared image.

Release/Deployment Notes

Projects that relied on Drush 8, WP-CLI, magerun, magerun2, or Symfony CLI being present without setting a matching --project-type need to either set the correct type or add the tool via a custom web-build/Dockerfile, documented in the new "Project-Specific Utilities" section of customizing-images.md.

🤖 Developed with assistance from Claude Code

Co-Authored-By: Claude Sonnet 5 [email protected]

@rfay
rfay requested review from a team as code owners September 14, 2026 17:42
@github-actions github-actions Bot added bugfix dependencies Pull requests that update a dependency file labels Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Download this PR's build for your OS and architecture with:

ddev utility download-ddev --pr 8828

Or download the artifact for your OS and architecture directly:

See Testing a PR.

Open in GitHub Codespaces

@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:a8b789560e
  • ddev/ddev-webserver:a8b789560e

@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:b1b874d97f
  • ddev/ddev-webserver:b1b874d97f

@rfay

rfay commented Sep 16, 2026 •

Copy link
Copy Markdown
Member Author

Code looks fine here.

Compressed image is more than 25MB smaller (425MB vs 398MB)

image image

There is some risk that people might use php project type and depend on these utilities.

@rfay
rfay requested a review from stasadev September 16, 2026 14:58
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from b9e41ca to d685a57 Compare September 16, 2026 17:00

@rfay rfay left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think the code here looks fine. I manually tested a number of situations and it all seems right.

Comment thread pkg/ddevapp/project_tools.go Resolved
rfay added a commit that referenced this pull request Sep 22, 2026
…ware 6, fixes #8824

`ddev console` now runs `php ./bin/console` instead of `symfony console`,
since Composer already installs `bin/console` and the Symfony CLI wrapper
adds nothing. Shopware 6 no longer installs the Symfony CLI at all, since
its console command never needed it.

The Ibexa DXP quickstart used `--project-type=php` with `ddev exec console`,
which never worked: `ddev exec` runs literal shell commands and bypasses
DDEV's custom-command registration, and `console` is scoped to
`symfony,shopware6` project types anyway. Switched it to
`--project-type=symfony` and `ddev console`, matching the plain Symfony and
Shopware quickstart sections.

Addresses review feedback from @stasadev on #8828.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from d685a57 to 3d2c75e Compare September 22, 2026 18:52
Comment thread containers/ddev-webserver/README.md Resolved
Comment thread docs/content/users/quickstart.md Resolved
Comment thread docs/content/users/quickstart.md Resolved
rfay added a commit that referenced this pull request Sep 22, 2026
…ware 6, fixes #8824

`ddev console` now runs `php ./bin/console` instead of `symfony console`,
since Composer already installs `bin/console` and the Symfony CLI wrapper
adds nothing. Shopware 6 no longer installs the Symfony CLI at all, since
its console command never needed it.

The Ibexa DXP quickstart used `--project-type=php` with `ddev exec console`,
which never worked: `ddev exec` runs literal shell commands and bypasses
DDEV's custom-command registration, and `console` is scoped to
`symfony,shopware6` project types anyway. Switched it to
`--project-type=symfony` and `ddev console`, matching the plain Symfony and
Shopware quickstart sections.

Addresses review feedback from @stasadev on #8828.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from a14c35a to a333d42 Compare September 22, 2026 21:24
Comment thread containers/ddev-webserver/README.md Resolved
@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:d97b3516eb
  • ddev/ddev-webserver:d97b3516eb

@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:c8d91b1fd8
  • ddev/ddev-webserver:c8d91b1fd8

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

One more suggestion on the difference between a quickstart and its test.

Comment thread docs/tests/ibexa.bats Resolved
@rfay

rfay commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

All should be addressed.

rfay added a commit that referenced this pull request Sep 23, 2026
…ware 6, fixes #8824

`ddev console` now runs `php ./bin/console` instead of `symfony console`,
since Composer already installs `bin/console` and the Symfony CLI wrapper
adds nothing. Shopware 6 no longer installs the Symfony CLI at all, since
its console command never needed it.

The Ibexa DXP quickstart used `--project-type=php` with `ddev exec console`,
which never worked: `ddev exec` runs literal shell commands and bypasses
DDEV's custom-command registration, and `console` is scoped to
`symfony,shopware6` project types anyway. Switched it to
`--project-type=symfony` and `ddev console`, matching the plain Symfony and
Shopware quickstart sections.

Addresses review feedback from @stasadev on #8828.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from 77d50ae to 1226c3e Compare September 23, 2026 02:04
rfay added a commit that referenced this pull request Sep 23, 2026
…ware 6, fixes #8824

`ddev console` now runs `php ./bin/console` instead of `symfony console`,
since Composer already installs `bin/console` and the Symfony CLI wrapper
adds nothing. Shopware 6 no longer installs the Symfony CLI at all, since
its console command never needed it.

The Ibexa DXP quickstart used `--project-type=php` with `ddev exec console`,
which never worked: `ddev exec` runs literal shell commands and bypasses
DDEV's custom-command registration, and `console` is scoped to
`symfony,shopware6` project types anyway. Switched it to
`--project-type=symfony` and `ddev console`, matching the plain Symfony and
Shopware quickstart sections.

Addresses review feedback from @stasadev on #8828.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from 1226c3e to 31e7bf1 Compare September 23, 2026 02:16
@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:3b665ca1d0
  • ddev/ddev-webserver:3b665ca1d0

rfay and others added 3 commits September 23, 2026 11:55
…ed, fixes #8824

WP-CLI, Drush 8, the Backdrop Drush extension, magerun, magerun2, and Symfony CLI were baked into every web image regardless of project type. They're now installed only for the project types that use them, following the pattern the shopware-cli PR (#8597) already established.

- Fixes #8824

`pkg/ddevapp/project_tools.go` adds `projectToolsInstallDockerfile()`, which maps `app.Type` to the Dockerfile fragment(s) that install its tools: WP-CLI for `wordpress`/`wp-bedrock`, magerun for `magento`, magerun2 for `magento2`, Drush 8 for `drupal6`/`drupal7`/`backdrop`, the Backdrop Drush extension additionally for `backdrop`, and Symfony CLI for `symfony`. `config.go` calls this in place of the old shopware6-only special case, so `shopware6` now also picks up Symfony CLI in addition to `shopware-cli`, since Shopware 6 is itself built on the Symfony framework (`symfony/framework-bundle`, `bin/console`) and can use its console proxy and requirement checks. The corresponding installs are removed from `containers/ddev-webserver/Dockerfile`.

Modern Drupal (8+) and other project types that merely consume individual Symfony components internally (TYPO3, Laravel, Silverstripe, Magento 2) are left out: none of them expose a `bin/console` or use `symfony/framework-bundle`, so Symfony CLI wouldn't have anything to attach to.

- `ddev config --project-type=wordpress && ddev start`, then `ddev exec which wp wp-cli` should succeed; on a `php` project type it should fail.
- Same check for `magerun`/`magento`, `magerun2`/`magento2`, `drush8`/`drupal7`, `symfony`/`symfony` binary, and `shopware-cli` + `symfony` binary/`shopware6`.
- `docker exec <ddev-webserver container> command -v wp wp-cli magerun magerun2 drush8 symfony shopware-cli` should all fail against the shared image directly (covered by the new bats test).

- `go test ./pkg/ddevapp/ -run TestProjectToolsDockerfile` covers every project type's generated `.webimageBuild/Dockerfile`.
- `containers/ddev-webserver/tests/ddev-webserver/general.bats` gained a test asserting none of these tools exist in the shared image.

Projects that relied on Drush 8, WP-CLI, magerun, magerun2, or Symfony CLI being present without setting a matching `--project-type` need to either set the correct type or add the tool via a custom `web-build/Dockerfile`, documented in the new "Project-Specific Utilities" section of `customizing-images.md`.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… baked-in Drush, fixes #8824

Both tests still assumed Drush 8 and the Backdrop Drush extension were baked
into the shared ddev-webserver image, which stopped being true once they
moved to the per-project derived build in pkg/ddevapp/project_tools.go.

TestCopyFromContainer now copies /etc/skel instead of the removed
/var/tmp/backdrop_drush_commands path. project_type.bats no longer expects
DDEV_PROJECT_TYPE=backdrop to produce a working drush symlink on the shared
image, since only a real per-project Docker build (which this container-level
harness never runs) adds that tooling; both assertions now just confirm the
tools stay absent from the shared image, for every project type in the loop.

Editing the bats file changed the containers/ddev-webserver content hash, so
`make` retagged the image and versionconstants.go picks up the new WebTag.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ware 6, fixes #8824

`ddev console` now runs `php ./bin/console` instead of `symfony console`,
since Composer already installs `bin/console` and the Symfony CLI wrapper
adds nothing. Shopware 6 no longer installs the Symfony CLI at all, since
its console command never needed it.

The Ibexa DXP quickstart used `--project-type=php` with `ddev exec console`,
which never worked: `ddev exec` runs literal shell commands and bypasses
DDEV's custom-command registration, and `console` is scoped to
`symfony,shopware6` project types anyway. Switched it to
`--project-type=symfony` and `ddev console`, matching the plain Symfony and
Shopware quickstart sections.

Addresses review feedback from @stasadev on #8828.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
rfay and others added 8 commits September 23, 2026 11:55
TestProjectToolsDockerfile/shopware6 expected both symfony-cli and
shopware-cli, since the Symfony CLI install is now dropped for Shopware 6.
docs/tests/ibexa.bats still used --project-type=php with ddev exec console,
the same bug just fixed in the quickstart docs.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…8824

Link the ddev-webserver README to project_tools.go instead of listing
utilities by project type, since that list drifts as types change. Drop
Symfony CLI from the shopware6 row in customizing-images.md, since it's
no longer installed for that type. Remove the now-redundant
--web-environment-add DATABASE_URL flag from the Ibexa quickstart and its
test, since the symfony project type sets it automatically. Align the
--no-interaction flag on ibexa:install between the walkthrough and the
script tip.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… README, fixes #8824

## Short Summary (TL;DR)

The `project_tools.go` link in the ddev-webserver README used a relative path, which breaks because this README is also published standalone to Docker Hub.

## The Issue

- Fixes #8824

## How This PR Solves The Issue

Point the link at `https://github.com/ddev/ddev/blob/main/pkg/ddevapp/project_tools.go` instead of a relative path, per @stasadev's review comment.

## Manual Testing Instructions

View https://hub.docker.com/r/ddev/ddev-webserver after this is merged and confirm the `project_tools.go` link resolves.

## Automated Testing Overview

None needed; this is a documentation link fix.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
fixes #8824 [skip buildkite]

The inline Ibexa DXP quickstart steps only ran `ibexa:install`, while the "run as a script" version below it also ran `ibexa:graphql:generate-schema`, so the two were inconsistent.

- Fixes #8824

Add `ddev console ibexa:graphql:generate-schema` to the inline steps so they match the script version, per @stasadev's review comment.

Follow the Ibexa DXP quickstart steps in docs/content/users/quickstart.md and confirm both commands run without error.

None needed; this is a documentation fix.

🤖 Developed with assistance from [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@rfay
rfay force-pushed the 20260914_rfay_utilities_extra_layer branch from 31e7bf1 to fdcd673 Compare September 23, 2026 18:01
@github-actions

Copy link
Copy Markdown

Pushed updated container image(s) for this PR:

  • ddev/ddev-webserver-prod:a0bb65fd84
  • ddev/ddev-webserver:a0bb65fd84

@rfay
rfay merged commit ef0ea52 into main Sep 23, 2026
61 checks passed
@rfay
rfay deleted the 20260914_rfay_utilities_extra_layer branch September 23, 2026 22:15
stasadev added a commit to stasadev/ddev that referenced this pull request Oct 7, 2026
…t tag on the GitHub API

Since ddev#8828 moved the extension install from the shared web image into each Backdrop project's build, every build asked `api.github.com` for the latest tag without a token. Runners share IPs and the image's `.curlrc` retries each request five times, so the 60-requests-per-hour limit for unauthenticated calls ran out and the all-project-types job failed every Backdrop build with 403.

The download now uses a fixed 1.4.1 link on the renamed `backdrop-contrib/backdrop-drush-extension` repo. 1.4.1 is the release that deprecated the extension in favor of Bee, so no newer version is coming to track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
stasadev added a commit to stasadev/ddev that referenced this pull request Oct 8, 2026
…t tag on the GitHub API

Since ddev#8828 moved the extension install from the shared web image into each Backdrop project's build, every build asked `api.github.com` for the latest tag without a token. Runners share IPs and the image's `.curlrc` retries each request five times, so the 60-requests-per-hour limit for unauthenticated calls ran out and the all-project-types job failed every Backdrop build with 403.

The download now uses a fixed 1.4.1 link on the renamed `backdrop-contrib/backdrop-drush-extension` repo. 1.4.1 is the release that deprecated the extension in favor of Bee, so no newer version is coming to track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't automatically install utilities in web image if not needed for project type

2 participants