[make:webhook] Fix the crash under --no-interaction - #1817
Draft
wachterjohannes wants to merge 1 commit into
Draft
[make:webhook] Fix the crash under --no-interaction#1817wachterjohannes wants to merge 1 commit into
wachterjohannes wants to merge 1 commit into
Conversation
The name argument was already declared, and already marked
non-interactive, but interact() copied it onto the maker and generate()
read it back from there. Command::run() skips interact() without a
terminal, so the copy never happened:
$ php bin/console make:webhook remote_service --no-interaction
Typed property MakeWebhook::$name must not be accessed before
initialization
generate() now reads the argument it was given. The name check that
interact() applied moved next to it, so a name with illegal characters
is rejected on both paths instead of only when someone is watching.
symfony/webhook was installed from interact(), which is the one place
that does not always run, and the generated parser extends a class from
that package. The install moved to generate(), the step that always
runs, rather than being called from both: a second composer require in
the same process rebuilds the container underneath the command and the
run dies afterwards on a stale cache file.
$io was being stashed on the maker as well. It is passed to the one
private method that asks anything, and the property is gone along with
the one holding the name.
wachterjohannes
force-pushed
the
fix/make-webhook-non-interactive
branch
from
August 31, 2026 17:37
15359ec to
f56af5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make:webhookalready declares itsnameargument, and already marks it non-interactive, so it looks scriptable. It is not:Cause
interact()read the argument and copied it onto the maker, andgenerate()read it back from there.Command::run()skipsinteract()under--no-interaction, so the copy never happened.$iowas stashed on the maker in the same way.Fix
generate()reads the argument it was given. The name check thatinteract()applied moved next to that read, so a name with illegal characters is rejected on both paths rather than only when someone is watching.$iois passed to the one private method that asks anything, and both properties are gone.symfony/webhookwas installed frominteract(), which is the one step that does not always run, and the generated request parser extendsAbstractRequestParserfrom that package. The install moved togenerate(), which always runs, rather than being called from both: a secondcomposer requirein the same process rebuilds the container underneath the running command, and the run then dies on a stale cache file. The one visible change interactively is that the install now happens after the questions instead of before.Tests
Two non-interactive cases in
MakeWebhookTest: one generating the parser and the consumer and checking thewebhook.yamlrouting entry, one asserting an invalid name is rejected before anything is written. The first fails on1.xwith the error above.Why
Part of a series making the makers usable by coding agents, which cannot answer prompts. Same framing as #1814 and #1815.