Repository navigation
feat(shopware6): bundle shopware-cli and hot-reload watchers - #8597
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
rfay
left a comment
There was a problem hiding this comment.
- The test doesn't work, please try it out locally, needs help.
Failed to create temp directory , err=mkdirtemp TestShopware6WebImageDockerfile/shopware6-gets-binary: pattern contains path separator, see all the failed tests, but https://github.com/ddev/ddev/actions/runs/29592125780/job/87923587723?pr=8597 - If you think there's risk in the watcher, please make sure it has good tests, perhaps in the shopware6.bats? (But add test coverate there regardless)
Thanks for working on this and for your expertise with shopware!
f96daf8 to
7840967
Compare
Thanks for your feedback, both should be resolved now. |
rfay
left a comment
There was a problem hiding this comment.
Good job working on this! It's pretty fragile as-is, but I know you'll push it better.
- Use the released shopware CLI, not the dockerhub image, for the source
- Don't use fragile literal version numbers
- If possible, let's not wire the ports in there, as that's much too fragile. DDEV allocates ports just fine using web_extra_exposed_ports, and those ports are available. Assuming that these are HTTP/S (I think they are) then you they'll just be bound on the router.
|
|
||
| # admin-watch validates its args (and thus actually runs in-container) without | ||
| # starting the long-running Vite server. | ||
| run ddev admin-watch |
There was a problem hiding this comment.
This is pretty good. If there's any way to actually validate admin-watch doing something it would be even better.
There was a problem hiding this comment.
I am afraid this will be rather difficult, as this admin-watch requires a plugin installed that a) actually extends Shopware admin and b) is conformant with the watcher requirements. Shopware's plugin SwagPayPal, which is shipped by default, does not fulfill b) itself. So running admin-watch would require to install an arbitraty plugin compatible plugin first, adding one more dependency. Is it worth it?
| // findWebExposedPort returns the WebExposedPort with the given container port, | ||
| // or nil if none is present. Used to assert on the watcher ports added by the | ||
| // shopware6 configOverrideAction. | ||
| func findWebExposedPort(ports []ddevapp.WebExposedPort, containerPort int) *ddevapp.WebExposedPort { |
There was a problem hiding this comment.
It seems like we should already have direct access to this. What are we trying to accomplish here?
There was a problem hiding this comment.
that's coupled to the ports issue, postponed
| // Targets Shopware 6.7.4.2+ (Vite admin on 5173); see the bundled commands/web | ||
| // watchers. | ||
| func shopware6ConfigOverrideAction(app *DdevApp) error { | ||
| watcherPorts := []WebExposedPort{ |
There was a problem hiding this comment.
I don't think this is the right way to do this, and these ports are inappropriate. (9999 is used quite a lot of places).
Why don't we use the actual automatic port, like so many of the custom commands do?
There was a problem hiding this comment.
Definitely do not use 9999/9998. Are those recommended somewhere? They just have so many conflicts. It doesn't matter what the port is inside teh container, but the one used on the host should be something not terribly likely to have a conflict.
There was a problem hiding this comment.
Do you have any alternative port ranges in mind? 10520 ff.?
I can confirm that Shopware uses and documents the values 9998/9999. But yes, they can be customised (with definitions in several places). I’ve been using these ports for years with DDEV; Shopware developers are used to them, and I’ve never had any problems with them nor heard of any complaints.
There was a problem hiding this comment.
I'm not sure how best to deal with this, but at least it should be possible to get around it with environment variables.
Can you please clarify?
|
@rfay I have updated the PR following your suggestions 1 and 2. With 3 (ports) I need your help please to better understand your point. |
|
Sorry I hadn't responded yet to your specfics, I just have to spend a little more time with it. I sure liked that you optionally added the CLI into the web container instead of always adding it like we've done in the regular Dockerfile build. |
rfay
left a comment
There was a problem hiding this comment.
Hmm, maybe GitHub is leading me astray, but it just seemed like you marked all my comments as resolved but they weren't resolved.
I'll try manual testing this now.
| // Targets Shopware 6.7.4.2+ (Vite admin on 5173); see the bundled commands/web | ||
| // watchers. | ||
| func shopware6ConfigOverrideAction(app *DdevApp) error { | ||
| watcherPorts := []WebExposedPort{ |
There was a problem hiding this comment.
Definitely do not use 9999/9998. Are those recommended somewhere? They just have so many conflicts. It doesn't matter what the port is inside teh container, but the one used on the host should be something not terribly likely to have a conflict.
|
I need more help with the manual testing instructions. Remember I'm a Shopware novice.
I have no idea what SwagPayPal is or how to install it. Please give explicit step-by-step instructions (edit the OP) and start with a quickstart-based instruction, refer to https://ddev--8597.org.readthedocs.build/en/8597/users/quickstart/#shopware Your OP testing instructions should also refer to https://ddev--8597.org.readthedocs.build/en/8597/users/quickstart/#shopware-cli-and-hot-reload-watchers (And anything else you added) |
…nd tests Address PR review feedback (ddev#8597): - config.go/shopware6.go: install shopware-cli from its official GitHub release (version-less "latest" asset) instead of COPY --from the DockerHub image, avoiding DockerHub pull limits and a pinned version literal - shopware6.go: extract the release tarball with tar --no-same-owner (+ chmod 0755) so the binary is owned by root:root like every other tool in /usr/local/bin, not the goreleaser build uid (1001:1001) - versionconstants.go: drop the now-unused ShopwareCLIImage constant (it was neither a floating ref nor an image reference anymore) - shopware.bats: assert a version-shaped string via --regexp rather than a hardcoded version literal - shopware6_test.go: remove TestShopware6WebImageDockerfile; the bundled binary is validated in-container by the bats `ddev shopware-cli --version` check, which is the correct level rather than asserting on Dockerfile text - quickstart.md: point the shopware-cli link at the GitHub project, not the DockerHub image page Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sorry, I apologise for wasting your time, missed the push - it should be up by now. I am working on the manual test instructions, so please hold on. |
You are absolutely right. I updated the manual testing instructions. But .... ... while working this out, I noticed shopware-cli:latest that is 0.16.9 has a bug in admin-watch (see shopware/shopware-cli#1233). So no point for you to continue with the testing, unless you replace shopware-cli with 0.16.7 (or wait for the fix). What is the correct way to handle this?
|
|
@rfay A quick update: Shopware has fixed the issue with the admin watcher (I was able to test the fix), but not yet released. I expect it for early next week and shall let you know. If you could provide some feedback on the following two points: |
|
I'm going to prefer the latest stable version of the CLI, it just makes long term management better. I'll suggest alternate ports when I review, unless you think the 9999 is really important to use. If you don't mind, can I wait for the upstream fix to be released before next review? |
Yes, of course, there’s no rush |
…nd tests Address PR review feedback (ddev#8597): - config.go/shopware6.go: install shopware-cli from its official GitHub release (version-less "latest" asset) instead of COPY --from the DockerHub image, avoiding DockerHub pull limits and a pinned version literal - shopware6.go: extract the release tarball with tar --no-same-owner (+ chmod 0755) so the binary is owned by root:root like every other tool in /usr/local/bin, not the goreleaser build uid (1001:1001) - versionconstants.go: drop the now-unused ShopwareCLIImage constant (it was neither a floating ref nor an image reference anymore) - shopware.bats: assert a version-shaped string via --regexp rather than a hardcoded version literal - shopware6_test.go: remove TestShopware6WebImageDockerfile; the bundled binary is validated in-container by the bats `ddev shopware-cli --version` check, which is the correct level rather than asserting on Dockerfile text - quickstart.md: point the shopware-cli link at the GitHub project, not the DockerHub image page Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… ports Address review feedback on PR ddev#8597. - Move shopware6_test.go into the internal `package ddevapp` so the tests call the real setShopware6SiteSettingsPaths / shopware6PostStartAction and reuse hasWebExposedPort, instead of reimplementing them as wrappers/helpers that can silently drift from production. Port assertions now use require.ElementsMatch against the expected WebExposedPort set. Switch to t.TempDir() to avoid the testcommon -> ddevapp import cycle. - Move the watcher http_port fillers off the collision-prone 5172/8888/8889 to 19172/19998/19999. These ports are never referenced at runtime (the watchers advertise HTTPS-only URLs); they exist solely to satisfy the http_port != https_port validation. container_port/https_port (5173/9998/9999) are unchanged pending a maintainer-preferred band. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
dbf52e8 to
9b8d0e0
Compare
|
I subscribed to shopware-cli releases so should see when it hits the release. I guess it just barely missed the latest one. |
…nd tests Address PR review feedback (ddev#8597): - config.go/shopware6.go: install shopware-cli from its official GitHub release (version-less "latest" asset) instead of COPY --from the DockerHub image, avoiding DockerHub pull limits and a pinned version literal - shopware6.go: extract the release tarball with tar --no-same-owner (+ chmod 0755) so the binary is owned by root:root like every other tool in /usr/local/bin, not the goreleaser build uid (1001:1001) - versionconstants.go: drop the now-unused ShopwareCLIImage constant (it was neither a floating ref nor an image reference anymore) - shopware.bats: assert a version-shaped string via --regexp rather than a hardcoded version literal - shopware6_test.go: remove TestShopware6WebImageDockerfile; the bundled binary is validated in-container by the bats `ddev shopware-cli --version` check, which is the correct level rather than asserting on Dockerfile text - quickstart.md: point the shopware-cli link at the GitHub project, not the DockerHub image page Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… ports Address review feedback on PR ddev#8597. - Move shopware6_test.go into the internal `package ddevapp` so the tests call the real setShopware6SiteSettingsPaths / shopware6PostStartAction and reuse hasWebExposedPort, instead of reimplementing them as wrappers/helpers that can silently drift from production. Port assertions now use require.ElementsMatch against the expected WebExposedPort set. Switch to t.TempDir() to avoid the testcommon -> ddevapp import cycle. - Move the watcher http_port fillers off the collision-prone 5172/8888/8889 to 19172/19998/19999. These ports are never referenced at runtime (the watchers advertise HTTPS-only URLs); they exist solely to satisfy the http_port != https_port validation. container_port/https_port (5173/9998/9999) are unchanged pending a maintainer-preferred band. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ct type
Make the functionality of the ddev-shopware-cli add-on available to shopware6
projects without a separate install: bake the shopware-cli binary into the web
image, expose the watcher ports, and ship the watcher commands.
- config.go: bake the shopware-cli binary into the web image for shopware6
projects via COPY --from=shopware/shopware-cli:bin
- shopware6.go: expose the watcher ports (5173/9998/9999) via
configOverrideAction, idempotently and without clobbering user ports
- commands/web/{shopware-cli,admin-watch,storefront-watch}: bundled web
commands gated to shopware6 via "## ProjectTypes". They call the binary by
absolute path (no PATH recursion) and set the watcher env (PROXY_URL from the
live DDEV_PRIMARY_URL) at runtime rather than via fragile web_environment
- shopware6_test.go: tests for the port override (idempotency, user-value
preservation) and the Dockerfile binary injection
Targets Shopware 6.7.4.2+ (Vite admin on 5173).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…tart bats Add watcher assertions to docs/tests/shopware.bats to guard the risky parts of the bundled shopware-cli/admin-watch/storefront-watch commands: - assert the baked-in shopware-cli binary works and matches the pinned version (ShopwareCLIImage, 0.16.7), covering the COPY --from image build and proving the wrapper does not recurse via $PATH - assert admin-watch/storefront-watch resolve via `ddev help`, proving the ## ProjectTypes: shopware6 gate registers them for this project type - assert `ddev admin-watch` with no args fails with its usage message Deliberately does not launch the long-running watcher servers, and leaves port-exposure coverage to TestShopware6ConfigOverrideAction. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…nd tests Address PR review feedback (ddev#8597): - config.go/shopware6.go: install shopware-cli from its official GitHub release (version-less "latest" asset) instead of COPY --from the DockerHub image, avoiding DockerHub pull limits and a pinned version literal - shopware6.go: extract the release tarball with tar --no-same-owner (+ chmod 0755) so the binary is owned by root:root like every other tool in /usr/local/bin, not the goreleaser build uid (1001:1001) - versionconstants.go: drop the now-unused ShopwareCLIImage constant (it was neither a floating ref nor an image reference anymore) - shopware.bats: assert a version-shaped string via --regexp rather than a hardcoded version literal - shopware6_test.go: remove TestShopware6WebImageDockerfile; the bundled binary is validated in-container by the bats `ddev shopware-cli --version` check, which is the correct level rather than asserting on Dockerfile text - quickstart.md: point the shopware-cli link at the GitHub project, not the DockerHub image page Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… ports Address review feedback on PR ddev#8597. - Move shopware6_test.go into the internal `package ddevapp` so the tests call the real setShopware6SiteSettingsPaths / shopware6PostStartAction and reuse hasWebExposedPort, instead of reimplementing them as wrappers/helpers that can silently drift from production. Port assertions now use require.ElementsMatch against the expected WebExposedPort set. Switch to t.TempDir() to avoid the testcommon -> ddevapp import cycle. - Move the watcher http_port fillers off the collision-prone 5172/8888/8889 to 19172/19998/19999. These ports are never referenced at runtime (the watchers advertise HTTPS-only URLs); they exist solely to satisfy the http_port != https_port validation. container_port/https_port (5173/9998/9999) are unchanged pending a maintainer-preferred band. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The admin-watch command built its shop URL and --external-url from
https://${DDEV_HOSTNAME}, but DDEV_HOSTNAME becomes a comma-separated
list when additional_hostnames are configured, producing a broken URL.
Use DDEV_PRIMARY_URL_WITHOUT_PORT instead, which is the canonical single
project URL with the scheme included.
Apply the same variable to storefront-watch's PROXY_URL so appending
":9998" can never double a port (e.g. https://site.ddev.site:443:9998).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
d10967c to
2dc8669
Compare
rfay
left a comment
There was a problem hiding this comment.
Hi @vanWittlaer - I went through this, made some minor adjustments to comments, rebased it. It seems like it's OK, but please check it over and go through the quickstart.
I see this warning about "old HMR mode", which seems like the usage might be incorrect now?

|
Thx @rfay thanks for your feedback. I just went through the quickstart and all green. About the "Old HMR mode" warning: yes, when 6.8 is out we need to work on this. Best if we can find a way to support both modes in parallel (the new Vite one hopefull being even simpler). I have no clue how stable 6.8 is with regard to this, but it is on my shortlist to figure out). |
|
@vanWittlaer it looked to me like this probably meant that the approach in this PR was now out of date? Thanks for taking a look. |
|
@rfay no our approach is correct for Shopware 6.7. And 6.8 is not out yet. My understanding of the warning message is that this "old HMR" i.e. webpack will be deprecated in 6.8, though still available - so a rather early warning. (Or call it Shopware-speeak if you like). |
rfay
left a comment
There was a problem hiding this comment.
OK, thanks for paying careful attention to this. We'll appreciate you keeping track of it. I find that warning pretty strange if it's a future-side warning.
|
Thanks so much for watching out for Shopware users on DDEV @vanWittlaer ! We'll look forward to your contributions going forward. @stasadev points out that 6.8 appears to be very near, https://github.com/shopware/shopware/blob/trunk/UPGRADE-6.8.md |
|
🎉 This PR is included in the v1.25.4 release. |
|
Hey @vanWittlaer @rfay @stasadev, Product Manager from Shopware/DX Tools team here. Greatly appreciate this! As we head into Q4 would be very interested in getting your thoughts about our roadmap and how we might be able to improve the CLI, boost each others' signals, or collaborate. If that sounds interesting to you, just let me know here and I'll reach out to @vanWittlaer over Discord to set up a call (will make it EU/US timezone-friendly). |
|
@lasomethingsomething likewise - We always want DDEV to serve our shopware friends better, so always interested in how it can grow that direction. |
…ed, fixes #8824 ## 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 - Fixes #8824 ## 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 - `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). ## 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](https://claude.ai/code) Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ed, fixes #8824 ## 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 - Fixes #8824 ## 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 - `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). ## 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](https://claude.ai/code) Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ed, fixes #8824 ## 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 - Fixes #8824 ## 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 - `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). ## 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](https://claude.ai/code) Co-Authored-By: Claude Sonnet 5 <[email protected]>
…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]>
…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]>
…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]>
The Issue
Shopware's standard tooling nowadays is shopware-cli. Currently requires manual install or add-on. Also, special configuration is required for using Shopware's storefront and admin watchers.
How This PR Solves The Issue
Make the functionality of the ddev-shopware-cli add-on available to shopware6 projects without a separate install: bake the shopware-cli binary into the web image, expose the watcher ports, and ship the watcher commands.
Targets Shopware 6.7.4.2+ (Vite admin on 5173).
Notes
a) One potential problem could be the frequent changes to the watchers made by Shopware, which in the past have even been implemented between minor versions without regard for backwards compatibility. Another major change has been announced for the next major version, 6.8. This could become an issue, as in practice we must assume that projects running on major versions n-1 and n-2 will remain in use for extended periods.
b) The image bundled is shopware/shopware-cli:bin-0.16.7, it is pinned by default to a (more or less) arbitrary version 0.16.7 in lack of a clear release policy at this time.
Manual Testing Instructions
https://docs.ddev.com/en/stable/users/quickstart/#shopware
mkdir custom/plugins/FroshAltchaCaptchacurl -L https://github.com/FriendsOfShopware/FroshAltchaCaptcha/archive/refs/tags/1.9.0.tar.gz | tar xz --strip-components=1 -C custom/plugins/FroshAltchaCaptchaddev exec bin/console plugin:refreshddev exec bin/console plugin:install --activate -c FroshAltchaCaptchaddev exec shopware-cli project admin-build(not stricly required for testing, but recommended to see plugin active in admin)ddev launch /adminddev admin-watch custom/plugins/FroshAltchaCaptchacustom/plugins/FroshAltchaCaptcha/src/Resources/app/administration/src/core/modules/sw-settings-basic-information/component/sw-settings-captcha-select-v2/sw-settings-captcha-select-v2.html.twigddev storefront-watchcustom/plugins/FroshAltchaCaptcha/src/Resources/app/storefront/src/scss/base.scss(e.g. add a block
body { background-color: red; })Automated Testing Overview
In shopware6_test.go, TestShopware6ConfigOverrideAction verifies that the shopware6 project type exposes the shopware-cli watcher ports through the real app-type matrix (ConfigFileOverrideAction), that it is idempotent, and that it never clobbers a user's own port settings.
Release/Deployment Notes
n.a.