Pass --no-security-blocking only to composer install - #283
Conversation
sirreal
left a comment
There was a problem hiding this comment.
Note
This is an agentic review, generated by Claude Code at the repository owner's request.
Ready to land. Land this before #276 — they collide on the same composer line.
Verified
-
CI green on 7.4 and 8.4; mergeable, clean, based on
master. -
The premise reproduces independently. On Composer 2.10.2,
--no-security-blockingis listed only undercomposer help install(and the other install-family commands), not as a global option —composer help validatedoes not mention it, and runningcomposer --no-interaction --no-security-blocking validatefails with:The "--no-security-blocking" option does not exist.
Dropping the flag makes the same command report
./composer.json is valid. Exactly the behavior described in the PR body. -
The flag is retained where it is actually needed:
composer:setup(the onlyinstallpath inpackage.json) is untouched, and.github/workflows/unit-test.ymlinvokescomposer install --no-interaction --no-security-blockingdirectly, so CI is unaffected. One line changed, nothing else.
Worth noting
--no-security-blockingis deprecated as of Composer 2.10, in favour of--no-blocking: "DEPRECATED: use --no-blocking instead." Out of scope here — this PR is a strict improvement either way — but a small follow-up should sweep both remaining uses (package.json'scomposer:setupandunit-test.yml) before the option is removed.- Minor consequence, presumably intended:
npm run composer -- installandnpm run composer -- updatenow go without the flag. The blessed path (composer:setup) still has it, so this only affects ad-hoc passthrough use.
Ordering
#276 rewrites all three of these script lines to derive the plugin directory, so the two PRs conflict on the composer entry. Landing this first is the cheaper order; #276 then just drops --no-security-blocking from its rewritten passthrough line, leaving:
"composer": "wp-env --config .wp-env.test.json run --env-cwd=\"wp-content/plugins/$(basename \"$PWD\")\" wordpress composer --no-interaction"
--no-security-blockingis an install/update option, but the genericcomposerpassthrough script passes it to every command, so anything else fails — e.g.npm run composer -- validate. The flag stays oncomposer:setup(install), and the passthrough keeps only--no-interaction.Verified in the PHP 7.4 wordpress container:
composer --no-interaction --no-security-blocking validateexits 1; without the flag it reports./composer.json is valid.composer install --no-interaction --no-security-blockingcontinues to work (unchangedcomposer:setuppath).Overlaps trivially with #276, which rewrites the same lines to derive the plugin directory; whichever lands second rebases in seconds.
🤖 Generated with Claude Code