Skip to content

Commit c14a911

Browse files
Merge pull request #179 from magento-commerce/develop
MCLOUD-13444: Release ece-tools 2002.2.2
2 parents 4c269c2 + b54f825 commit c14a911

File tree

200 files changed

+5503
-2528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+5503
-2528
lines changed
File renamed without changes.
File renamed without changes.

codeception.dist.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ settings:
99
extensions:
1010
enabled:
1111
- Codeception\Extension\RunFailed
12-
- Codeception\Extension\FailedInfo
1312
params:
1413
- vendor/magento/magento-cloud-docker/tests/functional/configuration.dist.yml
1514
- env

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/ece-tools",
33
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "2002.2.1",
5+
"version": "2002.2.2",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {
@@ -16,17 +16,17 @@
1616
"ext-json": "*",
1717
"ext-sockets": "*",
1818
"colinmollenhour/credis": "^1.6.0 || ^1.13",
19-
"composer/composer": "^1.9 || ^2.0 || !=2.2.16",
19+
"composer/composer": "^1.9 || ^2.8 || !=2.2.16",
2020
"composer/semver": "@stable",
2121
"graylog2/gelf-php": "^2.0.1",
2222
"guzzlehttp/guzzle": "^7.3 || ^7.5",
23-
"illuminate/config": "^5.5||^8.77",
23+
"illuminate/config": "^10.0 || ^11.0",
2424
"magento/magento-cloud-components": "^1.0.8",
25-
"magento/magento-cloud-docker": "^1.0.0",
25+
"magento/magento-cloud-docker": "^1.4.0",
2626
"magento/magento-cloud-patches": "^1.0.20",
2727
"magento/quality-patches": "^1.1.0",
2828
"monolog/monolog": "^2.3 || ^2.7 || ^3.6",
29-
"nesbot/carbon": "^1.0 || ^2.0",
29+
"nesbot/carbon": "^1.0 || ^2.0 || ^3.8",
3030
"psr/container": "^1.0",
3131
"psr/log": "^1.0 || ^2.0 || ^3.0",
3232
"symfony/config": "^4.4 || ^5.1 || ^5.4 || ^6.4",
@@ -45,9 +45,9 @@
4545
"consolidation/robo": "^3.0",
4646
"php-mock/php-mock-phpunit": "^2.0",
4747
"phpmd/phpmd": "@stable",
48-
"phpstan/phpstan": "~1.2.0",
49-
"phpunit/php-code-coverage": "^9.2",
50-
"phpunit/phpunit": "^9.5",
48+
"phpstan/phpstan": "1.2.0 || ^2.0",
49+
"phpunit/php-code-coverage": "^10.0",
50+
"phpunit/phpunit": "^10.0",
5151
"squizlabs/php_codesniffer": "^3.0",
5252
"funkjedi/composer-include-files": "^1.0"
5353
},

config/eol.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,6 @@ redis:
7878
eol: 2023-08-15
7979
- version: '7.2'
8080
eol: 2025-08-31
81+
valkey:
82+
- version: '8.0'
83+
eol: 2029-04-16

config/schema.error.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@
179179
step: 'pre-deploy: clean-redis-cache'
180180
stage: deploy
181181
type: critical
182+
!php/const Magento\MagentoCloud\App\Error::DEPLOY_VALKEY_CACHE_CLEAN_FAILED:
183+
title: 'Failed to clean the Valkey cache'
184+
suggestion: 'Failed to clean the Valkey cache. Check that the Valkey cache configuration is correct and that the Valkey service is available. See [Setup Valkey service](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/service/valkey.html).'
185+
step: 'pre-deploy: clean-valkey-cache'
186+
stage: deploy
187+
type: critical
182188
!php/const Magento\MagentoCloud\App\Error::DEPLOY_MAINTENANCE_MODE_ENABLING_FAILED:
183189
step: 'pre-deploy: set-production-mode'
184190
title: 'Command `/bin/magento maintenance:enable` failed'
@@ -491,6 +497,11 @@
491497
stage: deploy
492498
step: 'pre-deploy:cache'
493499
type: warning
500+
!php/const Magento\MagentoCloud\App\Error::WARN_VALKEY_SERVICE_NOT_AVAILABLE:
501+
title: 'Cache is configured for a Valkey service that is not available. Configuration will be ignored.'
502+
stage: deploy
503+
step: 'pre-deploy:cache'
504+
type: warning
494505
!php/const Magento\MagentoCloud\App\Error::WARN_WRONG_SPLIT_DB_CONFIG:
495506
title: 'The configured state is not ideal'
496507
stage: deploy

config/schema.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,20 @@ variables:
270270
- stage:
271271
deploy:
272272
REDIS_USE_SLAVE_CONNECTION: true
273+
VALKEY_USE_SLAVE_CONNECTION:
274+
description: Set to true to automatically use a read-only connection to a Valkey instance to receive read-only
275+
traffic on a non-master node. This improves performance through load balancing because only one node needs to
276+
handle read-write traffic.
277+
type: boolean
278+
stages:
279+
- global
280+
- deploy
281+
default:
282+
deploy: false
283+
examples:
284+
- stage:
285+
deploy:
286+
VALKEY_USE_SLAVE_CONNECTION: true
273287
MYSQL_USE_SLAVE_CONNECTION:
274288
description: Set to true to automatically use a read-only connection to the database to receive read-only traffic on
275289
a non-master node. This improves performance through load balancing, because only one node needs to
@@ -446,6 +460,21 @@ variables:
446460
- stage:
447461
deploy:
448462
REDIS_BACKEND: '\Magento\Framework\Cache\Backend\Redis'
463+
VALKEY_BACKEND:
464+
description: "Configuration the backend model for valkey cache."
465+
type: string
466+
allowed:
467+
- 'Cm_Cache_Backend_Redis'
468+
- '\Magento\Framework\Cache\Backend\Valkey'
469+
- '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache'
470+
stages:
471+
- deploy
472+
default:
473+
deploy: 'Cm_Cache_Backend_Redis'
474+
examples:
475+
- stage:
476+
deploy:
477+
VALKEY_BACKEND: '\Magento\Framework\Cache\Backend\Valkey'
449478
CACHE_CONFIGURATION:
450479
description: "Replace or modify the Magento cache configuration generated during the deployment process.
451480
To replace the existing configuration, specify values for each configuration option required for your environment.

scenario/deploy.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<item name="clean-file-cache" xsi:type="object" priority="500">Magento\MagentoCloud\Step\Deploy\PreDeploy\CleanFileCache</item>
1616
<item name="restore-writable-dirs" xsi:type="object" priority="600">Magento\MagentoCloud\Step\Deploy\PreDeploy\RestoreWritableDirectories</item>
1717
<item name="set-production-mode" xsi:type="object" priority="700">Magento\MagentoCloud\Step\SetProductionMode</item>
18+
<item name="clean-valkey-cache" xsi:type="object" priority="800">Magento\MagentoCloud\Step\Deploy\PreDeploy\CleanValkeyCache</item>
1819
</argument>
1920
</arguments>
2021
</step>

src/App/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @inheritdoc
2323
* @codeCoverageIgnore
24-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2525
*/
2626
class Container implements ContainerInterface
2727
{

src/App/Error.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class Error
7979
public const DEPLOY_OS_CANNOT_CONNECT = 137;
8080
public const DEPLOY_OS_SERVICE_NOT_INSTALLED = 138;
8181
public const DEPLOY_MAGENTO_VERSION_DOES_NOT_SUPPORT_OS = 139;
82+
public const DEPLOY_VALKEY_CACHE_CLEAN_FAILED = 140;
8283

8384
public const PD_DEPLOY_IS_FAILED = 201;
8485
public const PD_ENV_PHP_IS_NOT_WRITABLE = 202;
@@ -145,6 +146,7 @@ class Error
145146
public const WARN_DEPRECATED_SPLIT_DB = 2029;
146147
public const WARN_OS_ES_SERVICES_BOTH_INSTALLED = 2030;
147148
public const WARN_REMOTE_STORAGE_CANNOT_BE_DISABLED = 2031;
149+
public const WARN_VALKEY_SERVICE_NOT_AVAILABLE = 2032;
148150

149151
/**
150152
* Post-deploy

src/App/ErrorHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ErrorHandler
3131
E_USER_ERROR => 'User Error',
3232
E_USER_WARNING => 'User Warning',
3333
E_USER_NOTICE => 'User Notice',
34-
E_STRICT => 'Strict Notice',
3534
E_RECOVERABLE_ERROR => 'Recoverable Error',
3635
E_DEPRECATED => 'Deprecated Functionality',
3736
E_USER_DEPRECATED => 'User Deprecated Functionality',

src/App/GenericException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
/**
1313
* Base exception for general purposes.
1414
*
15-
* @SuppressWarnings(PHPMD.NumberOfChildren)
15+
* @SuppressWarnings("PHPMD.NumberOfChildren")
1616
*/
1717
class GenericException extends \Exception
1818
{
1919
/**
2020
* @inheritDoc
2121
*/
22-
public function __construct(string $message, int $code = 0, Throwable $previous = null)
22+
public function __construct(string $message, int $code = 0, Throwable | null $previous = null)
2323
{
2424
parent::__construct($message, $code, $previous);
2525
}

src/App/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* @inheritdoc
2121
*/
22-
class Logger extends \Monolog\Logger
22+
class Logger extends \Monolog\Logger // @phpstan-ignore-line
2323
{
2424
/**
2525
* @var File

src/App/Logger/Formatter/JsonErrorFormatter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function __construct(
5353
public function format(\Monolog\LogRecord|array $record): string
5454
{
5555
// Monolog version 3 or higher.
56+
/** @phpstan-ignore-next-line */
5657
if (\Monolog\Logger::API == 3) {
5758
try {
5859
/** @phpstan-ignore-next-line */
@@ -81,7 +82,7 @@ public function format(\Monolog\LogRecord|array $record): string
8182
if (isset($loggedErrors[$record['context']['errorCode']])) {
8283
return '';
8384
}
84-
85+
/** @phpstan-ignore-next-line */
8586
return parent::format($this->formatLog($record));
8687
} catch (\Exception $exception) {
8788
return '';

src/App/Logger/HandlerFactory.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* The handler factory.
2525
*
26-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
26+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2727
*/
2828
class HandlerFactory
2929
{
@@ -73,7 +73,7 @@ public function __construct(
7373
* @return AbstractProcessingHandler
7474
* @throws LoggerException
7575
*
76-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
76+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
7777
*/
7878
public function create(string $handler): AbstractProcessingHandler
7979
{
@@ -104,12 +104,9 @@ public function create(string $handler): AbstractProcessingHandler
104104
);
105105
break;
106106
case static::HANDLER_STREAM:
107-
$defaultLevelStream = !empty($levelOverride) ?
108-
$this->normalizeLevel($levelOverride)
109-
: Logger::INFO;
110107
$handlerInstance = new StreamHandler(
111108
$configuration->get('stream'),
112-
$minLevel ?: $defaultLevelStream
109+
$minLevel ?: Logger::INFO
113110
);
114111
break;
115112
case static::HANDLER_EMAIL:
@@ -172,6 +169,7 @@ private function normalizeLevel(string $level): int
172169
/** @phpstan-ignore-next-line */
173170
$normalizedLevel = Logger::toMonologLevel($level);
174171

172+
/** @phpstan-ignore-next-line */
175173
if (\Monolog\Logger::API == 3) {
176174
/** @phpstan-ignore-next-line */
177175
$normalizedLevel = $normalizedLevel->value;

src/App/Logger/Processor/SanitizeProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(Sanitizer $sanitizer)
3333
public function __invoke(\Monolog\LogRecord|array $record)
3434
{
3535
// Monolog version 3 or higher.
36-
if (\Monolog\Logger::API == 3) {
36+
if (\Monolog\Logger::API == 3) { // @phpstan-ignore-line
3737
$message = $this->sanitizer->sanitize($record->message); // @phpstan-ignore-line
3838
// Create new LogRecord from existing and update the message,
3939
// since message is read only

src/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* @inheritdoc
1717
*
18-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
1919
*/
2020
class Application extends \Symfony\Component\Console\Application
2121
{

src/Command/ConfigCreate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function configure(): void
5858
$this->setName(static::NAME)
5959
->setDescription(
6060
'Creates a `.magento.env.yaml` file with the specified build, deploy, and post-deploy variable ' .
61-
'configuration. Overwrites any existing `.magento,.env.yaml` file.'
61+
'configuration. Overwrites any existing `.magento.env.yaml` file.'
6262
)
6363
->addArgument(
6464
self::ARG_CONFIGURATION,

src/Command/ConfigShow/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function renderTable(OutputInterface $output, string $title, array $he
114114
$table = new Table($output);
115115
$table->setHeaders($header)
116116
->setRows($rows);
117-
if (method_exists($table, 'setColumnWidth')) {
117+
if (method_exists($table, 'setColumnWidth')) { // @phpstan-ignore-line
118118
$table->setColumnWidth(0, 40);
119119
$table->setColumnWidth(1, 60);
120120
}

src/Command/ConfigValidate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure(): void
5353
* @param OutputInterface $output
5454
* @return int
5555
*
56-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
56+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
5757
*/
5858
public function execute(InputInterface $input, OutputInterface $output)
5959
{

src/Command/Dev/GenerateSchemaError.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
/**
1919
* @codeCoverageIgnore
20-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2121
*/
2222
class GenerateSchemaError extends Command
2323
{
@@ -60,7 +60,7 @@ protected function configure(): void
6060
/**
6161
* @inheritdoc
6262
*
63-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
63+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
6464
*/
6565
protected function execute(InputInterface $input, OutputInterface $output): int
6666
{

src/Command/Dev/UpdateComposer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function configure(): void
102102
* @throws ConfigException
103103
* @throws FileSystemException
104104
*
105-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
105+
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
106106
*/
107107
protected function execute(InputInterface $input, OutputInterface $output): int
108108
{

src/Command/Wizard/MasterSlave.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public function execute(InputInterface $input, OutputInterface $output): int
6969
$errors[] = 'Redis slave connection is not configured';
7070
}
7171

72+
if (!$this->deployConfig->get(DeployInterface::VAR_VALKEY_USE_SLAVE_CONNECTION)) {
73+
$errors[] = 'Valkey slave connection is not configured';
74+
}
7275
foreach ($errors as $error) {
7376
$this->outputFormatter->writeItem($output, $error);
7477
}

0 commit comments

Comments
 (0)