Skip to content

feat(dev-tooling): add console_run feature_all parameter - #172

Merged
Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
feat/dev-tooling-console-feature-all
Sep 4, 2026
Merged

Martin Bens (SpiGAndromeda) merged 1 commit into
mainfrom
feat/dev-tooling-console-feature-all

Conversation

@SpiGAndromeda

@SpiGAndromeda Martin Bens (SpiGAndromeda) commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

console_run on the php-tooling server gains an optional feature_all parameter, so the deprecation gate — FEATURE_ALL=major bin/console cache:clear — has an MCP path instead of forcing a session under MCP enforcement to drop to a raw wrapper command (docker compose exec -T -e FEATURE_ALL=major web bin/console cache:clear).

feature_all

When the new optional parameter is present (major or true), the console command's process environment inside the target environment carries FEATURE_ALL=<value>. The assignment is prefixed inside the wrapped command string (FEATURE_ALL=major bin/console …) rather than placed in front of the wrapper process, so the shell that finally runs the command — the container's, the VM's, or the host's — is the one that applies it: docker, docker-compose, and vagrant embed the string in a remote bash -c, native evals it locally, and ddev rejoins its argv through the container's bash -c. The parameter combines freely with the existing surface — feature_all: "major" plus command: "cache:clear" is the deprecation gate in one call, including env and output_file.

The enum is the whole accepted surface, and no generic env-var map is added: arbitrary names and values would reach the wrapped shell as caller-controlled strings, so a future variable gets another named, enum-bounded parameter. The value is enforced by the vendored schema validator and again inside tool_console_run() for a call that reaches the tool without the validator in front, so nothing new reaches a shell unquoted. The template-synced shared/ layer is untouched; the prefix lives in console.sh's command construction.

Limits

The prefix is asserted through the real wrap_command for the native and docker-compose environment types (docker-compose with its call-time container/workdir resolution stubbed); docker, vagrant, and ddev rest on reading wrap_command, not on tests. That FEATURE_ALL=major actually flips flag state in a live Shopware is taken from the flag's documented behavior rather than re-measured — no container ran during development.

The deprecation gate `FEATURE_ALL=major bin/console cache:clear` was the one console workflow with no MCP path. Under MCP enforcement a session had to drop to a raw wrapper command. `console_run` now takes an optional `feature_all` parameter (`major` or `true`) that carries the variable into the command's environment.

The assignment is prefixed inside the wrapped command string rather than in front of the wrapper process, so the shell that finally runs the command (the container's, the VM's, or the host's) is the one that applies it. A variable on the wrapper process would not cross the docker, docker-compose, vagrant, and ddev wrappers. The enum is the whole accepted surface, enforced by the schema validator and again in `tool_console_run()` for calls that reach the tool without the validator in front, so no caller-controlled string reaches the wrapped shell.

BATS tests cover the prefix through the real `wrap_command` for the native and docker-compose environment types, the unchanged command when the parameter is absent, both rejection layers, and composition with `env` and `output_file`. `dev-tooling` goes 3.19.0 to 3.20.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

@SpiGAndromeda
Martin Bens (SpiGAndromeda) merged commit a80b842 into main Sep 4, 2026
13 checks passed
@SpiGAndromeda
Martin Bens (SpiGAndromeda) deleted the feat/dev-tooling-console-feature-all branch September 4, 2026 09:37
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.

1 participant