From c603d7ca3f1ae87444a534878bda98e1cc072153 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 22 Apr 2024 11:00:08 -0500 Subject: [PATCH 1/7] Add lua deploy variables --- config/schema.yaml | 23 ++++++++++++++++++- src/Config/Stage/DeployInterface.php | 10 ++++++++ .../Validator/Deploy/AppropriateVersion.php | 18 +++++++++++++++ .../Deploy/PreDeploy/ConfigUpdate/Cache.php | 15 +++++++++++- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/config/schema.yaml b/config/schema.yaml index c9ac513cd1..e8772bb395 100644 --- a/config/schema.yaml +++ b/config/schema.yaml @@ -466,7 +466,28 @@ variables: backend: file page_cache: backend: file - + USE_LUA: + description: "Enable/Disable LUA in environments starting from Magento 2.4.7" + type: boolean + stages: + - deploy + default: + deploy: false + examples: + - stage: + deploy: + USE_LUA: true + LUA_KEY: + description: "LUA KEY for environments starting from Magento 2.4.7" + type: boolean + stages: + - deploy + default: + deploy: true + examples: + - stage: + deploy: + LUA_KEY: false SESSION_CONFIGURATION: description: "Replace or modify the Magento session configuration generated during the deployment process. By default, ece-tools configures Magento to store Redis session data. To replace the existing configuration, diff --git a/src/Config/Stage/DeployInterface.php b/src/Config/Stage/DeployInterface.php index 0653adf1c4..15688474ab 100644 --- a/src/Config/Stage/DeployInterface.php +++ b/src/Config/Stage/DeployInterface.php @@ -86,4 +86,14 @@ interface DeployInterface extends StageConfigInterface * The variable responsible for enabling google analytics in environments other than prod. */ public const VAR_ENABLE_GOOGLE_ANALYTICS = 'ENABLE_GOOGLE_ANALYTICS'; + + /** + * The variable responsible for enabling LUA cache in environments starting from Magento 2.4.7. + */ + public const VAR_USE_LUA = 'USE_LUA'; + + /** + * The variable responsible for LUA KEY in environments starting from Magento 2.4.7. + */ + public const VAR_LUA_KEY = 'LUA_KEY'; } diff --git a/src/Config/Validator/Deploy/AppropriateVersion.php b/src/Config/Validator/Deploy/AppropriateVersion.php index 236e22146e..f47d64076f 100644 --- a/src/Config/Validator/Deploy/AppropriateVersion.php +++ b/src/Config/Validator/Deploy/AppropriateVersion.php @@ -81,6 +81,24 @@ public function validate(): Validator\ResultInterface ); } + if (!$this->magentoVersion->satisfies('>= 2.4.7') + && $this->configurationChecker->isConfigured(DeployInterface::VAR_USE_LUA, true) + ) { + $errors[] = sprintf( + '%s is available for Magento 2.4.7 and above', + DeployInterface::VAR_USE_LUA + ); + } + + if (!$this->magentoVersion->satisfies('>= 2.4.7') + && $this->configurationChecker->isConfigured(DeployInterface::VAR_LUA_KEY, true) + ) { + $errors[] = sprintf( + '%s is available for Magento 2.4.7 and above', + DeployInterface::VAR_LUA_KEY + ); + } + if ($errors) { return $this->resultFactory->error( 'The current configuration is not compatible with this version of Magento', diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php index 8055fbc141..a3ad7236ee 100644 --- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php +++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php @@ -16,6 +16,7 @@ use Magento\MagentoCloud\Step\StepInterface; use Psr\Log\LoggerInterface; use Magento\MagentoCloud\Package\MagentoVersion; +use Magento\MagentoCloud\Config\Stage\DeployInterface; /** * Processes cache configuration. @@ -49,25 +50,33 @@ class Cache implements StepInterface */ private $magentoVersion; + /** + * @var DeployInterface + */ + private $stageConfig; + /** * @param ConfigReader $configReader * @param ConfigWriter $configWriter * @param LoggerInterface $logger * @param CacheFactory $cacheConfig * @param MagentoVersion $magentoVersion + * @param DeployInterface $stageConfig */ public function __construct( ConfigReader $configReader, ConfigWriter $configWriter, LoggerInterface $logger, CacheFactory $cacheConfig, - MagentoVersion $magentoVersion + MagentoVersion $magentoVersion, + DeployInterface $stageConfig ) { $this->configReader = $configReader; $this->configWriter = $configWriter; $this->logger = $logger; $this->cacheConfig = $cacheConfig; $this->magentoVersion = $magentoVersion; + $this->stageConfig = $stageConfig; } /** @@ -79,6 +88,8 @@ public function execute() $config = $this->configReader->read(); $cacheConfig = $this->cacheConfig->get(); $graphqlConfig = $config['cache']['graphql'] ?? []; + $luaConfig = (boolean)$this->stageConfig->get(DeployInterface::VAR_USE_LUA); + $luaConfigKey = (boolean)$this->stageConfig->get(DeployInterface::VAR_LUA_KEY); if (isset($cacheConfig['frontend'])) { $cacheConfig['frontend'] = array_filter($cacheConfig['frontend'], function ($cacheFrontend) { @@ -120,6 +131,8 @@ public function execute() $config['cache']['graphql'] = $graphqlConfig; } + $config['cache']['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; + $config['cache']['frontend']['default']['backend_options']['use_lua'] = $luaConfig; $this->configWriter->create($config); } catch (FileSystemException $e) { throw new StepException($e->getMessage(), Error::DEPLOY_ENV_PHP_IS_NOT_WRITABLE); From a199d7982ba9c0dd9e271f2b68be1337639c2612 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 22 Apr 2024 15:51:49 -0500 Subject: [PATCH 2/7] Update defaults and version validation test --- .../Validator/Deploy/AppropriateVersion.php | 28 +++++++++---------- src/Test/Unit/Config/SchemaTest.php | 2 ++ .../PreDeploy/ConfigUpdate/CacheTest.php | 10 ++++++- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/Config/Validator/Deploy/AppropriateVersion.php b/src/Config/Validator/Deploy/AppropriateVersion.php index f47d64076f..e6bbcf7605 100644 --- a/src/Config/Validator/Deploy/AppropriateVersion.php +++ b/src/Config/Validator/Deploy/AppropriateVersion.php @@ -81,22 +81,20 @@ public function validate(): Validator\ResultInterface ); } - if (!$this->magentoVersion->satisfies('>= 2.4.7') - && $this->configurationChecker->isConfigured(DeployInterface::VAR_USE_LUA, true) - ) { - $errors[] = sprintf( - '%s is available for Magento 2.4.7 and above', - DeployInterface::VAR_USE_LUA - ); - } + if (!$this->magentoVersion->satisfies('>= 2.4.7')) { + $variables = [ + DeployInterface::VAR_USE_LUA, + DeployInterface::VAR_LUA_KEY, + ]; - if (!$this->magentoVersion->satisfies('>= 2.4.7') - && $this->configurationChecker->isConfigured(DeployInterface::VAR_LUA_KEY, true) - ) { - $errors[] = sprintf( - '%s is available for Magento 2.4.7 and above', - DeployInterface::VAR_LUA_KEY - ); + foreach ($variables as $variableName) { + if ($this->configurationChecker->isConfigured($variableName, true)) { + $errors[] = sprintf( + '%s is available for Magento 2.4.7 and later.', + $variableName + ); + } + } } if ($errors) { diff --git a/src/Test/Unit/Config/SchemaTest.php b/src/Test/Unit/Config/SchemaTest.php index 90e0643c25..0a23070327 100644 --- a/src/Test/Unit/Config/SchemaTest.php +++ b/src/Test/Unit/Config/SchemaTest.php @@ -118,6 +118,8 @@ public function testGetDefaultsForDeploy(): void DeployInterface::VAR_CACHE_REDIS_BACKEND => 'Cm_Cache_Backend_Redis', DeployInterface::VAR_REMOTE_STORAGE => [], DeployInterface::VAR_SCD_NO_PARENT => false, + DeployInterface::VAR_USE_LUA => false, + DeployInterface::VAR_LUA_KEY => true, ], $this->schema->getDefaults(StageConfigInterface::STAGE_DEPLOY) ); diff --git a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php index baeefb2c9d..264aaf9c6a 100644 --- a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php +++ b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php @@ -19,6 +19,7 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Magento\MagentoCloud\Package\MagentoVersion; +use Magento\MagentoCloud\Config\Stage\DeployInterface; /** * @inheritdoc @@ -72,6 +73,11 @@ class CacheTest extends TestCase */ private $magentoVersion; + /** + * @var DeployInterface + */ + private $stageConfig; + /** * @inheritdoc */ @@ -82,13 +88,15 @@ protected function setUp(): void $this->configReaderMock = $this->createMock(ConfigReader::class); $this->cacheConfigMock = $this->createMock(CacheFactory::class); $this->magentoVersion = $this->createMock(MagentoVersion::class); + $this->stageConfig = $this->createMock(DeployInterface::class); $this->step = new Cache( $this->configReaderMock, $this->configWriterMock, $this->loggerMock, $this->cacheConfigMock, - $this->magentoVersion + $this->magentoVersion, + $this->stageConfig ); $this->socketCreateMock = $this->getFunctionMock( From 0ee0ff83f3433ae1c9d4100299f2057a95fdb9d7 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Mon, 22 Apr 2024 16:48:39 -0500 Subject: [PATCH 3/7] Appropriate version unit test fix --- src/Config/Validator/Deploy/AppropriateVersion.php | 2 +- src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php | 9 +++++++-- .../Validator/Deploy/AppropriateVersionTest.php | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Config/Validator/Deploy/AppropriateVersion.php b/src/Config/Validator/Deploy/AppropriateVersion.php index e6bbcf7605..a11698f825 100644 --- a/src/Config/Validator/Deploy/AppropriateVersion.php +++ b/src/Config/Validator/Deploy/AppropriateVersion.php @@ -81,7 +81,7 @@ public function validate(): Validator\ResultInterface ); } - if (!$this->magentoVersion->satisfies('>= 2.4.7')) { + if (!$this->magentoVersion->isGreaterOrEqual('2.4.7')) { $variables = [ DeployInterface::VAR_USE_LUA, DeployInterface::VAR_LUA_KEY, diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php index a3ad7236ee..fe435f2c58 100644 --- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php +++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php @@ -131,8 +131,13 @@ public function execute() $config['cache']['graphql'] = $graphqlConfig; } - $config['cache']['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; - $config['cache']['frontend']['default']['backend_options']['use_lua'] = $luaConfig; + if (!empty($luaConfigKey)) { + $config['cache']['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; + } + + if (!empty($luaConfig)) { + $config['cache']['frontend']['default']['backend_options']['use_lua'] = $luaConfig; + } $this->configWriter->create($config); } catch (FileSystemException $e) { throw new StepException($e->getMessage(), Error::DEPLOY_ENV_PHP_IS_NOT_WRITABLE); diff --git a/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php b/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php index 235977ebe9..0b2f55c108 100644 --- a/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php +++ b/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php @@ -66,6 +66,10 @@ public function testValidateVersionGreaterTwoDotTwo() ->method('isGreaterOrEqual') ->with('2.2') ->willReturn(true); + $this->magentoVersion->expects($this->once()) + ->method('isGreaterOrEqual') + ->with('2.4.7') + ->willReturn(true); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(true); @@ -81,6 +85,10 @@ public function testValidateVersionTwoDotOneAndVariablesNotConfigured() ->method('isGreaterOrEqual') ->with('2.2') ->willReturn(false); + $this->magentoVersion->expects($this->once()) + ->method('isGreaterOrEqual') + ->with('2.4.7') + ->willReturn(false); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(false); @@ -97,6 +105,10 @@ public function testValidateVersionTwoDotOneAndAllVariablesAreConfigured() ->method('isGreaterOrEqual') ->with('2.2') ->willReturn(false); + $this->magentoVersion->expects($this->once()) + ->method('isGreaterOrEqual') + ->with('2.4.7') + ->willReturn(false); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(false); From 9177024f77ff5a7ed6b11876ec09cd044310ee9f Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Wed, 24 Apr 2024 16:59:39 -0500 Subject: [PATCH 4/7] update unit tests --- .../Deploy/PreDeploy/ConfigUpdate/Cache.php | 11 ++--- .../Deploy/AppropriateVersionTest.php | 45 ++++++++----------- 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php index fe435f2c58..670e58fa97 100644 --- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php +++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php @@ -123,6 +123,10 @@ public function execute() ); unset($config['cache']); } else { + if(isset($cacheConfig['frontend']['default'])) { + $cacheConfig['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; + $cacheConfig['frontend']['default']['backend_options']['use_lua'] = $luaConfig; + } $this->logger->info('Updating cache configuration.'); $config['cache'] = $cacheConfig; } @@ -131,13 +135,6 @@ public function execute() $config['cache']['graphql'] = $graphqlConfig; } - if (!empty($luaConfigKey)) { - $config['cache']['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; - } - - if (!empty($luaConfig)) { - $config['cache']['frontend']['default']['backend_options']['use_lua'] = $luaConfig; - } $this->configWriter->create($config); } catch (FileSystemException $e) { throw new StepException($e->getMessage(), Error::DEPLOY_ENV_PHP_IS_NOT_WRITABLE); diff --git a/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php b/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php index 0b2f55c108..17268a6292 100644 --- a/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php +++ b/src/Test/Unit/Config/Validator/Deploy/AppropriateVersionTest.php @@ -15,6 +15,7 @@ use Magento\MagentoCloud\Package\MagentoVersion; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Magento\MagentoCloud\Config\Stage\DeployInterface; /** * @inheritdoc @@ -60,16 +61,12 @@ protected function setUp(): void ); } - public function testValidateVersionGreaterTwoDotTwo() + public function testValidateVersion() { - $this->magentoVersion->expects($this->once()) - ->method('isGreaterOrEqual') - ->with('2.2') - ->willReturn(true); - $this->magentoVersion->expects($this->once()) + $this->magentoVersion->expects($this->exactly(2)) ->method('isGreaterOrEqual') - ->with('2.4.7') - ->willReturn(true); + ->withConsecutive(['2.2'], ['2.4.7']) + ->willReturnOnConsecutiveCalls(true, true); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(true); @@ -79,40 +76,32 @@ public function testValidateVersionGreaterTwoDotTwo() $this->assertInstanceOf(Success::class, $this->validator->validate()); } - public function testValidateVersionTwoDotOneAndVariablesNotConfigured() + public function testValidateVersionAndVariablesNotConfigured() { - $this->magentoVersion->expects($this->once()) + $this->magentoVersion->expects($this->exactly(2)) ->method('isGreaterOrEqual') - ->with('2.2') - ->willReturn(false); - $this->magentoVersion->expects($this->once()) - ->method('isGreaterOrEqual') - ->with('2.4.7') - ->willReturn(false); + ->withConsecutive(['2.2'], ['2.4.7']) + ->willReturnOnConsecutiveCalls(false, false); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(false); - $this->configurationCheckerMock->expects($this->exactly(4)) + $this->configurationCheckerMock->expects($this->exactly(6)) ->method('isConfigured') ->willReturn(false); $this->assertInstanceOf(Success::class, $this->validator->validate()); } - public function testValidateVersionTwoDotOneAndAllVariablesAreConfigured() + public function testValidateVersionAndAllVariablesAreConfigured() { - $this->magentoVersion->expects($this->once()) + $this->magentoVersion->expects($this->exactly(2)) ->method('isGreaterOrEqual') - ->with('2.2') - ->willReturn(false); - $this->magentoVersion->expects($this->once()) - ->method('isGreaterOrEqual') - ->with('2.4.7') - ->willReturn(false); + ->withConsecutive(['2.2'], ['2.4.7']) + ->willReturnOnConsecutiveCalls(false, false); $this->magentoVersion->expects($this->once()) ->method('satisfies') ->willReturn(false); - $this->configurationCheckerMock->expects($this->exactly(4)) + $this->configurationCheckerMock->expects($this->exactly(6)) ->method('isConfigured') ->willReturn(true); $this->resultFactoryMock->expects($this->once()) @@ -123,7 +112,9 @@ public function testValidateVersionTwoDotOneAndAllVariablesAreConfigured() 'CRON_CONSUMERS_RUNNER is available for Magento 2.2.0 and later.', 'SCD_STRATEGY is available for Magento 2.2.0 and later.', 'SCD_MAX_EXECUTION_TIME is available for Magento 2.2.0 and later.', - 'GENERATED_CODE_SYMLINK is available for Magento 2.1.x.' + 'GENERATED_CODE_SYMLINK is available for Magento 2.1.x.', + 'USE_LUA is available for Magento 2.4.7 and later.', + 'LUA_KEY is available for Magento 2.4.7 and later.' ]) ); From 9348b1d917a753f8c2335ff938571317950eb3b2 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Wed, 24 Apr 2024 17:02:08 -0500 Subject: [PATCH 5/7] update cacheTest --- .../Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php index 264aaf9c6a..baeefb2c9d 100644 --- a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php +++ b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php @@ -19,7 +19,6 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Magento\MagentoCloud\Package\MagentoVersion; -use Magento\MagentoCloud\Config\Stage\DeployInterface; /** * @inheritdoc @@ -73,11 +72,6 @@ class CacheTest extends TestCase */ private $magentoVersion; - /** - * @var DeployInterface - */ - private $stageConfig; - /** * @inheritdoc */ @@ -88,15 +82,13 @@ protected function setUp(): void $this->configReaderMock = $this->createMock(ConfigReader::class); $this->cacheConfigMock = $this->createMock(CacheFactory::class); $this->magentoVersion = $this->createMock(MagentoVersion::class); - $this->stageConfig = $this->createMock(DeployInterface::class); $this->step = new Cache( $this->configReaderMock, $this->configWriterMock, $this->loggerMock, $this->cacheConfigMock, - $this->magentoVersion, - $this->stageConfig + $this->magentoVersion ); $this->socketCreateMock = $this->getFunctionMock( From 440afda4271a16124be00ba666238e94351c1633 Mon Sep 17 00:00:00 2001 From: Sivaram Manijeganathan Date: Wed, 24 Apr 2024 17:03:35 -0500 Subject: [PATCH 6/7] Revert "update cacheTest" This reverts commit 9348b1d917a753f8c2335ff938571317950eb3b2. --- .../Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php index baeefb2c9d..264aaf9c6a 100644 --- a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php +++ b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php @@ -19,6 +19,7 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Magento\MagentoCloud\Package\MagentoVersion; +use Magento\MagentoCloud\Config\Stage\DeployInterface; /** * @inheritdoc @@ -72,6 +73,11 @@ class CacheTest extends TestCase */ private $magentoVersion; + /** + * @var DeployInterface + */ + private $stageConfig; + /** * @inheritdoc */ @@ -82,13 +88,15 @@ protected function setUp(): void $this->configReaderMock = $this->createMock(ConfigReader::class); $this->cacheConfigMock = $this->createMock(CacheFactory::class); $this->magentoVersion = $this->createMock(MagentoVersion::class); + $this->stageConfig = $this->createMock(DeployInterface::class); $this->step = new Cache( $this->configReaderMock, $this->configWriterMock, $this->loggerMock, $this->cacheConfigMock, - $this->magentoVersion + $this->magentoVersion, + $this->stageConfig ); $this->socketCreateMock = $this->getFunctionMock( From e6b59017b58fc03b02fdacabc932131404d7e0bc Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 25 Apr 2024 12:29:57 -0400 Subject: [PATCH 7/7] Fix some static test failures --- src/Config/Validator/Deploy/AppropriateVersion.php | 4 +++- src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Config/Validator/Deploy/AppropriateVersion.php b/src/Config/Validator/Deploy/AppropriateVersion.php index a11698f825..f4e901ecee 100644 --- a/src/Config/Validator/Deploy/AppropriateVersion.php +++ b/src/Config/Validator/Deploy/AppropriateVersion.php @@ -50,6 +50,8 @@ public function __construct( /** * @return Validator\ResultInterface + * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function validate(): Validator\ResultInterface { @@ -81,7 +83,7 @@ public function validate(): Validator\ResultInterface ); } - if (!$this->magentoVersion->isGreaterOrEqual('2.4.7')) { + if (!$this->magentoVersion->isGreaterOrEqual('2.4.7')) { $variables = [ DeployInterface::VAR_USE_LUA, DeployInterface::VAR_LUA_KEY, diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php index 670e58fa97..a2c5e6f0e2 100644 --- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php +++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php @@ -123,7 +123,7 @@ public function execute() ); unset($config['cache']); } else { - if(isset($cacheConfig['frontend']['default'])) { + if (isset($cacheConfig['frontend']['default'])) { $cacheConfig['frontend']['default']['backend_options']['_useLua'] = $luaConfigKey; $cacheConfig['frontend']['default']['backend_options']['use_lua'] = $luaConfig; }