Commit e1e727d595c for woocommerce

commit e1e727d595c80a59e06fb91a3272c6bc7e7de98b
Author: Vladimir Reznichenko <kalessil@gmail.com>
Date:   Sat Apr 18 21:56:42 2026 +0200

    [dev] CI: patchup wp-env start failures. (#64223)

diff --git a/bin/patches/@wordpress__env@10.17.0.patch b/bin/patches/@wordpress__env@10.17.0.patch
deleted file mode 100644
index aad30fa5a19..00000000000
--- a/bin/patches/@wordpress__env@10.17.0.patch
+++ /dev/null
@@ -1,187 +0,0 @@
-diff --git a/lib/build-docker-compose-config.js b/lib/build-docker-compose-config.js
-index a1a4f68256b688efecd0da79282bc7e9f1ed1f1c..b2cc74e4ae897303246226a26de4b1f663035bf4 100644
---- a/lib/build-docker-compose-config.js
-+++ b/lib/build-docker-compose-config.js
-@@ -181,7 +181,7 @@ module.exports = function buildDockerComposeConfig( config ) {
- 		config.env.tests.phpmyadminPort ?? ''
- 	}}:80`;
-
--	return {
-+	const generatedConfiguration = {
- 		services: {
- 			mysql: {
- 				image: 'mariadb:lts',
-@@ -303,4 +303,16 @@ module.exports = function buildDockerComposeConfig( config ) {
- 			'tests-user-home': {},
- 		},
- 	};
-+
-+	if ( process.env.CI || false ) {
-+		delete generatedConfiguration.services['mysql'];
-+		delete generatedConfiguration.services['wordpress'];
-+		delete generatedConfiguration.services['cli'];
-+		delete generatedConfiguration.services['phpmyadmin'];
-+		delete generatedConfiguration.services['tests-phpmyadmin'];
-+		delete generatedConfiguration.volumes['mysql'];
-+		delete generatedConfiguration.volumes['wordpress'];
-+	}
-+
-+	return generatedConfiguration;
- };
-diff --git a/lib/commands/start.js b/lib/commands/start.js
-index db05b82060d2c51381d07463b620c2fb549df027..4405537adc3bf9694bd43c30646d86062f3bf4ba 100644
---- a/lib/commands/start.js
-+++ b/lib/commands/start.js
-@@ -136,8 +136,13 @@ module.exports = async function start( {
- 		spinner.text = 'Downloading sources.';
- 	}
-
-+	const isCI               = process.env.CI || false;
-+	const targetContainers   = isCI ? [ 'tests-wordpress', 'tests-cli' ] : [ 'wordpress', 'tests-wordpress', 'cli', 'tests-cli' ];
-+	const targetDbContainer  = isCI ? 'tests-mysql' : 'mysql';
-+	const targetCliContainer = isCI ? 'tests-cli' : 'cli';
-+
- 	await Promise.all( [
--		dockerCompose.upOne( 'mysql', {
-+		dockerCompose.upOne( targetDbContainer, {
- 			...dockerComposeConfig,
- 			commandOptions: shouldConfigureWp
- 				? [ '--build', '--force-recreate' ]
-@@ -171,7 +176,7 @@ module.exports = async function start( {
- 	spinner.text = 'Starting WordPress.';
-
- 	await dockerCompose.upMany(
--		[ 'wordpress', 'tests-wordpress', 'cli', 'tests-cli' ],
-+		targetContainers,
- 		{
- 			...dockerComposeConfig,
- 			commandOptions: shouldConfigureWp
-@@ -180,7 +185,7 @@ module.exports = async function start( {
- 		}
- 	);
-
--	if ( config.env.development.phpmyadminPort ) {
-+	if ( ! isCI && config.env.development.phpmyadminPort ) {
- 		await dockerCompose.upOne( 'phpmyadmin', {
- 			...dockerComposeConfig,
- 			commandOptions: shouldConfigureWp
-@@ -189,7 +194,7 @@ module.exports = async function start( {
- 		} );
- 	}
-
--	if ( config.env.tests.phpmyadminPort ) {
-+	if ( ! isCI && config.env.tests.phpmyadminPort ) {
- 		await dockerCompose.upOne( 'tests-phpmyadmin', {
- 			...dockerComposeConfig,
- 			commandOptions: shouldConfigureWp
-@@ -200,36 +205,42 @@ module.exports = async function start( {
-
- 	// Make sure we've consumed the custom CLI dockerfile.
- 	if ( shouldConfigureWp ) {
--		await dockerCompose.buildOne( [ 'cli' ], { ...dockerComposeConfig } );
-+		await dockerCompose.buildOne( [ targetCliContainer ], { ...dockerComposeConfig } );
- 	}
-
- 	// Only run WordPress install/configuration when config has changed.
- 	if ( shouldConfigureWp ) {
- 		spinner.text = 'Configuring WordPress.';
-
--		try {
--			await checkDatabaseConnection( config );
--		} catch ( error ) {
--			// Wait 30 seconds for MySQL to accept connections.
--			await retry( () => checkDatabaseConnection( config ), {
--				times: 30,
--				delay: 1000,
--			} );
--
--			// It takes 3-4 seconds for MySQL to be ready after it starts accepting connections.
--			await sleep( 4000 );
-+		const targetEnvironments = {
-+			development: 'cli',
-+			tests: 'tests-cli',
-+		};
-+		for ( const environment in targetEnvironments ) {
-+			const cliContainer = targetEnvironments[environment];
-+			if ( targetContainers.includes( cliContainer ) ) {
-+				try {
-+					await checkDatabaseConnection( cliContainer, config );
-+				} catch ( error ) {
-+					// Wait 30 seconds for MySQL to accept connections.
-+					await retry( () => checkDatabaseConnection( cliContainer, config ), {
-+						times: 30,
-+						delay: 1000,
-+					} );
-+
-+					// It takes 3-4 seconds for MySQL to be ready after it starts accepting connections.
-+					await sleep( 4000 );
-+				}
-+
-+				// Retry WordPress installation in case MySQL *still* wasn't ready.
-+				await Promise.all( [
-+					retry( () => configureWordPress( environment, config, spinner ), {
-+						times: 2,
-+					} ),
-+				] );
-+			}
- 		}
-
--		// Retry WordPress installation in case MySQL *still* wasn't ready.
--		await Promise.all( [
--			retry( () => configureWordPress( 'development', config, spinner ), {
--				times: 2,
--			} ),
--			retry( () => configureWordPress( 'tests', config, spinner ), {
--				times: 2,
--			} ),
--		] );
--
- 		// Set the cache key once everything has been configured.
- 		await setCache( CONFIG_CACHE_KEY, configHash, {
- 			workDirectoryPath,
-@@ -243,7 +254,7 @@ module.exports = async function start( {
- 	const siteUrl = config.env.development.config.WP_SITEURL;
- 	const testsSiteUrl = config.env.tests.config.WP_SITEURL;
-
--	const mySQLPort = await getPublicDockerPort(
-+	const mySQLPort = ! isCI && await getPublicDockerPort(
- 		'mysql',
- 		3306,
- 		dockerComposeConfig
-@@ -268,16 +279,12 @@ module.exports = async function start( {
- 		: null;
-
- 	spinner.prefixText = [
--		'WordPress development site started' +
--			( siteUrl ? ` at ${ siteUrl }` : '.' ),
--		'WordPress test site started' +
--			( testsSiteUrl ? ` at ${ testsSiteUrl }` : '.' ),
--		`MySQL is listening on port ${ mySQLPort }`,
-+		! isCI && 'WordPress development site started' + ( siteUrl ? ` at ${ siteUrl }` : '.' ),
-+		'WordPress test site started' + ( testsSiteUrl ? ` at ${ testsSiteUrl }` : '.' ),
-+		! isCI && `MySQL is listening on port ${ mySQLPort }`,
- 		`MySQL for automated testing is listening on port ${ testsMySQLPort }`,
--		phpmyadminPort &&
--			`phpMyAdmin started at http://localhost:${ phpmyadminPort }`,
--		testsPhpmyadminPort &&
--			`phpMyAdmin for automated testing started at http://localhost:${ testsPhpmyadminPort }`,
-+		! isCI && phpmyadminPort && `phpMyAdmin started at http://localhost:${ phpmyadminPort }`,
-+		! isCI && testsPhpmyadminPort && `phpMyAdmin for automated testing started at http://localhost:${ testsPhpmyadminPort }`,
- 	]
- 		.filter( Boolean )
- 		.join( '\n' );
-diff --git a/lib/wordpress.js b/lib/wordpress.js
-index 8c08fb1f20ec782049aa831d55d911faa2792fb6..55de6e885890477b58314d1a7323a80d31b6a9a6 100644
---- a/lib/wordpress.js
-+++ b/lib/wordpress.js
-@@ -57,8 +57,8 @@ function isWPMajorMinorVersionLower( version, compareVersion ) {
-  *
-  * @param {WPConfig} config The wp-env config object.
-  */
--async function checkDatabaseConnection( { dockerComposeConfigPath, debug } ) {
--	await dockerCompose.run( 'cli', 'wp db check', {
-+async function checkDatabaseConnection( cliContainer, { dockerComposeConfigPath, debug } ) {
-+	await dockerCompose.run( cliContainer, 'wp db check', {
- 		config: dockerComposeConfigPath,
- 		commandOptions: [ '--rm' ],
- 		log: debug,
diff --git a/bin/patches/@wordpress__env@11.0.1-next.v.20260206T143.0.patch b/bin/patches/@wordpress__env@11.0.1-next.v.20260206T143.0.patch
new file mode 100644
index 00000000000..c4d53f9bcd3
--- /dev/null
+++ b/bin/patches/@wordpress__env@11.0.1-next.v.20260206T143.0.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/runtime/docker/init-config.js b/lib/runtime/docker/init-config.js
+index 8b6a1cfd8ce0c467d9bcb016c1a6494b6f0718bf..b817d61fe3d223b289fc0e4cd32949291553952c 100644
+--- a/lib/runtime/docker/init-config.js
++++ b/lib/runtime/docker/init-config.js
+@@ -260,7 +260,7 @@ RUN echo 'post_max_size = 1G' >> /usr/local/etc/php/php.ini`;
+ 	dockerFileContent += `
+ RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
+ RUN export COMPOSER_HASH=\`curl -sS https://composer.github.io/installer.sig\` && php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$COMPOSER_HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('/tmp/composer-setup.php'); } echo PHP_EOL;"
+-RUN php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
++RUN php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.8.12
+ RUN rm /tmp/composer-setup.php`;
+
+ 	// Install any Composer packages we might need globally.
diff --git a/package.json b/package.json
index a484b19a623..23a83f82150 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,8 @@
 			"sass": "1.69.5"
 		},
 		"patchedDependencies": {
-			"@wordpress/edit-site@5.15.0": "bin/patches/@wordpress__edit-site@5.15.0.patch"
+			"@wordpress/edit-site@5.15.0": "bin/patches/@wordpress__edit-site@5.15.0.patch",
+			"@wordpress/env@11.0.1-next.v.20260206T143.0": "bin/patches/@wordpress__env@11.0.1-next.v.20260206T143.0.patch"
 		}
 	}
 }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 21ccab3c585..ee15ed16728 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -170,6 +170,9 @@ patchedDependencies:
   '@wordpress/edit-site@5.15.0':
     hash: 63381743e38412fb89154386a5d169639ca10f8315407527829db669201fce9b
     path: bin/patches/@wordpress__edit-site@5.15.0.patch
+  '@wordpress/env@11.0.1-next.v.20260206T143.0':
+    hash: 3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81
+    path: bin/patches/@wordpress__env@11.0.1-next.v.20260206T143.0.patch

 importers:

@@ -3082,13 +3085,13 @@ importers:
     devDependencies:
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)

   packages/php/email-editor:
     devDependencies:
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)
       rimraf:
         specifier: 5.0.5
         version: 5.0.5
@@ -3201,7 +3204,7 @@ importers:
         version: 1.19.1(@playwright/test@1.59.1)
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)
       '@wordpress/scripts':
         specifier: 30.6.0
         version: 30.6.0(@playwright/test@1.59.1)(@swc/core@1.15.24)(@types/node@24.12.2)(@types/webpack@4.41.40)(file-loader@6.2.0(webpack@5.97.1))(node-notifier@8.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(ts-node@10.9.2(@swc/core@1.15.24)(@types/node@24.12.2)(typescript@5.7.3))(type-fest@4.41.0)(typescript@5.7.3)(webpack-hot-middleware@2.26.1)
@@ -3358,7 +3361,7 @@ importers:
         version: link:../../packages/js/eslint-plugin
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)
       '@wordpress/prettier-config':
         specifier: 2.17.0
         version: 2.17.0(wp-prettier@2.8.5)
@@ -4260,7 +4263,7 @@ importers:
         version: 6.19.1
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)
       '@wordpress/format-library':
         specifier: catalog:wp-min
         version: 5.19.6(@babel/core@7.25.7)(@emotion/is-prop-valid@1.4.0)(@types/react-dom@18.3.7(@types/react@18.3.28))(@types/react@18.3.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(webpack-virtual-modules@0.6.2)(webpack@5.97.1)
@@ -4659,7 +4662,7 @@ importers:
         version: 24.12.2
       '@wordpress/env':
         specifier: 11.0.1-next.v.20260206T143.0
-        version: 11.0.1-next.v.20260206T143.0(@types/node@24.12.2)
+        version: 11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)
       chalk:
         specifier: ^4.1.2
         version: 4.1.2
@@ -35239,7 +35242,7 @@ snapshots:
       react: 18.3.1
       react-dom: 18.3.1(react@18.3.1)

-  '@wordpress/env@11.0.1-next.v.20260206T143.0(@types/node@24.12.2)':
+  '@wordpress/env@11.0.1-next.v.20260206T143.0(patch_hash=3bb8d6aefc8089fb3df03be69d5960ed2f187697de2c01d4849c820dcced8a81)(@types/node@24.12.2)':
     dependencies:
       '@inquirer/prompts': 7.10.1(@types/node@24.12.2)
       '@wp-playground/cli': 3.1.19