Repository navigation
Closes #1289: fix build-zip.sh failing on dev dependency restore - #1294
Conversation
mnsami/composer-custom-directory-installer 2.3.0 type-hints PackageUtils::getPackageInstallPath() against Composer\PartialComposer. Strauss 0.31.x (pulled as "latest" by the prefix-namespaces script) loads installed Composer plugins through its own prefixed Composer, so it passes BrianHenryIE\Strauss\Composer\Composer and the call fatals with a TypeError. Any fresh install with dev dependencies then exits 255, which breaks the final "restore dev dependencies" step of bin/build-zip.sh. Pin to ~2.2.1, whose signature accepts the Strauss Composer instance. Refs #1289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | Report missing for c706a951 |
| Diff coverage | ✅ ∅ diff coverage (50.00%) |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (c706a95) Report Missing Report Missing Report Missing Head commit (471c92a) 20546 1653 8.05% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#1294) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
mnsami/composer-custom-directory-installer 2.1.0+ requires PHP >=8.1, so the ~2.2.1 pin made dependencies unresolvable on the PHP 7.4 legacy CI leg. Allow ^2.0 <2.3 instead: PHP 7.4 resolves 2.0.0 and PHP 8.1+ resolves 2.2.1, while 2.3.0 (incompatible with Strauss 0.31.x) stays excluded. Refs #1289 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
Closes #1289
bin/build-zip.shbuilds the zip, then fails at its last step ("Restoring dev dependencies") with exit code 255. Because of that, the automation-plugin-version-manager (APVM) cannot finish an Imagify build, and its CI fails. The zip itself was never affected. Only the script's exit status was.This PR caps
mnsami/composer-custom-directory-installer(a dev-only dependency) at^2.0 <2.3, which makes the script exit 0 again. PHP 7.4 resolves to 2.0.0, the only release that still supports it, and PHP 8.1+ resolves to 2.2.1.Type of change
Detailed scenario
What was tested
Manual tests, each in a fresh
git clone(nocomposer.lock, novendor/), Composer 2.7.7, PHP 8.2.30 unless the row says otherwise:develop, with the localbin/strauss.pharfrom Jan 2026develop, with Strauss downloaded fresh (as in the issue)TypeError(bug reproduced)./bin/build-zip.shimagify.zipbuilt (3.1 MB, 1255 files)composer install --no-devthencomposer install, PHP 8.2.30composer install --no-devthencomposer install, PHP 7.4.30How to test
bin/strauss.phar, so the latest Strauss gets downloaded../bin/build-zip.sh; echo "exit=$?".exit=0andgeneratedpackages/imagify.zip.develop: it ends withScript php bin/strauss.phar handling the prefix-namespaces event returned with error code 255.Affected Features & Quality Assurance Scope
Only the build and dev tooling:
composer install/composer updatewith dev dependencies, andbin/build-zip.sh. The shipped plugin is not affected, because the package is inrequire-devand is not installed by--no-devbuilds.Technical description
Documentation
mnsami/composer-custom-directory-installer2.3.0 changed the type hint onPackageUtils::getPackageInstallPath()fromComposer\ComposertoComposer\PartialComposer. Strauss 0.31.x, which theprefix-namespacesscript downloads aslatest, loads the installed Composer plugins through its own prefixed copy of Composer during its dump-autoload step. It passes inBrianHenryIE\Strauss\Composer\Composer, and that object fails the new type hint:So any fresh install that includes dev dependencies fails. In
build-zip.sh, that is the finalcomposer install. Versions 2.0.0–2.2.1 still type-hintComposer\Composer, which works with Strauss's instance. A plain~2.2.1pin is not enough: mnsami 2.1.0+ requires PHP >= 8.1, so it can't be installed on the PHP 7.4 legacy CI leg.^2.0 <2.3lets each PHP version pick a working release.The line
Class WPMedia\PluginFamily\PostInstall is not autoloadablefrom the issue is a separate, non-fatal warning. It appears in passing runs too, because Strauss has already prefixedwp-media/plugin-familyin place when the second install runs. This PR does not change it.New dependencies
None. This narrows an existing dev-dependency constraint from
^2.0to^2.0 <2.3.Risks
latest, so a future Strauss release could break the build in a different way. Pinning the Strauss version is a separate change.Mandatory Checklist
Code validation
Code style
Unticked items justification
There are no built-in tests because this changes only a Composer version constraint, with no PHP code. The check is the fresh-clone
bin/build-zip.shrun described above.Additional Checks
🤖 Generated with Claude Code