Commit 5fcf14d3b81 for woocommerce
commit 5fcf14d3b8112430100d0f3a44db23c92c31d61d
Author: Vlad Olaru <vlad.olaru@automattic.com>
Date: Mon Sep 7 17:54:09 2026 +0300
[tests] Prevent concurrent Composer installs in the backend-optimized monorepo setup (#68238)
* fix(ci): prevent concurrent WooCommerce installs
The optimized backend setup runs Composer and pnpm in parallel to keep
PHP and JavaScript dependency installation fast.
Filtered pnpm installation started running the WooCommerce postinstall,
which launched a second Composer writer while the first remained
unobserved in the background. This intermittently corrupted setup and
could also hide a failed background install.
Suppress lifecycle scripts only on this specialized path, wait for the
owned Composer process, and propagate either child status after both
settle.
Refs TESTOPS-234
* docs(ci): explain why lifecycle scripts are suppressed in the backend-optimized install
The --ignore-scripts flag reads as an optimization, but it is the fix:
the plugin's postinstall is a second composer install into the same
directory as the backgrounded one. Say so next to the flag so the
guarantee survives the next edit.
Refs TESTOPS-234
diff --git a/.github/actions/setup-woocommerce-monorepo/action.yml b/.github/actions/setup-woocommerce-monorepo/action.yml
index 2008b3f3524..e5db76144e6 100644
--- a/.github/actions/setup-woocommerce-monorepo/action.yml
+++ b/.github/actions/setup-woocommerce-monorepo/action.yml
@@ -96,9 +96,18 @@ runs:
run: |
if [[ '${{ inputs.install }}' == '@woocommerce/plugin-woocommerce...' && '${{ inputs.build-type }}' == 'backend' ]]; then
# PHPUnit/REST testing optimized installation of the deps: minimalistic and parallelized between PHP/JS.
- # JS deps installation is abit hard-core, but all we need actually is wp-env and playwright - we are good at that regard.
+ # JS deps installation is a bit hard-core, but all we need actually is wp-env and playwright - we are good at that regard.
composer install --working-dir=./plugins/woocommerce --quiet &
- pnpm install --filter='@woocommerce/plugin-woocommerce' --frozen-lockfile
+ composer_pid=$!
+ pnpm_status=0
+ # --ignore-scripts suppresses the plugin's postinstall, which would start a second composer install into the same directory; the background process above owns that install instead.
+ pnpm install --filter='@woocommerce/plugin-woocommerce' --frozen-lockfile --ignore-scripts || pnpm_status=$?
+ composer_status=0
+ wait "$composer_pid" || composer_status=$?
+ if [[ "$pnpm_status" -ne 0 ]]; then
+ exit "$pnpm_status"
+ fi
+ exit "$composer_status"
else
pnpm install ${{ steps.project-filters.outputs.install }} --frozen-lockfile
fi