From 79f9c1b53b91f0d0d2108d252caf3c08f3df04c5 Mon Sep 17 00:00:00 2001
From: Oleksandr Shmyheliuk
Date: Tue, 20 Sep 2022 11:01:05 -0500
Subject: [PATCH 01/25] CEXT-772: Add support for deployments on Commerce Cloud
(#99)
---
config/schema.error.yaml | 14 +-
config/schema.yaml | 11 ++
dist/error-codes.md | 50 +++---
scenario/build/generate.xml | 1 +
src/App/Error.php | 2 +
src/Config/StageConfigInterface.php | 1 +
src/Step/Build/EnableEventing.php | 92 ++++++++++
src/Test/Unit/Config/SchemaTest.php | 1 +
.../Unit/Step/Build/EnableEventingTest.php | 165 ++++++++++++++++++
9 files changed, 311 insertions(+), 26 deletions(-)
create mode 100644 src/Step/Build/EnableEventing.php
create mode 100644 src/Test/Unit/Step/Build/EnableEventingTest.php
diff --git a/config/schema.error.yaml b/config/schema.error.yaml
index ca0fbe1a9a..6c0cd68bc0 100644
--- a/config/schema.error.yaml
+++ b/config/schema.error.yaml
@@ -139,7 +139,7 @@
!php/const Magento\MagentoCloud\App\Error::BUILD_WRONG_BRAINTREE_VARIABLE:
step: validate-config
title: 'Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce and Magento Open Source 2.4 and later versions.'
- suggestion: 'Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the .magento.app.yaml file. For Braintree payment support, use an official extension from the Commerce Marketplace instead.'
+ suggestion: 'Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree payment support, use an official extension from the Commerce Marketplace instead.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_CACHE_CONFIGURATION:
@@ -334,7 +334,7 @@
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_BRAINTREE_VARIABLE:
step: validate-config
title: 'Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce or Magento Open Source 2.4 and later versions.'
- suggestion: 'Support for the Braintree module is no longer included with Adobe Commerce or Magento Open Source 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the .magento.app.yaml file. For Braintree support, use an official Braintree Payments extension from the Commerce Marketplace instead.'
+ suggestion: 'Support for the Braintree module is no longer included with Adobe Commerce or Magento Open Source 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree support, use an official Braintree Payments extension from the Commerce Marketplace instead.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ES_SERVICE_NOT_INSTALLED:
@@ -430,6 +430,16 @@
suggestion: ''
stage: general
type: critical
+!php/const Magento\MagentoCloud\App\Error::GLOBAL_EVENTING_MODULE_GENERATE_FAILED:
+ title: 'Unable to generate a module for eventing'
+ suggestion: 'Check the `cloud.log` for more information.'
+ stage: general
+ type: critical
+!php/const Magento\MagentoCloud\App\Error::GLOBAL_EVENTING_MODULE_ENABLEMENT_FAILED:
+ title: 'Unable to enable a module for eventing'
+ suggestion: 'Check the `cloud.log` for more information.'
+ stage: general
+ type: critical
# Warning errors
!php/const Magento\MagentoCloud\App\Error::WARN_CONFIG_PHP_NOT_EXISTS:
title: 'File app/etc/config.php does not exist'
diff --git a/config/schema.yaml b/config/schema.yaml
index baee9d1cd8..1d8e3fb820 100644
--- a/config/schema.yaml
+++ b/config/schema.yaml
@@ -706,6 +706,17 @@ variables:
config:
region: us-east-1
bucket: test-bucket
+ ENABLE_EVENTING:
+ description: Enables commerce eventing.
+ type: boolean
+ stages:
+ - global
+ default:
+ global: false
+ examples:
+ - stage:
+ global:
+ ENABLE_EVENTING: true
# Environment variables
ENV_RELATIONSHIPS:
diff --git a/dist/error-codes.md b/dist/error-codes.md
index dd5cf02e8a..b36a6d36b4 100644
--- a/dist/error-codes.md
+++ b/dist/error-codes.md
@@ -2,7 +2,7 @@
## Critical Errors
-Critical errors indicate a problem with the Magento Commerce Cloud project configuration that causes deployment failure, for example incorrect, unsupported, or missing configuration for required settings. Before you can deploy, you must update the configuration to resolve these errors.
+Critical errors indicate a problem with the Commerce on cloud infrastructure project configuration that causes deployment failure, for example incorrect, unsupported, or missing configuration for required settings. Before you can deploy, you must update the configuration to resolve these errors.
### Build stage
@@ -16,7 +16,7 @@ Critical errors indicate a problem with the Magento Commerce Cloud project confi
| 6 | | Unable to read the `.schema.yaml` file | Unable to read the `./vendor/magento/ece-tools/config/magento.env.yaml` file. Check file permissions and redeploy (`magento-cloud environment:redeploy`). |
| 7 | refresh-modules | Cannot write to the `./app/etc/config.php` file | The deployment script cannot make required changes to the `/app/etc/config.php` file. Check your filesystem permissions. |
| 8 | validate-config | Cannot read the `composer.json` file | Unable to read the `./composer.json` file. Check file permissions. |
-| 9 | validate-config | Composer.json is missing required autoload section | Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Magento Cloud template, and add the missing configuration. |
+| 9 | validate-config | Composer.json is missing required autoload section | Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Cloud template, and add the missing configuration. |
| 10 | validate-config | The file `.magento.env.yaml` contains an option that is not declared in the schema, or an option configured with an invalid value or stage | The `./.magento.env.yaml` file contains invalid configuration. Check the error log for detailed info. |
| 11 | refresh-modules | Command failed: `/bin/magento module:enable --all` | Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 12 | apply-patches | Failed to apply patch | |
@@ -32,8 +32,8 @@ Critical errors indicate a problem with the Magento Commerce Cloud project confi
| 22 | backup-data: writable-dirs | Failed to copy some writable directories into the `init` directory | Failed to copy writable directories into the `./init` folder. Check your filesystem permissions. |
| 23 | | Unable to create a logger object | |
| 24 | backup-data: static-content | Failed to clean the `./init/pub/static/` directory | Failed to clean `./init/pub/static` folder. Check your filesystem permissions. |
-| 25 | | Cannot find the Composer package | If you installed the Magento application version directly from the Magento git repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured. |
-| 26 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Magento 2.4 and later versions. | Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the .magento.app.yaml file. For Braintree payment support, use an official extension from the Magento Marketplace instead. |
+| 25 | | Cannot find the Composer package | If you installed the Adobe Commerce application version directly from the GitHub repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured. |
+| 26 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce and Magento Open Source 2.4 and later versions. | Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree payment support, use an official extension from the Commerce Marketplace instead. |
### Deploy stage
@@ -48,7 +48,7 @@ Critical errors indicate a problem with the Magento Commerce Cloud project confi
| 106 | | Unable to read the `.schema.yaml` file | |
| 107 | pre-deploy: clean-redis-cache | Failed to clean the Redis cache | Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://devdocs.magento.com/cloud/project/services-redis.html). |
| 108 | pre-deploy: set-production-mode | Command `/bin/magento maintenance:enable` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
-| 109 | validate-config | Incorrect database configuration | Check that the the `DATABASE_CONFIGURATION` environment variable is configured correctly. |
+| 109 | validate-config | Incorrect database configuration | Check that the `DATABASE_CONFIGURATION` environment variable is configured correctly. |
| 110 | validate-config | Incorrect session configuration | Check that the `SESSION_CONFIGURATION` environment variable is configured correctly. The configuration must contain at least the `save` parameter. |
| 111 | validate-config | Incorrect search configuration | Check that the `SEARCH_CONFIGURATION` environment variable is configured correctly. The configuration must contain at least the `engine` parameter. |
| 112 | validate-config | Incorrect resource configuration | Check that the `RESOURCE_CONFIGURATION` environment variable is configured correctly. The configuration must contain at least `connection` parameter. |
@@ -69,16 +69,16 @@ Critical errors indicate a problem with the Magento Commerce Cloud project confi
| 127 | clean-cache | Command `/bin/magento cache:flush` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 128 | disable-maintenance-mode | Command `/bin/magento maintenance:disable` failed | Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
| 129 | install-update: reset-password | Unable to read reset password template | |
-| 130 | install-update: cache_type | Command failed: `php ./bin/magento cache:enable` | Command `php ./bin/magento cache:enable` runs only when Magento was installed but `./app/etc/env.php` file was absent or empty at the beginning of the deployment. Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
-| 131 | install-update | The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable | This error occurs if the `./app/etc/env.php` file is not present when Magento deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://devdocs.magento.com/cloud/env/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Add the Magento encryption key](https://devdocs.magento.com/cloud/setup/first-time-setup-import-import.html#encryption-key). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command ." |
+| 130 | install-update: cache_type | Command failed: `php ./bin/magento cache:enable` | Command `php ./bin/magento cache:enable` runs only when Adobe Commerce was installed but `./app/etc/env.php` file was absent or empty at the beginning of the deployment. Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
+| 131 | install-update | The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable | This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://devdocs.magento.com/cloud/env/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Add the Magento encryption key](https://devdocs.magento.com/cloud/setup/first-time-setup-import-import.html#encryption-key). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command ." |
| 132 | | Can not connect to the Elasticsearch service | Check for valid Elasticsearch credentials and verify that the service is running |
| 137 | | Can not connect to the Opensearch service | Check for valid Opensearch credentials and verify that the service is running |
-| 133 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Magento 2.4 and later versions. | Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the .magento.app.yaml file. For Braintree support, use an official Braintree Payments extension from the Magento Marketplace instead. |
-| 134 | validate-config | Magento 2.4.0 requires Elasticsearch service to be installed | Install Elasticsearch service |
-| 138 | validate-config | Magento 2.4.4 requires Opensearch or Elasticsearch service to be installed | Install Opensearch service |
-| 135 | validate-config | The search engine must be set to Elasticsearch for Magento >= 2.4.0 | Check the SEARCH_CONFIGURATION variable for the `engine` option. If it is configured, remove the option, or set the value to "elasticsearch". |
-| 136 | validate-config | Split Database was removed starting from Magento 2.5.0. | If you use split database you have to revert to or migrate to a single database or use an alternative approach. |
-| 139 | validate-config | Incorrect search engine | This Magento version does not support Opensearch. You must use versions 2.3.7-p3, 2.4.3-p2, or higher |
+| 133 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce or Magento Open Source 2.4 and later versions. | Support for the Braintree module is no longer included with Adobe Commerce or Magento Open Source 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree support, use an official Braintree Payments extension from the Commerce Marketplace instead. |
+| 134 | validate-config | Adobe Commerce and Magento Open Source 2.4.0 require Elasticsearch service to be installed | Install Elasticsearch service |
+| 138 | validate-config | Adobe Commerce and Magento Open Source 2.4.4 requires Opensearch or Elasticsearch service to be installed | Install Opensearch service |
+| 135 | validate-config | The search engine must be set to Elasticsearch for Adobe Commerce and Magento Open Source >= 2.4.0 | Check the SEARCH_CONFIGURATION variable for the `engine` option. If it is configured, remove the option, or set the value to "elasticsearch". |
+| 136 | validate-config | Split Database was removed starting from Adobe Commerce and Magento Open Source 2.5.0. | If you use split database you have to revert to or migrate to a single database or use an alternative approach. |
+| 139 | validate-config | Incorrect search engine | This Adobe Commerce or Magento Open Source version does not support Opensearch. You must use versions 2.3.7-p3, 2.4.3-p2, or higher |
### Post-deploy stage
@@ -104,10 +104,12 @@ Critical errors indicate a problem with the Magento Commerce Cloud project confi
| 244 | | Failed to parse the `.magento.env.yaml` file | The `./.magento.env.yaml` file format is invalid. Use a YAML parser to check the syntax and fix any errors. |
| 245 | | Unable to read the `.magento.env.yaml` file | Unable to read the `./.magento.env.yaml` file. Check file permissions. |
| 246 | | Unable to read the `.schema.yaml` file | |
+| 247 | | Unable to generate a module for eventing | Check the `cloud.log` for more information. |
+| 248 | | Unable to enable a module for eventing | Check the `cloud.log` for more information. |
## Warning Errors
-Warning errors indicate a problem with the Magento Commerce Cloud project configuration such as incorrect, deprecated, unsupported, or missing configuration settings for optional features that can affect site operation. Although a warning does not cause deployment failure, you should review warning messages and update the configuration to resolve them.
+Warning errors indicate a problem with the Commerce on cloud infrastructure project configuration such as incorrect, deprecated, unsupported, or missing configuration settings for optional features that can affect site operation. Although a warning does not cause deployment failure, you should review warning messages and update the configuration to resolve them.
### Build stage
@@ -134,36 +136,36 @@ Warning errors indicate a problem with the Magento Commerce Cloud project config
| 2005 | validate-config | Admin data is used to create an admin user during initial installation only. Any changes to Admin data are ignored during the upgrade process. | After the initial installation, you can remove admin data from the configuration. |
| 2006 | validate-config | Admin user was not created as admin email was not set | After installation, you can create an admin user manually: Use ssh to connect to your environment. Then, run the `bin/magento admin:user:create` command. |
| 2007 | validate-config | Update php version to recommended version | |
-| 2008 | validate-config | Solr support has been deprecated in Magento 2.1. | |
-| 2009 | validate-config | Solr is no longer supported by Magento 2.2 or later. | |
+| 2008 | validate-config | Solr support has been deprecated in Adobe Commerce and Magento Open Source 2.1. | |
+| 2009 | validate-config | Solr is no longer supported by Adobe Commerce and Magento Open Source 2.2 or later. | |
| 2010 | validate-config | Elasticsearch service is installed at infrastructure layer, but it is not used as a search engine. | Consider removing the Elasticsearch service from the infrastructure layer to optimize resource usage. |
-| 2011 | validate-config | Elasticsearch service version on infrastructure layer is not compatible with current version of the elasticsearch/elasticsearch module, used by your Magento application. | |
-| 2012 | validate-config | The current configuration is not compatible with this version of Magento | |
+| 2011 | validate-config | Elasticsearch service version on infrastructure layer is not compatible with current version of the elasticsearch/elasticsearch module, used by your Adobe Commerce application. | |
+| 2012 | validate-config | The current configuration is not compatible with this version of Adobe Commerce | |
| 2013 | validate-config | SCD options ignored because the deploy process did not run on the build phase | |
| 2014 | validate-config | The configuration contains deprecated variables or values | |
| 2015 | validate-config | Environment configuration is not valid | |
| 2016 | validate-config | JSON type configuration can not be decoded | |
-| 2017 | validate-config | The current configuration is not compatible with this version of Magento | |
+| 2017 | validate-config | The current configuration is not compatible with this version of Adobe Commerce | |
| 2018 | validate-config | Some services have passed EOL | |
| 2019 | validate-config | The MySQL search configuration option is deprecated | Use Elasticsearch instead. |
-| 2029 | validate-config | Split Database was deprecated in the Magento 2.4.2 and will be removed in 2.5. | If you use split database you should start planning to revert to or migrate to a single database or use an alternative approach. |
-| 2020 | install-update | Magento installation completed, but the `app/etc/env.php` configuration file was missing or empty. | Required data will be restored from environment configurations and from .magento.env.yaml file. |
+| 2029 | validate-config | Split Database was deprecated in the Adobe Commerce and Magento Open Source 2.4.2 and will be removed in 2.5. | If you use split database you should start planning to revert to or migrate to a single database or use an alternative approach. |
+| 2020 | install-update | Adobe Commerce installation completed, but the `app/etc/env.php` configuration file was missing or empty. | Required data will be restored from environment configurations and from .magento.env.yaml file. |
| 2021 | install-update:db-connection | For split databases used custom connections | |
| 2022 | install-update:db-connection | You have changed to a database configuration that is not compatible with the slave connection. | |
| 2023 | install-update:split-db | Enabling a split database will be skipped. | |
| 2024 | install-update:split-db | The SPLIT_DB variable is missing the configuration for split connection types. | |
| 2025 | install-update:split-db | Slave connection not set. | |
| 2026 | pre-deploy:restore-writable-dirs | Failed to restore some data generated during the build phase to the mounted directories | Check the `cloud.log` for more information. |
-| 2027 | validate-config:mage-mode-variable | Mode value for MAGE_MODE environment variable not supported | Remove the MAGE_MODE environment variable, or change its value to "production". Magento Cloud supports "production" mode only. |
+| 2027 | validate-config:mage-mode-variable | Mode value for MAGE_MODE environment variable not supported | Remove the MAGE_MODE environment variable, or change its value to "production". Adobe Commerce on cloud infrastructure supports "production" mode only. |
| 2028 | remote-storage | Remote storage could not be enabled. | Verify remote storage credentials. |
-| 2030 | validate-config | Elasticsearch and Opensearch services are both installed at infrastructure layer. Magento 2.4.4 and higher uses Opensearch by default | Consider removing the Elasticsearch or Opensearch service from the infrastructure layer to optimize resource usage. |
+| 2030 | validate-config | Elasticsearch and Opensearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and higher use Opensearch by default | Consider removing the Elasticsearch or Opensearch service from the infrastructure layer to optimize resource usage. |
### Post-deploy stage
{:.error-table}
| Error code | Post-deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
-| 3001 | validate-config | Debug logging is enabled in Magento | To save disk space, do not enable debug logging for your production environments. |
+| 3001 | validate-config | Debug logging is enabled in Adobe Commerce | To save disk space, do not enable debug logging for your production environments. |
| 3002 | warm-up | Can not fetch store urls | |
| 3003 | warm-up | Can not fetch store url | |
| 3004 | backup | Cannot create backup files | |
diff --git a/scenario/build/generate.xml b/scenario/build/generate.xml
index 29909e169f..f67da11d6c 100644
--- a/scenario/build/generate.xml
+++ b/scenario/build/generate.xml
@@ -28,6 +28,7 @@
+
diff --git a/src/App/Error.php b/src/App/Error.php
index da14a53dfc..2b9d70d7cb 100644
--- a/src/App/Error.php
+++ b/src/App/Error.php
@@ -94,6 +94,8 @@ class Error
public const GLOBAL_CONFIG_PARSE_FAILED = 244;
public const GLOBAL_CONFIG_UNABLE_TO_READ = 245;
public const GLOBAL_CONFIG_UNABLE_TO_READ_SCHEMA_YAML = 246;
+ public const GLOBAL_EVENTING_MODULE_GENERATE_FAILED = 247;
+ public const GLOBAL_EVENTING_MODULE_ENABLEMENT_FAILED = 248;
/**
* Build
diff --git a/src/Config/StageConfigInterface.php b/src/Config/StageConfigInterface.php
index ab4e99dff8..36d1ca4e83 100644
--- a/src/Config/StageConfigInterface.php
+++ b/src/Config/StageConfigInterface.php
@@ -42,6 +42,7 @@ interface StageConfigInterface
public const VAR_SCD_MATRIX = 'SCD_MATRIX';
public const VAR_SCD_NO_PARENT = 'SCD_NO_PARENT';
public const VAR_X_FRAME_CONFIGURATION = 'X_FRAME_CONFIGURATION';
+ public const VAR_ENABLE_EVENTING = 'ENABLE_EVENTING';
/**
* Settings for deployment from git.
diff --git a/src/Step/Build/EnableEventing.php b/src/Step/Build/EnableEventing.php
new file mode 100644
index 0000000000..2dcc2f2a44
--- /dev/null
+++ b/src/Step/Build/EnableEventing.php
@@ -0,0 +1,92 @@
+logger = $logger;
+ $this->magentoShell = $shellFactory->createMagento();
+ $this->globalConfig = $globalConfig;
+ }
+
+ /**
+ * Generates and enables a module for eventing if @see StageConfigInterface::VAR_ENABLE_EVENTING set to true
+ *
+ * {@inheritDoc}
+ */
+ public function execute()
+ {
+ try {
+ if (!$this->globalConfig->get(StageConfigInterface::VAR_ENABLE_EVENTING)) {
+ return;
+ }
+ } catch (ConfigException $e) {
+ throw new StepException($e->getMessage(), $e->getCode(), $e);
+ }
+
+ try {
+ $this->logger->notice('Generating module for eventing');
+ $this->magentoShell->execute('events:generate:module');
+ } catch (ShellException $e) {
+ $this->logger->error(
+ 'Failed to generate the Magento_AdobeCommerceEvents module. ' .
+ 'Refer to the eventing documentation to determine if all required modules are have been installed. ' .
+ 'Error: ' . $e->getMessage()
+ );
+ throw new StepException($e->getMessage(), Error::GLOBAL_EVENTING_MODULE_GENERATE_FAILED, $e);
+ }
+
+ try {
+ $this->logger->notice('Enabling module for eventing');
+ $this->magentoShell->execute('module:enable Magento_AdobeCommerceEvents');
+ } catch (ShellException $e) {
+ $this->logger->error('Failed to enable module for eventing: ' . $e->getMessage());
+ throw new StepException($e->getMessage(), Error::GLOBAL_EVENTING_MODULE_ENABLEMENT_FAILED, $e);
+ }
+ }
+}
diff --git a/src/Test/Unit/Config/SchemaTest.php b/src/Test/Unit/Config/SchemaTest.php
index c1be3f44e7..e8ff400301 100644
--- a/src/Test/Unit/Config/SchemaTest.php
+++ b/src/Test/Unit/Config/SchemaTest.php
@@ -174,6 +174,7 @@ public function testGetDefaultsForGlobalSection(): void
StageConfigInterface::VAR_DEPLOY_FROM_GIT_OPTIONS => [],
StageConfigInterface::VAR_MIN_LOGGING_LEVEL => '',
StageConfigInterface::VAR_X_FRAME_CONFIGURATION => 'SAMEORIGIN',
+ StageConfigInterface::VAR_ENABLE_EVENTING => false,
],
$this->schema->getDefaults(StageConfigInterface::STAGE_GLOBAL)
);
diff --git a/src/Test/Unit/Step/Build/EnableEventingTest.php b/src/Test/Unit/Step/Build/EnableEventingTest.php
new file mode 100644
index 0000000000..e97d692127
--- /dev/null
+++ b/src/Test/Unit/Step/Build/EnableEventingTest.php
@@ -0,0 +1,165 @@
+loggerMock = $this->getMockForAbstractClass(LoggerInterface::class);
+ $this->magentoShellMock = $this->createMock(MagentoShell::class);
+ /** @var ShellFactory|MockObject $shellFactoryMock */
+ $shellFactoryMock = $this->createMock(ShellFactory::class);
+ $shellFactoryMock->expects($this->once())
+ ->method('createMagento')
+ ->willReturn($this->magentoShellMock);
+ $this->globalConfigMock = $this->createMock(GlobalSection::class);
+
+ $this->step = new EnableEventing(
+ $this->loggerMock,
+ $shellFactoryMock,
+ $this->globalConfigMock
+ );
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Step\StepException
+ */
+ public function testExecuteEventingNotEnabled()
+ {
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_EVENTING)
+ ->willReturn(false);
+
+ $this->magentoShellMock->expects(self::never())
+ ->method('execute');
+ $this->loggerMock->expects(self::never())
+ ->method('notice');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Step\StepException
+ */
+ public function testExecuteGenerateCommandFailed()
+ {
+ $this->expectException(StepException::class);
+ $this->expectExceptionMessage('error during module generation');
+ $this->expectExceptionCode(Error::GLOBAL_EVENTING_MODULE_GENERATE_FAILED);
+
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_EVENTING)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::once())
+ ->method('execute')
+ ->with('events:generate:module')
+ ->willThrowException(new ShellException('error during module generation'));
+ $this->loggerMock->expects(self::once())
+ ->method('notice');
+ $this->loggerMock->expects(self::once())
+ ->method('error');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Step\StepException
+ */
+ public function testExecuteEnableModuleCommandFailed()
+ {
+ $this->expectException(StepException::class);
+ $this->expectExceptionMessage('error during module enablement');
+ $this->expectExceptionCode(Error::GLOBAL_EVENTING_MODULE_ENABLEMENT_FAILED);
+
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_EVENTING)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::at(0))
+ ->method('execute')
+ ->with('events:generate:module');
+ $this->magentoShellMock->expects(self::at(1))
+ ->method('execute')
+ ->with('module:enable Magento_AdobeCommerceEvents')
+ ->willThrowException(new ShellException('error during module enablement'));
+ $this->loggerMock->expects(self::exactly(2))
+ ->method('notice');
+ $this->loggerMock->expects(self::once())
+ ->method('error');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Step\StepException
+ */
+ public function testExecuteSuccess()
+ {
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_EVENTING)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::at(0))
+ ->method('execute')
+ ->with('events:generate:module');
+ $this->magentoShellMock->expects(self::at(1))
+ ->method('execute')
+ ->with('module:enable Magento_AdobeCommerceEvents');
+ $this->loggerMock->expects(self::exactly(2))
+ ->method('notice');
+ $this->loggerMock->expects(self::never())
+ ->method('error');
+
+ $this->step->execute();
+ }
+}
From b09c78a27320e60994ef8272f03026f5cdfe9907 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Tue, 18 Oct 2022 21:42:50 -0500
Subject: [PATCH 02/25] MCLOUD-9486: Ece-tools should keep id_salt in cache
configuration for graphql (#102)
---
.../Deploy/PreDeploy/ConfigUpdate/Cache.php | 5 +
.../PreDeploy/ConfigUpdate/CacheTest.php | 158 +++++++++++++++++-
2 files changed, 154 insertions(+), 9 deletions(-)
diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
index 410075cb00..009fc4ec90 100644
--- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
+++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
@@ -76,6 +76,7 @@ public function execute()
try {
$config = $this->configReader->read();
$cacheConfig = $this->cacheConfig->get();
+ $graphqlConfig = $config['cache']['graphql'] ?? [];
if (isset($cacheConfig['frontend'])) {
$cacheConfig['frontend'] = array_filter($cacheConfig['frontend'], function ($cacheFrontend) {
@@ -108,6 +109,10 @@ public function execute()
$config['cache'] = $cacheConfig;
}
+ if (!empty($graphqlConfig)) {
+ $config['cache']['graphql'] = $graphqlConfig;
+ }
+
$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/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
index 8714e81636..9f727330bc 100644
--- a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
+++ b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
@@ -106,28 +106,36 @@ protected function setUp(): void
}
/**
+ * @param array $configFromFile
* @param array $config
+ * @param array $finalConfig
* @param bool $isGreaterOrEqual
* @param string $address
* @param int $port
* @throws StepException
* @dataProvider executeDataProvider
*/
- public function testExecute(array $config, bool $isGreaterOrEqual, $address, $port)
- {
+ public function testExecute(
+ array $configFromFile,
+ array $config,
+ array $finalConfig,
+ bool $isGreaterOrEqual,
+ $address,
+ $port
+ ) {
$this->magentoVersion->expects($this->any())
->method('isGreaterOrEqual')
->with('2.3.0')
->willReturn($isGreaterOrEqual);
$this->configReaderMock->expects($this->once())
->method('read')
- ->willReturn([]);
+ ->willReturn($configFromFile);
$this->cacheConfigMock->expects($this->once())
->method('get')
->willReturn($config);
$this->configWriterMock->expects($this->once())
->method('create')
- ->with(['cache' => $config]);
+ ->with($finalConfig);
$this->loggerMock->expects($this->once())
->method('info')
->with('Updating cache configuration.');
@@ -145,10 +153,51 @@ public function testExecute(array $config, bool $isGreaterOrEqual, $address, $po
$this->step->execute();
}
+ /**
+ * @return array[]
+ *
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
public function executeDataProvider(): array
{
return [
+ 'with qraphql config in file' => [
+ 'configFromFile' => [
+ 'cache' => ['graphql' => ['id_salt' => 'some salt']],
+ ],
+ 'config' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_CM_CACHE,
+ 'backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ ],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_CM_CACHE,
+ 'backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ 'graphql' => [
+ 'id_salt' => 'some salt',
+ ],
+ ],
+ ],
+ 'isGreaterOrEqual' => false,
+ 'address' => 'localhost',
+ 'port' => 6370
+ ],
'backend model without remote_backend_options' => [
+ 'configFromFile' => [],
'config' => [
'frontend' => [
'frontName' => [
@@ -160,11 +209,25 @@ public function executeDataProvider(): array
],
],
],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_CM_CACHE,
+ 'backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ ],
+ ],
'isGreaterOrEqual' => false,
'address' => 'localhost',
'port' => 6370
],
'backend model with remote_backend_options' => [
+ 'configFromFile' => [],
'config' => [
'frontend' => [
'frontName' => [
@@ -178,11 +241,27 @@ public function executeDataProvider(): array
],
],
],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_REMOTE_SYNCHRONIZED_CACHE,
+ 'backend_options' => [
+ 'remote_backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
'isGreaterOrEqual' => true,
'address' => 'localhost',
'port' => 6370
],
'Server contains port data' => [
+ 'configFromFile' => [],
'config' => [
'frontend' => [
'frontName' => [
@@ -195,11 +274,26 @@ public function executeDataProvider(): array
],
],
],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_REMOTE_SYNCHRONIZED_CACHE,
+ 'backend_options' => [
+ 'remote_backend_options' => [
+ 'server' => '127.0.0.1:6371',
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
'isGreaterOrEqual' => true,
'address' => '127.0.0.1',
'port' => 6371
],
'Server contains protocol and port data' => [
+ 'configFromFile' => [],
'config' => [
'frontend' => [
'frontName' => [
@@ -212,6 +306,20 @@ public function executeDataProvider(): array
],
],
],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => CacheFactory::REDIS_BACKEND_REMOTE_SYNCHRONIZED_CACHE,
+ 'backend_options' => [
+ 'remote_backend_options' => [
+ 'server' => 'tcp://localhost:6379',
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
'isGreaterOrEqual' => true,
'address' => 'localhost',
'port' => 6379
@@ -219,19 +327,24 @@ public function executeDataProvider(): array
];
}
- public function testExecuteEmptyConfig()
+ /**
+ * @param array $cacheConfig
+ * @param array $finalConfig
+ * @return void
+ * @throws StepException
+ * @dataProvider executeEmptyConfig
+ */
+ public function testExecuteEmptyConfig(array $cacheConfig, array $finalConfig): void
{
$this->configReaderMock->expects($this->once())
->method('read')
- ->willReturn(['cache' => [
- 'frontend' => ['frontName' => ['backend' => 'cacheDriver']],
- ]]);
+ ->willReturn($cacheConfig);
$this->cacheConfigMock->expects($this->once())
->method('get')
->willReturn([]);
$this->configWriterMock->expects($this->once())
->method('create')
- ->with([]);
+ ->with($finalConfig);
$this->loggerMock->expects($this->once())
->method('info')
->with('Cache configuration was not found. Removing cache configuration.');
@@ -243,6 +356,33 @@ public function testExecuteEmptyConfig()
$this->step->execute();
}
+ public function executeEmptyConfig(): array
+ {
+ return [
+ 'without graphql in config' => [
+ 'cacheConfig' => [
+ 'cache' => [
+ 'frontend' => ['frontName' => ['backend' => 'cacheDriver']],
+ ],
+ ],
+ 'finalConfig' => [],
+ ],
+ 'with graphql in config' => [
+ 'cacheConfig' => [
+ 'cache' => [
+ 'frontend' => ['frontName' => ['backend' => 'cacheDriver']],
+ 'graphql' => ['id_salt' => 'some salt'],
+ ],
+ ],
+ 'finalConfig' => [
+ 'cache' => [
+ 'graphql' => ['id_salt' => 'some salt'],
+ ],
+ ],
+ ],
+ ];
+ }
+
public function testExecuteRedisService()
{
$this->prepareMocks();
From a754fea040596b153819b9d804c3eba6c234a83c Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Thu, 20 Oct 2022 15:59:42 -0500
Subject: [PATCH 03/25] MCLOUD-9485: Add validator for opcache excluded paths
(#103)
---
scenario/build/generate.xml | 1 +
src/App/Error.php | 1 +
.../Validator/Build/OpcacheExcludePaths.php | 107 +++++++
src/Filesystem/ConfigFileList.php | 16 +
.../Build/OpcacheExcludePathsTest.php | 282 ++++++++++++++++++
.../Unit/Filesystem/ConfigFileListTest.php | 10 +
6 files changed, 417 insertions(+)
create mode 100644 src/Config/Validator/Build/OpcacheExcludePaths.php
create mode 100644 src/Test/Unit/Config/Validator/Build/OpcacheExcludePathsTest.php
diff --git a/scenario/build/generate.xml b/scenario/build/generate.xml
index f67da11d6c..008161aa08 100644
--- a/scenario/build/generate.xml
+++ b/scenario/build/generate.xml
@@ -14,6 +14,7 @@
-
- Magento\MagentoCloud\Config\Validator\Build\ConfigFileExists
+ - Magento\MagentoCloud\Config\Validator\Build\OpcacheExcludePaths
- Magento\MagentoCloud\Config\Validator\Build\UnsupportedBuildOptionsIni
- Magento\MagentoCloud\Config\Validator\Build\ModulesExists
- Magento\MagentoCloud\Config\Validator\Build\AppropriateVersion
diff --git a/src/App/Error.php b/src/App/Error.php
index 2b9d70d7cb..11d6cd8307 100644
--- a/src/App/Error.php
+++ b/src/App/Error.php
@@ -107,6 +107,7 @@ class Error
public const WARN_SCD_OPTIONS_IGNORANCE = 1005;
public const WARN_CONFIGURATION_STATE_NOT_IDEAL = 1006;
public const WARN_BALER_CANNOT_BE_USED = 1007;
+ public const WARN_WRONG_OPCACHE_CONFIG = 1008;
/**
* Deploy
diff --git a/src/Config/Validator/Build/OpcacheExcludePaths.php b/src/Config/Validator/Build/OpcacheExcludePaths.php
new file mode 100644
index 0000000000..846868904a
--- /dev/null
+++ b/src/Config/Validator/Build/OpcacheExcludePaths.php
@@ -0,0 +1,107 @@
+file = $file;
+ $this->fileList = $fileList;
+ $this->resultFactory = $resultFactory;
+ }
+
+ /**
+ * Checks if php.ini and op-exclude.txt are present, and they contain needed configuration
+ *
+ * {@inheritdoc}
+ */
+ public function validate(): Validator\ResultInterface
+ {
+ $phpIni = $this->fileList->getPhpIni();
+ $excludeList = $this->fileList->getOpCacheExcludeList();
+
+ // Checks if files are present
+ if (!$this->file->isExists($phpIni) || !$this->file->isExists($excludeList)) {
+ return $this->resultFactory->error(
+ 'File php.ini or op-exclude.txt does not exist',
+ 'Check if your cloud template contains latest php.ini and op-exclude.txt files',
+ Error::WARN_WRONG_OPCACHE_CONFIG
+ );
+ }
+
+ // Checks if the php.ini file contains correct path to the op-exclude.txt file
+ $parsedPhpIni = (array) $this->file->parseIni($phpIni);
+
+ if (!(array_key_exists('opcache.blacklist_filename', $parsedPhpIni)
+ && $parsedPhpIni['opcache.blacklist_filename'] == $excludeList)) {
+ return $this->resultFactory->error(
+ 'File php.ini does not contain opcache.blacklist_filename configuration',
+ 'Check if your cloud template contains latest php.ini configuration file'
+ . ' https://github.com/magento/magento-cloud/blob/master/php.ini',
+ Error::WARN_WRONG_OPCACHE_CONFIG
+ );
+ }
+
+ // Checks if the op-exclude.txt file contains all needed paths to exclude for OPCache
+ $diff = array_diff(
+ [
+ '/app/*/app/etc/config.php',
+ '/app/*/app/etc/env.php',
+ '/app/app/etc/config.php',
+ '/app/app/etc/env.php',
+ '/app/etc/config.php',
+ '/app/etc/env.php'
+ ],
+ explode(PHP_EOL, (string) $this->file->fileGetContents($excludeList))
+ );
+
+ if (!empty($diff)) {
+ return $this->resultFactory->error(
+ 'File op-exclude.txt does not contain required paths to exclude for OPCache',
+ 'Check if your op-exclude.txt contains the next paths:' . PHP_EOL
+ . implode(PHP_EOL, $diff),
+ Error::WARN_WRONG_OPCACHE_CONFIG
+ );
+ }
+
+ return $this->resultFactory->create(Validator\ResultInterface::SUCCESS);
+ }
+}
diff --git a/src/Filesystem/ConfigFileList.php b/src/Filesystem/ConfigFileList.php
index f3eeefa2df..2d6e5beb11 100644
--- a/src/Filesystem/ConfigFileList.php
+++ b/src/Filesystem/ConfigFileList.php
@@ -73,4 +73,20 @@ public function getErrorReportConfig(): string
{
return $this->systemList->getMagentoRoot() . '/pub/errors/local.xml';
}
+
+ /**
+ * @return string
+ */
+ public function getPhpIni(): string
+ {
+ return $this->systemList->getMagentoRoot() . '/php.ini';
+ }
+
+ /**
+ * @return string
+ */
+ public function getOpCacheExcludeList(): string
+ {
+ return $this->systemList->getMagentoRoot() . '/op-exclude.txt';
+ }
}
diff --git a/src/Test/Unit/Config/Validator/Build/OpcacheExcludePathsTest.php b/src/Test/Unit/Config/Validator/Build/OpcacheExcludePathsTest.php
new file mode 100644
index 0000000000..68fbe63263
--- /dev/null
+++ b/src/Test/Unit/Config/Validator/Build/OpcacheExcludePathsTest.php
@@ -0,0 +1,282 @@
+fileMock = $this->createMock(File::class);
+ $this->fileListMock = $this->createMock(FileList::class);
+ $this->resultFactoryMock = $this->createMock(ResultFactory::class);
+
+ $this->opcacheExcludePaths = new OpcacheExcludePaths(
+ $this->fileMock,
+ $this->fileListMock,
+ $this->resultFactoryMock
+ );
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Config\ValidatorException
+ */
+ public function testValidateSuccess(): void
+ {
+ $phpIniPath = '/app/php.ini';
+ $excludeListPath = '/app/op-exclude.txt';
+ $phpIni = ['opcache.blacklist_filename' => $excludeListPath];
+ $excludeList = <<fileListMock->expects($this->once())
+ ->method('getPhpIni')
+ ->willReturn($phpIniPath);
+ $this->fileListMock->expects($this->once())
+ ->method('getOpCacheExcludeList')
+ ->willReturn($excludeListPath);
+ $this->fileMock->expects($this->exactly(2))
+ ->method('isExists')
+ ->withConsecutive([$phpIniPath], [$excludeListPath])
+ ->willReturn(true);
+ $this->fileMock->expects($this->once())
+ ->method('parseIni')
+ ->with($phpIniPath)
+ ->willReturn($phpIni);
+ $this->fileMock->expects($this->once())
+ ->method('fileGetContents')
+ ->with($excludeListPath)
+ ->willReturn($excludeList);
+ $this->resultFactoryMock->expects($this->never())
+ ->method('error');
+ $this->resultFactoryMock->expects($this->once())
+ ->method('create')
+ ->with(ResultInterface::SUCCESS)
+ ->willReturn($this->createMock(Success::class));
+
+ $this->assertInstanceOf(
+ Success::class,
+ $this->opcacheExcludePaths->validate()
+ );
+ }
+
+ /**
+ * @param int $invokeCount
+ * @param bool $phpIniExists
+ * @param bool $opCacheExcludeListExists
+ * @return void
+ * @throws \Magento\MagentoCloud\Config\ValidatorException
+ * @dataProvider validateFilesDoNotExistDataProvider
+ */
+ public function testValidateFilesDoNotExist(
+ int $invokeCount,
+ bool $phpIniExists,
+ bool $opCacheExcludeListExists
+ ): void {
+ $phpIniPath = '/app/php.ini';
+ $excludeListPath = '/app/op-exclude.txt';
+
+ $this->fileListMock->expects($this->once())
+ ->method('getPhpIni')
+ ->willReturn($phpIniPath);
+ $this->fileListMock->expects($this->once())
+ ->method('getOpCacheExcludeList')
+ ->willReturn($excludeListPath);
+ $this->fileMock->expects($this->exactly($invokeCount))
+ ->method('isExists')
+ ->withConsecutive([$phpIniPath], [$excludeListPath])
+ ->willReturnOnConsecutiveCalls($phpIniExists, $opCacheExcludeListExists);
+ $this->resultFactoryMock->expects($this->never())
+ ->method('create');
+ $this->resultFactoryMock->expects($this->once())
+ ->method('error')
+ ->with(
+ 'File php.ini or op-exclude.txt does not exist',
+ 'Check if your cloud template contains latest php.ini and op-exclude.txt files',
+ AppError::WARN_WRONG_OPCACHE_CONFIG
+ )
+ ->willReturn($this->createMock(ResultError::class));
+
+ $this->assertInstanceOf(
+ ResultError::class,
+ $this->opcacheExcludePaths->validate()
+ );
+ }
+
+ /**
+ * @return array[]
+ */
+ public function validateFilesDoNotExistDataProvider(): array
+ {
+ return [
+ [
+ 'invokeCount' => 2,
+ 'phpIniExists' => true,
+ 'opCacheExcludeListExists' => false
+ ],
+ [
+ 'invokeCount' => 1,
+ 'phpIniExists' => false,
+ 'opCacheExcludeListExists' => true
+ ],
+ [
+ 'invokeCount' => 1,
+ 'phpIniExists' => false,
+ 'opCacheExcludeListExists' => false
+ ],
+ ];
+ }
+
+ /**
+ * @param array|bool $phpIni
+ * @return void
+ * @throws \Magento\MagentoCloud\Config\ValidatorException
+ * @dataProvider validatePhpIniWrongConfigurationDataProvider
+ */
+ public function testValidatePhpIniWrongConfiguration($phpIni): void
+ {
+ $phpIniPath = '/app/php.ini';
+ $excludeListPath = '/app/op-exclude.txt';
+
+ $this->fileListMock->expects($this->once())
+ ->method('getPhpIni')
+ ->willReturn($phpIniPath);
+ $this->fileListMock->expects($this->once())
+ ->method('getOpCacheExcludeList')
+ ->willReturn($excludeListPath);
+ $this->fileMock->expects($this->exactly(2))
+ ->method('isExists')
+ ->withConsecutive([$phpIniPath], [$excludeListPath])
+ ->willReturn(true);
+ $this->fileMock->expects($this->once())
+ ->method('parseIni')
+ ->with($phpIniPath)
+ ->willReturn($phpIni);
+ $this->resultFactoryMock->expects($this->never())
+ ->method('create');
+ $this->resultFactoryMock->expects($this->once())
+ ->method('error')
+ ->with(
+ 'File php.ini does not contain opcache.blacklist_filename configuration',
+ 'Check if your cloud template contains latest php.ini configuration file'
+ . ' https://github.com/magento/magento-cloud/blob/master/php.ini',
+ AppError::WARN_WRONG_OPCACHE_CONFIG
+ )
+ ->willReturn($this->createMock(ResultError::class));
+
+ $this->assertInstanceOf(
+ ResultError::class,
+ $this->opcacheExcludePaths->validate()
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function validatePhpIniWrongConfigurationDataProvider(): array
+ {
+ return [
+ ['phpIni' => false],
+ ['phpIni' => ['opcache.blacklist_filename' => '/tmp/some.file']],
+ ['phpIni' => ['some.config' => 'some.value']],
+ ];
+ }
+
+ /**
+ * @return void
+ * @throws \Magento\MagentoCloud\Config\ValidatorException
+ */
+ public function testValidateMissedPaths(): void
+ {
+ $phpIniPath = '/app/php.ini';
+ $excludeListPath = '/app/op-exclude.txt';
+ $phpIni = ['opcache.blacklist_filename' => $excludeListPath];
+ $excludeList = <<fileListMock->expects($this->once())
+ ->method('getPhpIni')
+ ->willReturn($phpIniPath);
+ $this->fileListMock->expects($this->once())
+ ->method('getOpCacheExcludeList')
+ ->willReturn($excludeListPath);
+ $this->fileMock->expects($this->exactly(2))
+ ->method('isExists')
+ ->withConsecutive([$phpIniPath], [$excludeListPath])
+ ->willReturn(true);
+ $this->fileMock->expects($this->once())
+ ->method('parseIni')
+ ->with($phpIniPath)
+ ->willReturn($phpIni);
+ $this->fileMock->expects($this->once())
+ ->method('fileGetContents')
+ ->with($excludeListPath)
+ ->willReturn($excludeList);
+ $this->resultFactoryMock->expects($this->once())
+ ->method('error')
+ ->with(
+ 'File op-exclude.txt does not contain required paths to exclude for OPCache',
+ 'Check if your op-exclude.txt contains the next paths:' . PHP_EOL
+ . '/app/*/app/etc/config.php'. PHP_EOL .'/app/*/app/etc/env.php',
+ AppError::WARN_WRONG_OPCACHE_CONFIG
+ )
+ ->willReturn($this->createMock(ResultError::class));
+
+ $this->assertInstanceOf(
+ ResultError::class,
+ $this->opcacheExcludePaths->validate()
+ );
+ }
+}
diff --git a/src/Test/Unit/Filesystem/ConfigFileListTest.php b/src/Test/Unit/Filesystem/ConfigFileListTest.php
index 9b18e96fb3..16157ef4d6 100644
--- a/src/Test/Unit/Filesystem/ConfigFileListTest.php
+++ b/src/Test/Unit/Filesystem/ConfigFileListTest.php
@@ -72,4 +72,14 @@ public function testGetErrorReportConfig(): void
{
$this->assertSame('magento_root/pub/errors/local.xml', $this->configFileList->getErrorReportConfig());
}
+
+ public function testGetPhpIni(): void
+ {
+ $this->assertSame('magento_root/php.ini', $this->configFileList->getPhpIni());
+ }
+
+ public function testGetOpCacheExcludeList(): void
+ {
+ $this->assertSame('magento_root/op-exclude.txt', $this->configFileList->getOpCacheExcludeList());
+ }
}
From 2dc9d94e805927e8fe2de11fb403b6f746b63a2c Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 24 Oct 2022 17:50:24 -0500
Subject: [PATCH 04/25] MCLOUD-9461: Increase magento-cloud-patches composer
constraint in ECE-tools (#100)
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 7de06cbd9f..b8ace33ff8 100755
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
"illuminate/config": "^5.5||^8.77",
"magento/magento-cloud-components": "^1.0.8",
"magento/magento-cloud-docker": "^1.0.0",
- "magento/magento-cloud-patches": "^1.0.11",
+ "magento/magento-cloud-patches": "^1.0.20",
"magento/quality-patches": "^1.1.0",
"monolog/monolog": "^1.25 || ^2.3",
"nesbot/carbon": "^1.0 || ^2.0",
From 15f70001be806ffb96ab401fc9bfaabca37655b9 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 24 Oct 2022 17:57:21 -0500
Subject: [PATCH 05/25] Bump ece-tools version - 2002.1.13 (#105)
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index b8ace33ff8..084403ef6b 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "magento/ece-tools",
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
"type": "magento2-component",
- "version": "2002.1.12",
+ "version": "2002.1.13",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {
From 31ac87608ede36e98c635f94b9a1329fbcee88d8 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 28 Nov 2022 16:09:51 -0600
Subject: [PATCH 06/25] MCLOUD-9683: Update Code of Conduct on public Cloud
repos
---
.github/CODE_OF_CONDUCT.md | 71 +++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 21 deletions(-)
diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
index 4e82725a7f..5eb057af36 100644
--- a/.github/CODE_OF_CONDUCT.md
+++ b/.github/CODE_OF_CONDUCT.md
@@ -1,46 +1,75 @@
-# Contributor Covenant Code of Conduct
+# Magento Code of Conduct
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+We as members, contributors, and leaders pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
-Examples of behavior that contributes to creating a positive environment include:
+Examples of behavior that contribute to a positive environment for our project and community include:
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+* Focusing on what is best, not just for us as individuals but for the overall community
-Examples of unacceptable behavior by participants include:
+Examples of unacceptable behavior include:
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
+* The use of sexualized language or imagery, and sexual attention or advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Publishing others’ private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+This Code of Conduct applies when an individual is representing the project or its community both within project spaces and in public spaces. Examples of representing a project or community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by first contacting the project team at engcom@adobe.com. Oversight of Adobe projects is handled by the Adobe Open Source Office, which has final say in any violations and enforcement of this Code of Conduct and can be reached at Grp-opensourceoffice@adobe.com. All complaints will be reviewed and investigated promptly and fairly.
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+The project team must respect the privacy and security of the reporter of any incident.
-## Attribution
+Project maintainers who do not follow or enforce the Code of Conduct may face temporary or permanent repercussions as determined by other members of the project's leadership or the Adobe Open Source Office.
+
+## Enforcement Guidelines
+
+Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem to be in violation of this Code of Conduct:
+
+**1. Correction**
+
+Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
+
+Consequence: A private, written warning from project maintainers describing the violation and why the behavior was unacceptable. A public apology may be requested from the violator before any further involvement in the project by violator.
+
+**2. Warning**
+
+Community Impact: A relatively minor violation through a single incident or series of actions.
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+Consequence: A written warning from project maintainers that includes stated consequences for continued unacceptable behavior. Violator must refrain from interacting with the people involved for a specified period of time as determined by the project maintainers, including, but not limited to, unsolicited interaction with those enforcing the Code of Conduct through channels such as community spaces and social media. Continued violations may lead to a temporary or permanent ban.
+
+**3. Temporary Ban**
+
+Community Impact: A more serious violation of community standards, including sustained unacceptable behavior.
+
+Consequence: A temporary ban from any interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Failure to comply with the temporary ban may lead to a permanent ban.
+
+**4. Permanent Ban**
+
+Community Impact: Demonstrating a consistent pattern of violation of community standards or an egregious violation of community standards, including, but not limited to, sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
+
+Consequence: A permanent ban from any interaction with the community.
+
+## Attribution
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
From 473071d5798718f03026043f6b054b484f968723 Mon Sep 17 00:00:00 2001
From: Michael Casey <12436335+michaelcasey316@users.noreply.github.com>
Date: Wed, 14 Dec 2022 12:31:33 -0600
Subject: [PATCH 07/25] MCLOUD-9749: Update service version requirements for
the release (#108)
---
src/Service/Validator.php | 31 ++++---
src/Test/Unit/Service/ValidatorTest.php | 113 +++++++++++++++++++++++-
2 files changed, 129 insertions(+), 15 deletions(-)
diff --git a/src/Service/Validator.php b/src/Service/Validator.php
index d9e41ae077..9ba879d8a0 100644
--- a/src/Service/Validator.php
+++ b/src/Service/Validator.php
@@ -20,7 +20,7 @@ class Validator
* Supported version constraints of Redis services
*/
private const REDIS_SUPPORT_VERSIONS = [
- '*' => '~3.2.0 || ~4.0.0 || ~5.0.0 || ~6.0.0 || ~6.2.0',
+ '*' => '~3.2.0 || ~4.0.0 || ~5.0.0 || ~6.0.0 || ~6.2.0 || ~7.0.0',
];
/**
@@ -34,18 +34,23 @@ class Validator
'>=2.2.5 <2.2.10' => '>=7.0 <7.2', //'~7.0.13|~7.1.0',
'>=2.2.10 <2.3.0' => '>=7.1 <7.3', //'~7.1.0|~7.2.0',
'>=2.3.0 <2.3.3' => '>=7.1 <7.3', //'~7.1.3 || ~7.2.0',
- '>=2.3.3 <2.4.0' => '>=7.1 <7.4', // '~7.1.3||~7.2.0||~7.3.0'
- '>=2.4.0' => '>=7.3 <7.5', // '~7.3.0||~7.4.0'
+ '>=2.3.3 <2.3.7-p4' => '>=7.1 <7.4', // '~7.1.3||~7.2.0||~7.3.0'
+ '>=2.4.0 <2.4.4 || ~2.3.7-p4' => '>=7.3 <7.5', // '~7.3.0||~7.4.0'
+ '>=2.4.4 <2.4.6' => '>=8.1 <8.2', // '~8.1.0'
+ '>=2.4.6' => '>=8.1 <8.3', // '~8.1.0 || ~8.2.0'
],
ServiceInterface::NAME_DB_MARIA => [
'<2.3.6-p1' => '>=10.0 <10.3',
'>=2.3.6-p1 <2.4.0' => '>=10.0 <10.4',
- '>=2.4.0' => '>=10.2 <10.5',
+ '>=2.4.0 <2.4.6' => '>=10.2 <10.5',
+ '>=2.4.6' => '>=10.6 <10.7',
+
],
ServiceInterface::NAME_DB_MYSQL => [
'<2.3.0' => '~5.6.0 || ~5.7.0',
'>=2.3.0 <2.4.0' => '~5.7.0',
- '>=2.4.0' => '~5.7.0 || ~8.0.0',
+ '>=2.4.0 <2.4.1' => '~5.7.0 || ~8.0.0',
+ '>=2.4.1' => '~8.0.0',
],
ServiceInterface::NAME_DB_AURORA => [
'<2.3.0' => '~1.0.0 || ~2.0.0',
@@ -57,7 +62,9 @@ class Validator
ServiceInterface::NAME_VARNISH => [
'<2.2.0' => '~3.5.0 || ^4.0',
'>=2.2.0 <2.3.3' => '^4.0 || ^5.0',
- '>=2.3.3' => '^4.0 || ^5.0 || ^6.2',
+ '>=2.3.3 <2.4.4' => '^4.0 || ^5.0 || ^6.2',
+ '>=2.4.4 <2.4.6' => '~7.0.0',
+ '>=2.4.6' => '~7.1.1',
],
ServiceInterface::NAME_REDIS => self::REDIS_SUPPORT_VERSIONS,
ServiceInterface::NAME_REDIS_SESSION => self::REDIS_SUPPORT_VERSIONS,
@@ -72,15 +79,17 @@ class Validator
' || ~7.9.0 || ~7.10.0',
'>=2.4.0 <2.4.2' => '~7.5.0 || ~7.6.0 || ~7.7.0',
'>=2.4.2 <2.4.3' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0',
- '>=2.4.3' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0 || ~7.10.0',
+ '>=2.4.3 <2.4.4' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0 || ~7.10.0',
+ '>=2.4.4' => '~7.10.0', // Greater than 7.10 isn't supported on cloud infrastructure.
],
ServiceInterface::NAME_OPENSEARCH => [
- '>=2.3.7-p3 <2.4.0 || >=2.4.3-p2' => '~1.1 || ~1.2.1',
+ '>=2.3.7-p3 <2.4.0 || >=2.4.3-p2 <2.4.6' => '~1.1.0 || ~1.2.1',
+ '>=2.4.6' => '~2.3.0',
],
ServiceInterface::NAME_RABBITMQ => [
'<2.3.0' => '~3.5.0',
- '>=2.3.0 <2.4.4' => '~3.5.0 || ~3.7.0 || ~3.8.0',
- '>=2.4.4' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0',
+ '>=2.3.0 <2.3.7-p4 || >=2.4.0 <2.4.3-p3' => '~3.5.0 || ~3.7.0 || ~3.8.0',
+ '>=2.4.4 || ~2.4.3-p3 || ~2.3.7-p4' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0',
],
ServiceInterface::NAME_NODE => [
'*' => '^6 || ^8 || ^10 || ^11',
@@ -121,7 +130,7 @@ public function __construct(MagentoVersion $magentoVersion)
* ];
* ```
*
- * @param array $serviceVersions List of services and their names which should be validates.
+ * @param array $serviceVersions List of services and their names which should be validated.
* @return array List of warning messages. One message for one unsupported service.
*
* @throws ServiceMismatchException
diff --git a/src/Test/Unit/Service/ValidatorTest.php b/src/Test/Unit/Service/ValidatorTest.php
index 1ed6071731..6e2113cc31 100644
--- a/src/Test/Unit/Service/ValidatorTest.php
+++ b/src/Test/Unit/Service/ValidatorTest.php
@@ -147,9 +147,9 @@ public function validateVersionsDataProvider(): array
'2.5.0',
[
ServiceInterface::NAME_PHP => '7.2.13', // wrong
- ServiceInterface::NAME_DB_MARIA => '10.2.1',
+ ServiceInterface::NAME_DB_MARIA => '10.6.1',
ServiceInterface::NAME_NGINX => '1.9',
- ServiceInterface::NAME_VARNISH => '5.5',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
ServiceInterface::NAME_REDIS => 'latest',
ServiceInterface::NAME_ELASTICSEARCH => '6.7', // wrong
ServiceInterface::NAME_RABBITMQ => '3.7'
@@ -205,7 +205,7 @@ public function validateVersionsDataProvider(): array
[
'2.4.1',
[
- ServiceInterface::NAME_DB_MYSQL => '5.7',
+ ServiceInterface::NAME_DB_MYSQL => '8.0.2',
],
0
],
@@ -301,6 +301,19 @@ public function validateVersionsDataProvider(): array
],
0
],
+ [
+ '2.3.7-p4',
+ [
+ ServiceInterface::NAME_PHP => '7.4.0',
+ ServiceInterface::NAME_DB_MARIA => '10.3.35',
+ ServiceInterface::NAME_NGINX => '1.18.0',
+ ServiceInterface::NAME_VARNISH => '6.5.1',
+ ServiceInterface::NAME_REDIS => '6.0.12',
+ ServiceInterface::NAME_OPENSEARCH => '1.2.1',
+ ServiceInterface::NAME_RABBITMQ => '3.9.0'
+ ],
+ 0
+ ],
[
'2.3.7-p3',
[
@@ -311,7 +324,7 @@ public function validateVersionsDataProvider(): array
[
'2.4.0',
[
- ServiceInterface::NAME_OPENSEARCH => '1.2.2' //wrong
+ ServiceInterface::NAME_OPENSEARCH => '1.2.1' //wrong
],
1
],
@@ -322,6 +335,13 @@ public function validateVersionsDataProvider(): array
],
0
],
+ [
+ '2.4.3',
+ [
+ ServiceInterface::NAME_OPENSEARCH => '1.2.2' //wrong
+ ],
+ 1
+ ],
[
'2.4.4',
[
@@ -381,6 +401,91 @@ public function validateVersionsDataProvider(): array
],
0
],
+ [
+ '2.4.3-p3',
+ [
+ ServiceInterface::NAME_PHP => '7.4.0',
+ ServiceInterface::NAME_DB_MARIA => '10.4.14',
+ ServiceInterface::NAME_NGINX => '1.18.0',
+ ServiceInterface::NAME_VARNISH => '6.5.1',
+ ServiceInterface::NAME_REDIS => '6.0.12',
+ ServiceInterface::NAME_OPENSEARCH => '1.2.1',
+ ServiceInterface::NAME_RABBITMQ => '3.8.0'
+ ],
+ 0
+ ],
+ [
+ '2.4.3-p3',
+ [
+ ServiceInterface::NAME_RABBITMQ => '3.9.0'
+ ],
+ 0
+ ],
+ [
+ '2.4.4-p1',
+ [
+ ServiceInterface::NAME_PHP => '8.1.0',
+ ServiceInterface::NAME_DB_MARIA => '10.4.22',
+ ServiceInterface::NAME_NGINX => '1.18.0',
+ ServiceInterface::NAME_VARNISH => '7.0.0',
+ ServiceInterface::NAME_REDIS => '6.2.6',
+ ServiceInterface::NAME_OPENSEARCH => '1.2.1',
+ ServiceInterface::NAME_RABBITMQ => '3.9.0'
+ ],
+ 0
+ ],
+ [
+ '2.4.5',
+ [
+ ServiceInterface::NAME_ELASTICSEARCH => '7.10'
+ ],
+ 0
+ ],
+ [
+ '2.4.5',
+ [
+ ServiceInterface::NAME_PHP => '8.0.0', //wrong
+ ServiceInterface::NAME_ELASTICSEARCH => '7.11.0', //wrong
+ ServiceInterface::NAME_DB_MARIA => '10.5.0', //wrong
+ ServiceInterface::NAME_VARNISH => '7.1.0', //wrong
+ ServiceInterface::NAME_REDIS => '6.1.3', //wrong
+ ServiceInterface::NAME_OPENSEARCH => '1.2.0', //wrong
+ ServiceInterface::NAME_RABBITMQ => '3.8.1' //wrong
+ ],
+ 6
+ ],
+ [
+ '2.4.5',
+ [
+ ServiceInterface::NAME_PHP => '8.1.0',
+ ServiceInterface::NAME_DB_MARIA => '10.4.22',
+ ServiceInterface::NAME_NGINX => '1.18.0',
+ ServiceInterface::NAME_VARNISH => '7.0.0',
+ ServiceInterface::NAME_REDIS => '6.2.6',
+ ServiceInterface::NAME_OPENSEARCH => '1.2.1',
+ ServiceInterface::NAME_RABBITMQ => '3.9.0'
+ ],
+ 0
+ ],
+ [
+ '2.4.6',
+ [
+ ServiceInterface::NAME_ELASTICSEARCH => '7.11' //wrong
+ ],
+ 1
+ ],
+ [
+ '2.4.6',
+ [
+ ServiceInterface::NAME_PHP => '8.2.0',
+ ServiceInterface::NAME_DB_MARIA => '10.6.0',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
+ ServiceInterface::NAME_REDIS => '7.0.0',
+ ServiceInterface::NAME_OPENSEARCH => '2.3.0',
+ ServiceInterface::NAME_RABBITMQ => '3.9.0'
+ ],
+ 0
+ ],
];
}
}
From 8bd68c3b3a8be1dbffa0b49a9128e41e98879d23 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Wed, 1 Mar 2023 14:39:28 -0600
Subject: [PATCH 08/25] MCLOUD-9902: Add FT to Magento Cloud Tools for PHP 8.2
& Magento 2.4.6 (#109)
---
.../Acceptance/Acceptance81Cest.php | 26 ++
.../Acceptance/AcceptanceCe81Cest.php | 26 ++
.../Acceptance/AcceptanceCeCest.php | 5 +-
.../Functional/Acceptance/AcceptanceCest.php | 10 +-
.../Acceptance/AdminCredential81Cest.php | 20 ++
.../Acceptance/AdminCredentialCest.php | 4 +-
.../Functional/Acceptance/BackupDb244Cest.php | 30 +++
.../Functional/Acceptance/BackupDbCest.php | 4 +-
.../Functional/Acceptance/Cron244Cest.php | 32 +++
src/Test/Functional/Acceptance/CronCest.php | 4 +-
.../Functional/Acceptance/CronUnlockCest.php | 4 +-
.../DataTypesOptionValidationCest.php | 4 +-
.../Acceptance/DatabaseConfigurationCest.php | 6 +-
.../Acceptance/ErrorCodes244Cest.php | 24 ++
.../Functional/Acceptance/ErrorCodesCest.php | 4 +-
.../Acceptance/ErrorMessageCest.php | 4 +-
.../Functional/Acceptance/PostDeployCest.php | 6 +-
.../Functional/Acceptance/Redis81Cest.php | 253 ++++++++++++++++++
src/Test/Functional/Acceptance/RedisCest.php | 10 +-
.../Acceptance/ReportDirNestingLevelCest.php | 4 +-
.../Functional/Acceptance/ScdMatrixCest.php | 4 +-
.../Functional/Acceptance/ScdStrategyCest.php | 4 +-
.../Acceptance/ScenarioExtensibilityCest.php | 4 +-
.../Acceptance/SessionConfigurationCest.php | 4 +-
.../Functional/Acceptance/WizardScdCest.php | 4 +-
25 files changed, 453 insertions(+), 47 deletions(-)
create mode 100644 src/Test/Functional/Acceptance/Acceptance81Cest.php
create mode 100644 src/Test/Functional/Acceptance/AcceptanceCe81Cest.php
create mode 100644 src/Test/Functional/Acceptance/AdminCredential81Cest.php
create mode 100644 src/Test/Functional/Acceptance/BackupDb244Cest.php
create mode 100644 src/Test/Functional/Acceptance/Cron244Cest.php
create mode 100644 src/Test/Functional/Acceptance/ErrorCodes244Cest.php
create mode 100644 src/Test/Functional/Acceptance/Redis81Cest.php
diff --git a/src/Test/Functional/Acceptance/Acceptance81Cest.php b/src/Test/Functional/Acceptance/Acceptance81Cest.php
new file mode 100644
index 0000000000..e22d17f64f
--- /dev/null
+++ b/src/Test/Functional/Acceptance/Acceptance81Cest.php
@@ -0,0 +1,26 @@
+ [
'provider' => 'db',
- 'config' => [
- 'prefix' => null,
- ],
],
],
],
@@ -182,9 +179,6 @@ protected function defaultDataProvider(): array
],
'lock' => [
'provider' => 'db',
- 'config' => [
- 'prefix' => null,
- ],
],
],
],
diff --git a/src/Test/Functional/Acceptance/AdminCredential81Cest.php b/src/Test/Functional/Acceptance/AdminCredential81Cest.php
new file mode 100644
index 0000000000..6dc0768ec0
--- /dev/null
+++ b/src/Test/Functional/Acceptance/AdminCredential81Cest.php
@@ -0,0 +1,20 @@
+ '2.4.4'],
+ ];
+ }
+}
diff --git a/src/Test/Functional/Acceptance/BackupDbCest.php b/src/Test/Functional/Acceptance/BackupDbCest.php
index 2fee12d2f8..c16afeacca 100644
--- a/src/Test/Functional/Acceptance/BackupDbCest.php
+++ b/src/Test/Functional/Acceptance/BackupDbCest.php
@@ -14,7 +14,7 @@
/**
* Checks database backup functionality
- * @group php81
+ * @group php82
*/
class BackupDbCest extends AbstractCest
{
@@ -68,7 +68,7 @@ public function testBackUpDb(CliTester $I, Example $data): void
protected function dataProviderMagentoCloudVersions(): array
{
return [
- ['version' => '2.4.4'],
+ ['version' => '2.4.6'],
];
}
diff --git a/src/Test/Functional/Acceptance/Cron244Cest.php b/src/Test/Functional/Acceptance/Cron244Cest.php
new file mode 100644
index 0000000000..e4fc13c2c6
--- /dev/null
+++ b/src/Test/Functional/Acceptance/Cron244Cest.php
@@ -0,0 +1,32 @@
+ '2.4.4',
+ 'variables' => [
+ 'MAGENTO_CLOUD_VARIABLES' => [
+ 'ADMIN_EMAIL' => 'admin@example.com',
+ 'ADMIN_LOCALE' => 'fr_FR'
+ ],
+ ],
+ ],
+ ];
+ }
+}
diff --git a/src/Test/Functional/Acceptance/CronCest.php b/src/Test/Functional/Acceptance/CronCest.php
index 8d5ef42f1e..9f7972c580 100644
--- a/src/Test/Functional/Acceptance/CronCest.php
+++ b/src/Test/Functional/Acceptance/CronCest.php
@@ -10,7 +10,7 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class CronCest extends AbstractCest
{
@@ -138,7 +138,7 @@ protected function cronDataProvider(): array
{
return [
[
- 'version' => '2.4.4',
+ 'version' => '2.4.6',
'variables' => [
'MAGENTO_CLOUD_VARIABLES' => [
'ADMIN_EMAIL' => 'admin@example.com',
diff --git a/src/Test/Functional/Acceptance/CronUnlockCest.php b/src/Test/Functional/Acceptance/CronUnlockCest.php
index 5f0ec269d8..49092d35f6 100644
--- a/src/Test/Functional/Acceptance/CronUnlockCest.php
+++ b/src/Test/Functional/Acceptance/CronUnlockCest.php
@@ -10,14 +10,14 @@
/**
* Test for cron:unlock.
*
- * @group php81
+ * @group php82
*/
class CronUnlockCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/DataTypesOptionValidationCest.php b/src/Test/Functional/Acceptance/DataTypesOptionValidationCest.php
index 2f851b72b8..943e29fb20 100644
--- a/src/Test/Functional/Acceptance/DataTypesOptionValidationCest.php
+++ b/src/Test/Functional/Acceptance/DataTypesOptionValidationCest.php
@@ -10,14 +10,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class DataTypesOptionValidationCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/DatabaseConfigurationCest.php b/src/Test/Functional/Acceptance/DatabaseConfigurationCest.php
index a93e385ae5..76374dd5ce 100644
--- a/src/Test/Functional/Acceptance/DatabaseConfigurationCest.php
+++ b/src/Test/Functional/Acceptance/DatabaseConfigurationCest.php
@@ -12,14 +12,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class DatabaseConfigurationCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
@@ -139,7 +139,7 @@ public function installAndRedeployWithTablePrefix(\CliTester $I)
public function customDataBaseConfigurationMagentoEnvYaml(\CliTester $I)
{
$I->copyFileToWorkDir('files/custom_db_configuration/.magento.env.yaml', '.magento.env.yaml');
- $I->runEceDockerCommand('build:compose --mode=production');
+ $I->generateDockerCompose('--mode=production');
$I->assertTrue($I->runDockerComposeCommand('run build cloud-build'));
$I->assertTrue($I->startEnvironment());
$I->assertTrue(
diff --git a/src/Test/Functional/Acceptance/ErrorCodes244Cest.php b/src/Test/Functional/Acceptance/ErrorCodes244Cest.php
new file mode 100644
index 0000000000..de18763467
--- /dev/null
+++ b/src/Test/Functional/Acceptance/ErrorCodes244Cest.php
@@ -0,0 +1,24 @@
+runEceDockerCommand('build:compose --mode=production');
+ $I->generateDockerCompose('--mode=production');
$I->copyFileToWorkDir('files/wrong_db_configuration/.magento.env.yaml', '.magento.env.yaml');
$I->runDockerComposeCommand('run build cloud-build');
diff --git a/src/Test/Functional/Acceptance/Redis81Cest.php b/src/Test/Functional/Acceptance/Redis81Cest.php
new file mode 100644
index 0000000000..05b57670eb
--- /dev/null
+++ b/src/Test/Functional/Acceptance/Redis81Cest.php
@@ -0,0 +1,253 @@
+assertTrue($I->downloadFromContainer('/app/etc/env.php', $destination, Docker::DEPLOY_CONTAINER));
+ return require $destination;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @throws \Robo\Exception\TaskException
+ * @dataProvider defaultConfigurationDataProvider
+ */
+ public function testDefaultConfiguration(\CliTester $I, \Codeception\Example $data): void
+ {
+ $this->prepareWorkplace($I, $data['version']);
+ $I->generateDockerCompose(sprintf(
+ '--mode=production --expose-db-port=%s',
+ $I->getExposedPort()
+ ));
+
+ $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase was failed');
+ $I->assertTrue($I->startEnvironment(), 'Docker could not start');
+ $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase was failed');
+ $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post Deploy phase was failed');
+
+ $config = $this->getConfig($I);
+
+ $I->assertSame(
+ 'Cm_Cache_Backend_Redis',
+ $config['cache']['frontend']['default']['backend'],
+ 'Wrong backend model'
+ );
+ $this->checkArraySubset(
+ [
+ 'backend_options' => [
+ 'server' => 'redis',
+ 'port' => '6379',
+ 'database' => 1,
+ ]
+ ],
+ $config['cache']['frontend']['default'],
+ $I
+ );
+ $I->assertSame(
+ 'Cm_Cache_Backend_Redis',
+ $config['cache']['frontend']['page_cache']['backend'],
+ 'Wrong backend model'
+ );
+ $this->checkArraySubset(
+ [
+ 'backend_options' => [
+ 'server' => 'redis',
+ 'port' => '6379',
+ 'database' => 2,
+ ]
+ ],
+ $config['cache']['frontend']['page_cache'],
+ $I
+ );
+ $I->assertArrayNotHasKey('type', $config['cache']);
+
+ $I->amOnPage('/');
+ $I->see('Home page');
+ $I->see('CMS homepage content goes here.');
+ }
+
+ /**
+ * @return array
+ */
+ protected function defaultConfigurationDataProvider(): array
+ {
+ return [
+ [
+ 'version' => '2.4.4',
+ ],
+ ];
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @throws \Robo\Exception\TaskException
+ * @dataProvider wrongConfigurationDataProvider
+ */
+ public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data): void
+ {
+ $this->prepareWorkplace($I, $data['version']);
+ $I->generateDockerCompose(sprintf(
+ '--mode=production --expose-db-port=%s',
+ $I->getExposedPort()
+ ));
+
+ $I->writeEnvMagentoYaml($data['wrongConfiguration']);
+
+ $I->assertSame($data['buildSuccess'], $I->runDockerComposeCommand('run build cloud-build'));
+ $I->seeInOutput($data['errorBuildMessage']);
+ $I->assertTrue($I->startEnvironment(), 'Docker could not start');
+ $I->assertSame($data['deploySuccess'], $I->runDockerComposeCommand('run build cloud-deploy'));
+ $I->seeInOutput($data['errorDeployMessage']);
+ }
+
+ /**
+ * @return array
+ */
+ protected function wrongConfigurationDataProvider(): array
+ {
+ return [
+ [
+ 'version' => '2.4.4',
+ 'wrongConfiguration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'REDIS_BACKEND' => 'TestRedisModel'
+ ]
+ ]
+ ],
+ 'buildSuccess' => false,
+ 'deploySuccess' => false,
+ 'errorBuildMessage' => 'The REDIS_BACKEND variable contains an invalid value TestRedisModel.'
+ . ' Use one of the available value options: Cm_Cache_Backend_Redis,'
+ . ' \Magento\Framework\Cache\Backend\Redis,'
+ . ' \Magento\Framework\Cache\Backend\RemoteSynchronizedCache.',
+ 'errorDeployMessage' => '',
+ ],
+ ];
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @throws \Robo\Exception\TaskException
+ * @dataProvider goodConfigurationDataProvider
+ */
+ public function testGoodConfiguration(\CliTester $I, \Codeception\Example $data): void
+ {
+ $this->prepareWorkplace($I, $data['version']);
+ $I->generateDockerCompose(sprintf(
+ '--mode=production --expose-db-port=%s',
+ $I->getExposedPort()
+ ));
+
+ $I->writeEnvMagentoYaml($data['backendModel']);
+
+ $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase was failed');
+ $I->assertTrue($I->startEnvironment(), 'Docker could not start');
+ $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase was failed');
+ $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy'), 'Post Deploy phase was failed');
+
+ $config = $this->getConfig($I);
+ $I->assertSame(
+ $data['expectedBackend'],
+ $config['cache']['frontend']['default']['backend'],
+ 'Wrong backend model'
+ );
+
+ $this->checkArraySubset(
+ $data['expectedConfig'],
+ $config['cache']['frontend']['default'],
+ $I
+ );
+
+ $I->amOnPage('/');
+ $I->see('Home page');
+ $I->see('CMS homepage content goes here.');
+ }
+
+ /**
+ * @return array
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
+ */
+ protected function goodConfigurationDataProvider(): array
+ {
+ return [
+ [
+ 'version' => '2.4.4',
+ 'backendModel' => [
+ 'stage' => [
+ 'deploy' => [
+ 'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\Magento\Framework\Cache\Backend\Redis',
+ 'expectedConfig' => [
+ 'backend_options' => [
+ 'server' => 'redis',
+ 'port' => '6379',
+ 'database' => 1,
+ ]
+ ],
+ ],
+ [
+ 'version' => '2.4.4',
+ 'backendModel' => [
+ 'stage' => [
+ 'deploy' => [
+ 'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
+ 'expectedConfig' => [
+ 'backend_options' => [
+ 'remote_backend' => '\Magento\Framework\Cache\Backend\Redis',
+ 'remote_backend_options' => [
+ 'persistent' => 0,
+ 'server' => 'redis',
+ 'database' => 1,
+ 'port' => '6379',
+ 'password' => '',
+ 'compress_data' => '1',
+ ],
+ 'local_backend' => 'Cm_Cache_Backend_File',
+ 'local_backend_options' => [
+ 'cache_dir' => '/dev/shm/',
+ ],
+ ],
+ ],
+ ],
+ ];
+ }
+}
diff --git a/src/Test/Functional/Acceptance/RedisCest.php b/src/Test/Functional/Acceptance/RedisCest.php
index b6ef50e2ad..f0249c7597 100644
--- a/src/Test/Functional/Acceptance/RedisCest.php
+++ b/src/Test/Functional/Acceptance/RedisCest.php
@@ -12,7 +12,7 @@
/**
* Checks Redis configuration
*
- * @group php81
+ * @group php82
*/
class RedisCest extends AbstractCest
{
@@ -102,7 +102,7 @@ protected function defaultConfigurationDataProvider(): array
{
return [
[
- 'version' => '2.4.4',
+ 'version' => '2.4.6',
],
];
}
@@ -137,7 +137,7 @@ protected function wrongConfigurationDataProvider(): array
{
return [
[
- 'version' => '2.4.4',
+ 'version' => '2.4.6',
'wrongConfiguration' => [
'stage' => [
'deploy' => [
@@ -203,7 +203,7 @@ protected function goodConfigurationDataProvider(): array
{
return [
[
- 'version' => '2.4.4',
+ 'version' => '2.4.6',
'backendModel' => [
'stage' => [
'deploy' => [
@@ -221,7 +221,7 @@ protected function goodConfigurationDataProvider(): array
],
],
[
- 'version' => '2.4.4',
+ 'version' => '2.4.6',
'backendModel' => [
'stage' => [
'deploy' => [
diff --git a/src/Test/Functional/Acceptance/ReportDirNestingLevelCest.php b/src/Test/Functional/Acceptance/ReportDirNestingLevelCest.php
index fee51bba2e..06600f2ffc 100644
--- a/src/Test/Functional/Acceptance/ReportDirNestingLevelCest.php
+++ b/src/Test/Functional/Acceptance/ReportDirNestingLevelCest.php
@@ -12,14 +12,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class ReportDirNestingLevelCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @var string
diff --git a/src/Test/Functional/Acceptance/ScdMatrixCest.php b/src/Test/Functional/Acceptance/ScdMatrixCest.php
index 4983140e6e..c228e49b4a 100644
--- a/src/Test/Functional/Acceptance/ScdMatrixCest.php
+++ b/src/Test/Functional/Acceptance/ScdMatrixCest.php
@@ -10,14 +10,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class ScdMatrixCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/ScdStrategyCest.php b/src/Test/Functional/Acceptance/ScdStrategyCest.php
index 696a40d97c..0f7e9f1a2a 100644
--- a/src/Test/Functional/Acceptance/ScdStrategyCest.php
+++ b/src/Test/Functional/Acceptance/ScdStrategyCest.php
@@ -10,14 +10,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class ScdStrategyCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/ScenarioExtensibilityCest.php b/src/Test/Functional/Acceptance/ScenarioExtensibilityCest.php
index c132dfa0b0..6de31e0dcf 100644
--- a/src/Test/Functional/Acceptance/ScenarioExtensibilityCest.php
+++ b/src/Test/Functional/Acceptance/ScenarioExtensibilityCest.php
@@ -12,14 +12,14 @@
/**
* Tests extensibility base deployment scenarios
*
- * @group php81
+ * @group php82
*/
class ScenarioExtensibilityCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/SessionConfigurationCest.php b/src/Test/Functional/Acceptance/SessionConfigurationCest.php
index 1082d80a42..31df94a3f8 100644
--- a/src/Test/Functional/Acceptance/SessionConfigurationCest.php
+++ b/src/Test/Functional/Acceptance/SessionConfigurationCest.php
@@ -11,14 +11,14 @@
* This scenario checks that session can be configured through environment variable SESSION_CONFIGURATION
* Zephyr ID MAGECLOUD-46
*
- * @group php81
+ * @group php82
*/
class SessionConfigurationCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
diff --git a/src/Test/Functional/Acceptance/WizardScdCest.php b/src/Test/Functional/Acceptance/WizardScdCest.php
index 845c8acab6..d1e4bb4504 100644
--- a/src/Test/Functional/Acceptance/WizardScdCest.php
+++ b/src/Test/Functional/Acceptance/WizardScdCest.php
@@ -10,14 +10,14 @@
/**
* This test runs on the latest version of PHP
*
- * @group php81
+ * @group php82
*/
class WizardScdCest extends AbstractCest
{
/**
* @var string
*/
- protected $magentoCloudTemplate = '2.4.4';
+ protected $magentoCloudTemplate = '2.4.6';
/**
* @param \CliTester $I
From eed2a6b14859cd67c8fcb4ff2625a652ea0674a8 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Fri, 3 Mar 2023 15:22:02 -0600
Subject: [PATCH 09/25] MCLOUD-10075: Fix validator for OpenSearch
---
src/Service/Validator.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Service/Validator.php b/src/Service/Validator.php
index 9ba879d8a0..d3fcd3acee 100644
--- a/src/Service/Validator.php
+++ b/src/Service/Validator.php
@@ -84,7 +84,7 @@ class Validator
],
ServiceInterface::NAME_OPENSEARCH => [
'>=2.3.7-p3 <2.4.0 || >=2.4.3-p2 <2.4.6' => '~1.1.0 || ~1.2.1',
- '>=2.4.6' => '~2.3.0',
+ '>=2.4.6' => '^2',
],
ServiceInterface::NAME_RABBITMQ => [
'<2.3.0' => '~3.5.0',
From b4fd0b9a99c9b00aaf71b7f2bcc582cf14cae9eb Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Sat, 4 Mar 2023 23:31:10 -0600
Subject: [PATCH 10/25] MCLOUD-8945: Incorrect rm -rf command is executed when
backup is removed
---
src/DB/DumpGenerator.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/DB/DumpGenerator.php b/src/DB/DumpGenerator.php
index ec40f33107..e11e952420 100644
--- a/src/DB/DumpGenerator.php
+++ b/src/DB/DumpGenerator.php
@@ -142,7 +142,7 @@ public function create(
flock($lockFileHandle, LOCK_UN);
} catch (ShellException $exception) {
if (file_exists($dumpFile)) {
- $this->shell->execute('rm -rf' . $dumpFile);
+ $this->shell->execute('rm -rf ' . $dumpFile);
}
throw $exception;
} finally {
From e1972ad922663889aa85fc72ca946c3135bb6fe1 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 6 Mar 2023 14:25:44 -0600
Subject: [PATCH 11/25] Bump version 2002.1.14 (#111)
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 084403ef6b..944f219af2 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "magento/ece-tools",
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
"type": "magento2-component",
- "version": "2002.1.13",
+ "version": "2002.1.14",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {
From a8ce88621217ea9ce5cc0997532e098fe6702b02 Mon Sep 17 00:00:00 2001
From: Heather Guthrie
Date: Wed, 5 Apr 2023 11:59:43 -0500
Subject: [PATCH 12/25] MAGECLOUD-9766 update error code schema
---
config/schema.error.yaml | 68 ++++++++++++-------------
config/schema.yaml | 8 +--
src/Command/DbDump.php | 2 +-
src/Command/Dev/GenerateSchemaError.php | 1 -
4 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/config/schema.error.yaml b/config/schema.error.yaml
index 6c0cd68bc0..2e57576a24 100644
--- a/config/schema.error.yaml
+++ b/config/schema.error.yaml
@@ -1,12 +1,12 @@
# Critical errors
!php/const Magento\MagentoCloud\App\Error::BUILD_ENV_PHP_IS_NOT_WRITABLE:
- title: 'Cannot write to the `./app/etc/env.php` file'
- suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
+ title: 'Can not write to the `./app/etc/env.php` file'
+ suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_NOT_DEFINED:
- title: 'Configuration isn''t defined in the `schema.yaml` file'
- suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
+ title: 'Configuration is not defined in the `schema.yaml` file'
+ suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct and defined.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_PARSE_FAILED:
@@ -26,32 +26,32 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_PHP_IS_NOT_WRITABLE:
step: refresh-modules
- title: 'Cannot write to the `./app/etc/config.php` file'
- suggestion: 'The deployment script cannot make required changes to the `/app/etc/config.php` file. Check your filesystem permissions.'
+ title: 'Can not write to the `./app/etc/config.php` file'
+ suggestion: 'The deployment script can not make required changes to the `/app/etc/config.php` file. Check your filesystem permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CANT_READ_COMPOSER_JSON:
step: validate-config
- title: 'Cannot read the `composer.json` file'
+ title: 'Can not read the `composer.json` file'
suggestion: 'Unable to read the `./composer.json` file. Check file permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_MISSED_REQUIRED_AUTOLOAD:
step: validate-config
- title: 'Composer.json is missing required autoload section'
+ title: 'The `composer.json` file is missing required autoload section'
suggestion: 'Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Cloud template, and add the missing configuration.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_WRONG_CONFIGURATION_MAGENTO_ENV_YAML:
step: validate-config
- title: 'The file `.magento.env.yaml` contains an option that is not declared in the schema, or an option configured with an invalid value or stage'
+ title: 'The `.magento.env.yaml` file contains an option that is not declared in the schema, or an option configured with an invalid value or stage'
suggestion: 'The `./.magento.env.yaml` file contains invalid configuration. Check the error log for detailed info.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_MODULE_ENABLE_COMMAND_FAILED:
step: refresh-modules
title: 'Command failed: `/bin/magento module:enable --all`'
- suggestion: 'Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: ''-vvv''` option to the `.magento.env.yaml` file.'
+ suggestion: 'Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also, check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: ''-vvv''` option to the `.magento.env.yaml` file.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_PATCH_APPLYING_FAILED:
@@ -62,7 +62,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_FILE_LOCAL_XML_IS_NOT_WRITABLE:
step: set-report-dir-nesting-level
- title: 'Cannot write to the file `/pub/errors/local.xml`'
+ title: 'Can not write to the file `/pub/errors/local.xml`'
suggestion: ''
stage: build
type: critical
@@ -92,7 +92,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_UTILITY_NOT_FOUND:
step: compress-static-content
- title: 'Required utility wasn''t found (timeout, bash)'
+ title: 'Required utility was not found (timeout, bash)'
suggestion: ''
stage: build
type: critical
@@ -132,7 +132,7 @@
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_PACKAGE_NOT_FOUND:
- title: 'Cannot find the Composer package'
+ title: 'Can not find the Composer package'
suggestion: 'If you installed the Adobe Commerce application version directly from the GitHub repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured.'
stage: build
type: critical
@@ -149,12 +149,12 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ENV_PHP_IS_NOT_WRITABLE:
- title: 'Cannot write to the `./app/etc/env.php` file'
- suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
+ title: 'Can not write to the `./app/etc/env.php` file'
+ suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_CONFIG_NOT_DEFINED:
- title: 'Configuration isn''t defined in the `schema.yaml` file'
+ title: 'Configuration is not defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
stage: deploy
type: critical
@@ -175,7 +175,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_REDIS_CACHE_CLEAN_FAILED:
title: 'Failed to clean the Redis cache'
- suggestion: 'Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://devdocs.magento.com/cloud/project/services-redis.html).'
+ suggestion: 'Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/service/redis.html).'
step: 'pre-deploy: clean-redis-cache'
stage: deploy
type: critical
@@ -239,7 +239,7 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_UTILITY_NOT_FOUND:
- title: 'Required utility wasn''t found (timeout, bash)'
+ title: 'Required utility was not found (timeout, bash)'
suggestion: ''
stage: deploy
type: critical
@@ -257,8 +257,8 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_SCD_CANNOT_UPDATE_VERSION:
step: 'deploy-static-content:generate'
- title: 'Cannot update the deployed version'
- suggestion: 'Cannot update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions.'
+ title: 'Can not update the deployed version'
+ suggestion: 'Can not update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_SCD_CLEAN_FAILED:
@@ -318,7 +318,7 @@
!php/const Magento\MagentoCloud\App\Error::DEPLOY_CRYPT_KEY_IS_ABSENT:
step: install-update
title: 'The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable'
- suggestion: "This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://devdocs.magento.com/cloud/env/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Add the Magento encryption key](https://devdocs.magento.com/cloud/setup/first-time-setup-import-import.html#encryption-key). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command .\""
+ suggestion: "This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/env/stage/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Adobe Commerce encryption key](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/develop/overview.html#gather-credentials). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command .\""
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ES_CANNOT_CONNECT:
@@ -327,8 +327,8 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_OS_CANNOT_CONNECT:
- title: 'Can not connect to the Opensearch service'
- suggestion: 'Check for valid Opensearch credentials and verify that the service is running'
+ title: 'Can not connect to the OpenSearch service'
+ suggestion: 'Check for valid OpenSearch credentials and verify that the service is running'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_BRAINTREE_VARIABLE:
@@ -345,8 +345,8 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_OS_SERVICE_NOT_INSTALLED:
step: validate-config
- title: 'Adobe Commerce and Magento Open Source 2.4.4 requires Opensearch or Elasticsearch service to be installed'
- suggestion: 'Install Opensearch service'
+ title: 'Adobe Commerce and Magento Open Source 2.4.4 requires OpenSearch or Elasticsearch service to be installed'
+ suggestion: 'Install OpenSearch service'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_SEARCH_ENGINE:
@@ -369,11 +369,11 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_ENV_PHP_IS_NOT_WRITABLE:
title: 'The `./app/etc/env.php` file is not writable'
- suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
+ suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: post-deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_CONFIG_NOT_DEFINED:
- title: 'Configuration isn''t defined in the `schema.yaml` file'
+ title: 'Configuration is not defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
stage: post-deploy
type: critical
@@ -394,7 +394,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_DURING_PAGE_WARM_UP:
step: warm-up
- title: 'Failed to warm-up some pages'
+ title: 'Failed to preload some warm-up pages'
suggestion: ''
stage: post-deploy
type: critical
@@ -472,7 +472,7 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_BALER_CANNOT_BE_USED:
- title: 'Baler JS bundling cannot be used'
+ title: 'Baler JS bundling can not be used'
stage: build
step: run-baler
type: warning
@@ -583,7 +583,7 @@
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_ENV_PHP_MISSED:
title: 'Adobe Commerce installation completed, but the `app/etc/env.php` configuration file was missing or empty.'
- suggestion: 'Required data will be restored from environment configurations and from .magento.env.yaml file.'
+ suggestion: 'Required data will be restored from environment configurations and from the .magento.env.yaml file.'
stage: deploy
step: install-update
type: warning
@@ -647,7 +647,7 @@
step: warm-up
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_CREATE_CONFIG_BACKUP_FAILED:
- title: 'Cannot create backup files'
+ title: 'Can not create backup files'
stage: post-deploy
step: backup
type: warning
@@ -656,14 +656,14 @@
type: warning
stage: general
!php/const Magento\MagentoCloud\App\Error::WARN_OS_ES_SERVICES_BOTH_INSTALLED:
- title: 'Elasticsearch and Opensearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and higher use Opensearch by default'
- suggestion: 'Consider removing the Elasticsearch or Opensearch service from the infrastructure layer to optimize resource usage.'
+ title: 'Elasticsearch and OpenSearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and later use OpenSearch by default'
+ suggestion: 'Consider removing the Elasticsearch or OpenSearch service from the infrastructure layer to optimize resource usage.'
stage: deploy
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::DEPLOY_MAGENTO_VERSION_DOES_NOT_SUPPORT_OS:
step: validate-config
title: 'Incorrect search engine'
- suggestion: 'This Adobe Commerce or Magento Open Source version does not support Opensearch. You must use versions 2.3.7-p3, 2.4.3-p2, or higher'
+ suggestion: 'This Adobe Commerce or Magento Open Source version does not support OpenSearch. You must use versions 2.3.7-p3, 2.4.3-p2, or later'
stage: deploy
type: critical
diff --git a/config/schema.yaml b/config/schema.yaml
index 1d8e3fb820..5317b4d4ff 100644
--- a/config/schema.yaml
+++ b/config/schema.yaml
@@ -57,9 +57,9 @@ variables:
build:
SCD_COMPRESSION_TIMEOUT: 900
SCD_STRATEGY:
- description: Customize the deployment strategy for static content. The value "standard" will deploy all static view
- files for all packages, "quick" will minimize deployment time, and "compact" will conserve space on the server.
- Compact is not compatible with multi-threaded deployment and will set the value of `SCD_THREADS` to 1. The default
+ description: Customize the deployment strategy for static content. The value "standard" deploys all static view
+ files for all packages, "quick" minimizes deployment time, and "compact" conserves space on the server.
+ Compact is not compatible with multi-threaded deployment and sets the value of `SCD_THREADS` to 1. The default
value is "quick".
type: string
magento_version: '>=2.2.0'
@@ -218,7 +218,7 @@ variables:
MIN_LOGGING_LEVEL:
description: Use to override the minimum logging level for all output streams without making changes to the code.
This helps to improve troubleshooting problems with deployment. For example, if your deployment fails,
- you can use this variable to increase the logging granularity globally. Doesn't affect log level for the file output.
+ you can use this variable to increase the logging granularity globally. Does not affect log level for the file output.
See Set up notifications—Log levels.
type: string
allowed:
diff --git a/src/Command/DbDump.php b/src/Command/DbDump.php
index 128b9e3d0a..d56f5cf1aa 100644
--- a/src/Command/DbDump.php
+++ b/src/Command/DbDump.php
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$questionParts = [
'The db-dump operation switches the site to maintenance mode, stops all active cron jobs ' .
- 'and consumer queue processes, and disables cron jobs before starting the the dump process.',
+ 'and consumer queue processes, and disables cron jobs before starting the dump process.',
'Your site will not receive any traffic until the operation completes.',
'Do you wish to proceed with this process? (y/N)?',
];
diff --git a/src/Command/Dev/GenerateSchemaError.php b/src/Command/Dev/GenerateSchemaError.php
index f33ba04376..22739dbab9 100644
--- a/src/Command/Dev/GenerateSchemaError.php
+++ b/src/Command/Dev/GenerateSchemaError.php
@@ -137,7 +137,6 @@ private function generateDocs(array $errors): string
foreach ($typeErrors as $stage => $stageErrors) {
$result .= sprintf("\n### %s%s\n", ucfirst($stage), $stage === 'general' ? '' : ' stage');
- $table = "\n{:.error-table}\n";
$table .= sprintf(
"| Error code | %s step | Error description (Title) | Suggested action |\n",
ucfirst($stage)
From 722d86131020772efd062f1ac1e0b332fa4a0d6b Mon Sep 17 00:00:00 2001
From: Heather Guthrie
Date: Tue, 18 Apr 2023 11:31:50 -0500
Subject: [PATCH 13/25] remove footer
---
src/Command/Dev/GenerateSchemaError.php | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/Command/Dev/GenerateSchemaError.php b/src/Command/Dev/GenerateSchemaError.php
index 22739dbab9..b1f002e0e1 100644
--- a/src/Command/Dev/GenerateSchemaError.php
+++ b/src/Command/Dev/GenerateSchemaError.php
@@ -33,28 +33,6 @@ class GenerateSchemaError extends Command
*/
private $fileList;
- /**
- * CSS style which appends in the bottom of the file
- */
- private const FOOTER_SCRIPTS = <<
-
-
-
-
-
-EOT;
-
/**
*
* @param File $file
@@ -156,7 +134,7 @@ private function generateDocs(array $errors): string
}
}
- return $result . self::FOOTER_SCRIPTS;
+ return $result;
}
/**
From 392e1427cd2d28750dca4f6c140ae0c68b424be2 Mon Sep 17 00:00:00 2001
From: Heather Guthrie
Date: Tue, 18 Apr 2023 11:37:20 -0500
Subject: [PATCH 14/25] errant operand
---
src/Command/Dev/GenerateSchemaError.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Command/Dev/GenerateSchemaError.php b/src/Command/Dev/GenerateSchemaError.php
index b1f002e0e1..c70f3047e5 100644
--- a/src/Command/Dev/GenerateSchemaError.php
+++ b/src/Command/Dev/GenerateSchemaError.php
@@ -115,7 +115,7 @@ private function generateDocs(array $errors): string
foreach ($typeErrors as $stage => $stageErrors) {
$result .= sprintf("\n### %s%s\n", ucfirst($stage), $stage === 'general' ? '' : ' stage');
- $table .= sprintf(
+ $table = sprintf(
"| Error code | %s step | Error description (Title) | Suggested action |\n",
ucfirst($stage)
);
From 80241c62f73b01c86b8ed958ef81cc2738ace250 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Fri, 14 Jul 2023 11:29:30 -0500
Subject: [PATCH 15/25] MCLOUD-10692: Improve the ece tools to be able to use
custom Redis backend model (#114)
* MCLOUD-10692: Improve the ece tools to be able to use custom Redis backend model
---
src/Step/Deploy/PreDeploy/CleanRedisCache.php | 3 +-
.../Deploy/PreDeploy/ConfigUpdate/Cache.php | 9 +-
.../Functional/Acceptance/BackupDb24Cest.php | 2 +-
.../Functional/Acceptance/Redis74Cest.php | 47 +++++++-
.../Functional/Acceptance/Redis81Cest.php | 49 ++++++++-
src/Test/Functional/Acceptance/RedisCest.php | 103 +++++++++++++++++-
.../Functional/Acceptance/RedisPhp72Cest.php | 23 +++-
.../Acceptance/RedisPhp72GoodConfigCest.php | 57 ++++++++--
.../Functional/Acceptance/RedisPhp73Cest.php | 24 +++-
.../Acceptance/RedisPhp73GoodConfigCest.php | 53 ++++++++-
.../Deploy/PreDeploy/CleanRedisCacheTest.php | 21 ++--
.../PreDeploy/ConfigUpdate/CacheTest.php | 31 ++++++
12 files changed, 384 insertions(+), 38 deletions(-)
diff --git a/src/Step/Deploy/PreDeploy/CleanRedisCache.php b/src/Step/Deploy/PreDeploy/CleanRedisCache.php
index 24b0059fab..b2f45e5e99 100644
--- a/src/Step/Deploy/PreDeploy/CleanRedisCache.php
+++ b/src/Step/Deploy/PreDeploy/CleanRedisCache.php
@@ -68,8 +68,9 @@ public function execute(): void
foreach ($cacheConfigs['frontend'] as $cacheType => $cacheConfig) {
$backend = $cacheConfig['backend'];
+ $customRedisBackend = $cacheConfig['_custom_redis_backend'] ?? false;
- if (!in_array($backend, CacheConfig::AVAILABLE_REDIS_BACKEND, true)) {
+ if (!$customRedisBackend && !in_array($backend, CacheConfig::AVAILABLE_REDIS_BACKEND, true)) {
continue;
}
diff --git a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
index 009fc4ec90..8055fbc141 100644
--- a/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
+++ b/src/Step/Deploy/PreDeploy/ConfigUpdate/Cache.php
@@ -19,6 +19,8 @@
/**
* Processes cache configuration.
+ *
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
class Cache implements StepInterface
{
@@ -81,9 +83,10 @@ public function execute()
if (isset($cacheConfig['frontend'])) {
$cacheConfig['frontend'] = array_filter($cacheConfig['frontend'], function ($cacheFrontend) {
$backend = $cacheFrontend['backend'];
+ $customRedisBackend = $cacheFrontend['_custom_redis_backend'] ?? false;
$this->checkBackendModel($backend);
- if (!in_array($backend, CacheFactory::AVAILABLE_REDIS_BACKEND, true)) {
+ if (!$customRedisBackend && !in_array($backend, CacheFactory::AVAILABLE_REDIS_BACKEND, true)) {
return true;
}
@@ -93,6 +96,10 @@ public function execute()
return $this->testRedisConnection($backendOptions);
});
+
+ foreach (array_keys($cacheConfig['frontend']) as $cacheConfigType) {
+ unset($cacheConfig['frontend'][$cacheConfigType]['_custom_redis_backend']);
+ }
}
if (empty($cacheConfig)) {
diff --git a/src/Test/Functional/Acceptance/BackupDb24Cest.php b/src/Test/Functional/Acceptance/BackupDb24Cest.php
index 5c6cae4cd9..f0a8f86ca6 100644
--- a/src/Test/Functional/Acceptance/BackupDb24Cest.php
+++ b/src/Test/Functional/Acceptance/BackupDb24Cest.php
@@ -71,7 +71,7 @@ public function testBackUpDb(CliTester $I, Example $data): void
protected function dataProviderMagentoCloudVersions(): array
{
return [
- ['version' => 'master'],
+ ['version' => '2.4.3'],
];
}
diff --git a/src/Test/Functional/Acceptance/Redis74Cest.php b/src/Test/Functional/Acceptance/Redis74Cest.php
index bfccb394df..2f728f5096 100644
--- a/src/Test/Functional/Acceptance/Redis74Cest.php
+++ b/src/Test/Functional/Acceptance/Redis74Cest.php
@@ -31,7 +31,7 @@ protected function defaultConfigurationDataProvider(): array
/**
* @return array
*/
- protected function wrongConfigurationDataProvider(): array
+ protected function wrongConfigurationRedisBackendDataProvider(): array
{
return [
[
@@ -63,7 +63,7 @@ protected function goodConfigurationDataProvider(): array
return [
[
'version' => '2.4.3',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -81,7 +81,27 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.4.3',
- 'backendModel' => [
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\CustomRedisModel',
+ 'expectedConfig' => [],
+ ],
+ [
+ 'version' => '2.4.3',
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -109,4 +129,25 @@ protected function goodConfigurationDataProvider(): array
],
];
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Functional/Acceptance/Redis81Cest.php b/src/Test/Functional/Acceptance/Redis81Cest.php
index 05b57670eb..ab582d9124 100644
--- a/src/Test/Functional/Acceptance/Redis81Cest.php
+++ b/src/Test/Functional/Acceptance/Redis81Cest.php
@@ -18,6 +18,7 @@ class Redis81Cest extends RedisCest
{
/**
* @inheritdoc
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function _before(\CliTester $I): void
{
@@ -111,7 +112,7 @@ protected function defaultConfigurationDataProvider(): array
* @param \CliTester $I
* @param \Codeception\Example $data
* @throws \Robo\Exception\TaskException
- * @dataProvider wrongConfigurationDataProvider
+ * @dataProvider wrongConfigurationRedisBackendDataProvider
*/
public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -170,7 +171,7 @@ public function testGoodConfiguration(\CliTester $I, \Codeception\Example $data)
$I->getExposedPort()
));
- $I->writeEnvMagentoYaml($data['backendModel']);
+ $I->writeEnvMagentoYaml($data['configuration']);
$I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase was failed');
$I->assertTrue($I->startEnvironment(), 'Docker could not start');
@@ -204,7 +205,7 @@ protected function goodConfigurationDataProvider(): array
return [
[
'version' => '2.4.4',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -222,7 +223,27 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.4.4',
- 'backendModel' => [
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\CustomRedisModel',
+ 'expectedConfig' => [],
+ ],
+ [
+ 'version' => '2.4.4',
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -250,4 +271,24 @@ protected function goodConfigurationDataProvider(): array
],
];
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Functional/Acceptance/RedisCest.php b/src/Test/Functional/Acceptance/RedisCest.php
index f0249c7597..c3de4d888d 100644
--- a/src/Test/Functional/Acceptance/RedisCest.php
+++ b/src/Test/Functional/Acceptance/RedisCest.php
@@ -111,9 +111,9 @@ protected function defaultConfigurationDataProvider(): array
* @param \CliTester $I
* @param \Codeception\Example $data
* @throws \Robo\Exception\TaskException
- * @dataProvider wrongConfigurationDataProvider
+ * @dataProvider wrongConfigurationRedisBackendDataProvider
*/
- public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data): void
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
{
$this->prepareWorkplace($I, $data['version']);
$I->generateDockerCompose(sprintf(
@@ -133,7 +133,7 @@ public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data
/**
* @return array
*/
- protected function wrongConfigurationDataProvider(): array
+ protected function wrongConfigurationRedisBackendDataProvider(): array
{
return [
[
@@ -156,6 +156,77 @@ protected function wrongConfigurationDataProvider(): array
];
}
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @throws \Robo\Exception\TaskException
+ * @dataProvider redisWrongConnectionDataProvider
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ $this->prepareWorkplace($I, $data['version']);
+ $I->generateDockerCompose(sprintf(
+ '--mode=production --expose-db-port=%s',
+ $I->getExposedPort()
+ ));
+
+ $I->writeEnvMagentoYaml($data['configuration']);
+
+ $I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase was failed');
+ $I->assertTrue($I->startEnvironment(), 'Docker could not start');
+ $I->assertFalse($I->runDockerComposeCommand('run deploy cloud-deploy'), 'Deploy phase was successful');
+ }
+
+ /**
+ * @return array
+ */
+ protected function redisWrongConnectionDataProvider(): array
+ {
+ return [
+ [
+ 'version' => '2.4.6',
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\Magento\Framework\Cache\Backend\Redis',
+ 'backend_options' => [
+ 'port' => 9999,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ [
+ 'version' => '2.4.6',
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ '_custom_redis_backend' => true,
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [
+ 'port' => 9999,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ];
+ }
+
/**
* @param \CliTester $I
* @param \Codeception\Example $data
@@ -170,7 +241,7 @@ public function testGoodConfiguration(\CliTester $I, \Codeception\Example $data)
$I->getExposedPort()
));
- $I->writeEnvMagentoYaml($data['backendModel']);
+ $I->writeEnvMagentoYaml($data['configuration']);
$I->assertTrue($I->runDockerComposeCommand('run build cloud-build'), 'Build phase was failed');
$I->assertTrue($I->startEnvironment(), 'Docker could not start');
@@ -204,7 +275,7 @@ protected function goodConfigurationDataProvider(): array
return [
[
'version' => '2.4.6',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -222,7 +293,27 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.4.6',
- 'backendModel' => [
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\CustomRedisModel',
+ 'expectedConfig' => [],
+ ],
+ [
+ 'version' => '2.4.6',
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
diff --git a/src/Test/Functional/Acceptance/RedisPhp72Cest.php b/src/Test/Functional/Acceptance/RedisPhp72Cest.php
index 43ad867b52..fdc1bb3d39 100644
--- a/src/Test/Functional/Acceptance/RedisPhp72Cest.php
+++ b/src/Test/Functional/Acceptance/RedisPhp72Cest.php
@@ -33,7 +33,7 @@ protected function defaultConfigurationDataProvider(): array
/**
* @return array
*/
- protected function wrongConfigurationDataProvider(): array
+ protected function wrongConfigurationRedisBackendDataProvider(): array
{
return [
[
@@ -76,11 +76,30 @@ protected function wrongConfigurationDataProvider(): array
/**
* @param \CliTester $I
* @param \Codeception\Example $data
- * @throws \Robo\Exception\TaskException
* @skip
*/
public function testGoodConfiguration(\CliTester $I, \Codeception\Example $data): void
{
return;
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Functional/Acceptance/RedisPhp72GoodConfigCest.php b/src/Test/Functional/Acceptance/RedisPhp72GoodConfigCest.php
index 611445eb93..f4e822b64e 100644
--- a/src/Test/Functional/Acceptance/RedisPhp72GoodConfigCest.php
+++ b/src/Test/Functional/Acceptance/RedisPhp72GoodConfigCest.php
@@ -16,6 +16,7 @@ class RedisPhp72GoodConfigCest extends RedisCest
* @param \CliTester $I
* @param \Codeception\Example $data
* @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testDefaultConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -27,6 +28,7 @@ public function testDefaultConfiguration(\CliTester $I, \Codeception\Example $da
* @param \Codeception\Example $data
* @throws \Robo\Exception\TaskException
* @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -42,7 +44,7 @@ protected function goodConfigurationDataProvider(): array
return [
[
'version' => '2.3.0',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => 'Cm_Cache_Backend_Redis',
@@ -60,7 +62,27 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.0',
- 'backendModel' => [
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\CustomRedisModel',
+ 'expectedConfig' => [],
+ ],
+ [
+ 'version' => '2.3.0',
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -78,7 +100,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.0',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -106,7 +128,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.1',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -124,7 +146,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.1',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -152,7 +174,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.2',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -170,7 +192,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.2',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -198,4 +220,25 @@ protected function goodConfigurationDataProvider(): array
],
];
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Functional/Acceptance/RedisPhp73Cest.php b/src/Test/Functional/Acceptance/RedisPhp73Cest.php
index 7d1730e29e..e1cbde4efd 100644
--- a/src/Test/Functional/Acceptance/RedisPhp73Cest.php
+++ b/src/Test/Functional/Acceptance/RedisPhp73Cest.php
@@ -19,6 +19,7 @@ class RedisPhp73Cest extends RedisCest
* @param \Codeception\Example $data
* @throws \Robo\Exception\TaskException
* @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testGoodConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -43,7 +44,7 @@ protected function defaultConfigurationDataProvider(): array
/**
* @return array
*/
- protected function wrongConfigurationDataProvider(): array
+ protected function wrongConfigurationRedisBackendDataProvider(): array
{
return [
[
@@ -82,4 +83,25 @@ protected function wrongConfigurationDataProvider(): array
],
];
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Functional/Acceptance/RedisPhp73GoodConfigCest.php b/src/Test/Functional/Acceptance/RedisPhp73GoodConfigCest.php
index 42637fde1d..20fec6a0df 100644
--- a/src/Test/Functional/Acceptance/RedisPhp73GoodConfigCest.php
+++ b/src/Test/Functional/Acceptance/RedisPhp73GoodConfigCest.php
@@ -16,6 +16,7 @@ class RedisPhp73GoodConfigCest extends RedisCest
* @param \CliTester $I
* @param \Codeception\Example $data
* @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testDefaultConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -27,6 +28,7 @@ public function testDefaultConfiguration(\CliTester $I, \Codeception\Example $da
* @param \Codeception\Example $data
* @throws \Robo\Exception\TaskException
* @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function testWrongConfiguration(\CliTester $I, \Codeception\Example $data): void
{
@@ -42,7 +44,7 @@ protected function goodConfigurationDataProvider(): array
return [
[
'version' => '2.3.4',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => 'Cm_Cache_Backend_Redis',
@@ -60,7 +62,27 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.4',
- 'backendModel' => [
+ 'configuration' => [
+ 'stage' => [
+ 'deploy' => [
+ 'CACHE_CONFIGURATION' => [
+ '_merge' => true,
+ 'frontend' => [
+ 'default' => [
+ 'backend' => '\CustomRedisModel',
+ 'backend_options' => [],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'expectedBackend' => '\CustomRedisModel',
+ 'expectedConfig' => [],
+ ],
+ [
+ 'version' => '2.3.4',
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -78,7 +100,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.4',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -106,7 +128,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.5',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\Redis',
@@ -124,7 +146,7 @@ protected function goodConfigurationDataProvider(): array
],
[
'version' => '2.3.5',
- 'backendModel' => [
+ 'configuration' => [
'stage' => [
'deploy' => [
'REDIS_BACKEND' => '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache',
@@ -152,4 +174,25 @@ protected function goodConfigurationDataProvider(): array
],
];
}
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function testRedisWrongConnection(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
+
+ /**
+ * @param \CliTester $I
+ * @param \Codeception\Example $data
+ * @skip
+ */
+ public function testWrongConfigurationRedisBackend(\CliTester $I, \Codeception\Example $data): void
+ {
+ return;
+ }
}
diff --git a/src/Test/Unit/Step/Deploy/PreDeploy/CleanRedisCacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/CleanRedisCacheTest.php
index 868ed78627..92c2c68d38 100644
--- a/src/Test/Unit/Step/Deploy/PreDeploy/CleanRedisCacheTest.php
+++ b/src/Test/Unit/Step/Deploy/PreDeploy/CleanRedisCacheTest.php
@@ -104,36 +104,43 @@ public function testExecute(): void
],
'some_type3' => [
'backend' => 'SomeClase',
- ]
+ ],
+ 'some_type4' => [
+ 'backend' => 'SomeClase',
+ '_custom_redis_backend' => true,
+ 'backend_options' => []
+ ],
]
]);
- $this->loggerMock->expects($this->exactly(5))
+ $this->loggerMock->expects($this->exactly(6))
->method('info')
->withConsecutive(
['Clearing redis cache: default'],
['Clearing redis cache: page_cache'],
['Clearing redis cache: some_type0'],
['Clearing redis cache: some_type1'],
- ['Clearing redis cache: some_type2']
+ ['Clearing redis cache: some_type2'],
+ ['Clearing redis cache: some_type4']
);
/** @var Credis_Client|MockObject $credisClient */
$credisClient = $this->getMockBuilder(Credis_Client::class)
->setMethods(['connect', 'flushDb'])
->getMock();
- $this->credisFactoryMock->expects($this->exactly(5))
+ $this->credisFactoryMock->expects($this->exactly(6))
->method('create')
->withConsecutive(
['localhost', '1234', 0],
['127.0.0.1', 1234, 1],
['localhost', 6379, 2, 'password'],
['localhost', 1234, 0],
- ['127.0.0.1', 6379, 0]
+ ['127.0.0.1', 6379, 0],
+ []
)->willReturn($credisClient);
- $credisClient->expects($this->exactly(5))
+ $credisClient->expects($this->exactly(6))
->method('connect');
- $credisClient->expects($this->exactly(5))
+ $credisClient->expects($this->exactly(6))
->method('flushDb');
$this->step->execute();
diff --git a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
index 9f727330bc..baeefb2c9d 100644
--- a/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
+++ b/src/Test/Unit/Step/Deploy/PreDeploy/ConfigUpdate/CacheTest.php
@@ -324,6 +324,37 @@ public function executeDataProvider(): array
'address' => 'localhost',
'port' => 6379
],
+ 'Custom redis model' => [
+ 'configFromFile' => [],
+ 'config' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => 'SomeCustomRedisModel',
+ '_custom_redis_backend' => true,
+ 'backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ ],
+ 'finalConfig' => [
+ 'cache' => [
+ 'frontend' => [
+ 'frontName' => [
+ 'backend' => 'SomeCustomRedisModel',
+ 'backend_options' => [
+ 'server' => 'localhost',
+ 'port' => 6370,
+ ],
+ ],
+ ],
+ ],
+ ],
+ 'isGreaterOrEqual' => true,
+ 'address' => 'localhost',
+ 'port' => 6370
+ ],
];
}
From 34b0dd7215345e70e8379f946fae7349707f6376 Mon Sep 17 00:00:00 2001
From: sasank <82241533+haal9000@users.noreply.github.com>
Date: Mon, 17 Jul 2023 22:05:17 -0700
Subject: [PATCH 16/25] MCLOUD-10250: update broken onboarding docs link in
email template (#115)
MCLOUD-10250: update broken onboarding docs link in email template
---
views/reset_password.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/views/reset_password.html b/views/reset_password.html
index dbb43178a3..b3dfab041a 100644
--- a/views/reset_password.html
+++ b/views/reset_password.html
@@ -100,7 +100,7 @@
Need help? See Onboarding
+ href="https://experienceleague.adobe.com/docs/commerce-cloud-service/start/onboarding.html">Onboarding
tasks in the Magento Commerce Cloud documentation.
From 20408280e073365914d15b348dce071d42ddb8e9 Mon Sep 17 00:00:00 2001
From: snekkalapudi
Date: Tue, 18 Jul 2023 22:06:06 +0530
Subject: [PATCH 17/25] update validator for rabbit mq
---
src/Service/Validator.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/Service/Validator.php b/src/Service/Validator.php
index d3fcd3acee..02db51cc33 100644
--- a/src/Service/Validator.php
+++ b/src/Service/Validator.php
@@ -90,6 +90,7 @@ class Validator
'<2.3.0' => '~3.5.0',
'>=2.3.0 <2.3.7-p4 || >=2.4.0 <2.4.3-p3' => '~3.5.0 || ~3.7.0 || ~3.8.0',
'>=2.4.4 || ~2.4.3-p3 || ~2.3.7-p4' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0',
+ '>=2.4.7 <2.4.8' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.11.0',
],
ServiceInterface::NAME_NODE => [
'*' => '^6 || ^8 || ^10 || ^11',
From 5f5dc6d8e97c64fd206576db738bacbe19cc27e6 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Tue, 18 Jul 2023 16:10:16 -0500
Subject: [PATCH 18/25] MCLOUD-10314: Update ece-tools validator for RabbitMQ
3.11
---
src/Service/Validator.php | 5 ++-
src/Test/Unit/Service/ValidatorTest.php | 54 +++++++++++++++++++++++--
2 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/src/Service/Validator.php b/src/Service/Validator.php
index 02db51cc33..903a32bde3 100644
--- a/src/Service/Validator.php
+++ b/src/Service/Validator.php
@@ -89,8 +89,9 @@ class Validator
ServiceInterface::NAME_RABBITMQ => [
'<2.3.0' => '~3.5.0',
'>=2.3.0 <2.3.7-p4 || >=2.4.0 <2.4.3-p3' => '~3.5.0 || ~3.7.0 || ~3.8.0',
- '>=2.4.4 || ~2.4.3-p3 || ~2.3.7-p4' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0',
- '>=2.4.7 <2.4.8' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ~3.11.0',
+ '>=2.4.3-p3 <2.4.5-p3 || ~2.3.7-p4' => '~3.5.0 || ~3.7.0 || ~3.8.0 || ~3.9.0',
+ '>=2.4.5-p3 <2.4.7' => '~3.9.0 || ~3.11.0',
+ '>=2.4.7' => '~3.11.0',
],
ServiceInterface::NAME_NODE => [
'*' => '^6 || ^8 || ^10 || ^11',
diff --git a/src/Test/Unit/Service/ValidatorTest.php b/src/Test/Unit/Service/ValidatorTest.php
index 6e2113cc31..64be48406a 100644
--- a/src/Test/Unit/Service/ValidatorTest.php
+++ b/src/Test/Unit/Service/ValidatorTest.php
@@ -110,7 +110,7 @@ public function testValidateNonexistentService()
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
- public function validateVersionsDataProvider(): array
+ protected function validateVersionsDataProvider(): array
{
return [
[
@@ -152,9 +152,9 @@ public function validateVersionsDataProvider(): array
ServiceInterface::NAME_VARNISH => '7.1.1',
ServiceInterface::NAME_REDIS => 'latest',
ServiceInterface::NAME_ELASTICSEARCH => '6.7', // wrong
- ServiceInterface::NAME_RABBITMQ => '3.7'
+ ServiceInterface::NAME_RABBITMQ => '3.7' // wrong
],
- 2
+ 3
],
[
'2.4.0',
@@ -486,6 +486,54 @@ public function validateVersionsDataProvider(): array
],
0
],
+ [
+ '2.4.6',
+ [
+ ServiceInterface::NAME_PHP => '8.2.0',
+ ServiceInterface::NAME_DB_MARIA => '10.6.0',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
+ ServiceInterface::NAME_REDIS => '7.0.0',
+ ServiceInterface::NAME_OPENSEARCH => '2.3.0',
+ ServiceInterface::NAME_RABBITMQ => '3.11.0'
+ ],
+ 0
+ ],
+ [
+ '2.4.6',
+ [
+ ServiceInterface::NAME_PHP => '8.2.0',
+ ServiceInterface::NAME_DB_MARIA => '10.6.0',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
+ ServiceInterface::NAME_REDIS => '7.0.0',
+ ServiceInterface::NAME_OPENSEARCH => '2.3.0',
+ ServiceInterface::NAME_RABBITMQ => '3.8.0' // wrong
+ ],
+ 1
+ ],
+ [
+ '2.4.7',
+ [
+ ServiceInterface::NAME_PHP => '8.2.0',
+ ServiceInterface::NAME_DB_MARIA => '10.6.0',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
+ ServiceInterface::NAME_REDIS => '7.0.0',
+ ServiceInterface::NAME_OPENSEARCH => '2.3.0',
+ ServiceInterface::NAME_RABBITMQ => '3.9.0' // wrong
+ ],
+ 1
+ ],
+ [
+ '2.4.7',
+ [
+ ServiceInterface::NAME_PHP => '8.2.0',
+ ServiceInterface::NAME_DB_MARIA => '10.6.0',
+ ServiceInterface::NAME_VARNISH => '7.1.1',
+ ServiceInterface::NAME_REDIS => '7.0.0',
+ ServiceInterface::NAME_OPENSEARCH => '2.3.0',
+ ServiceInterface::NAME_RABBITMQ => '3.11.0'
+ ],
+ 0
+ ],
];
}
}
From 84c931552ea76f30f80d7b0ef94a42442e3f376b Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 24 Jul 2023 13:21:45 -0500
Subject: [PATCH 19/25] Update error codes
---
dist/error-codes.md | 83 ++++++++++++++-------------------------------
1 file changed, 26 insertions(+), 57 deletions(-)
diff --git a/dist/error-codes.md b/dist/error-codes.md
index b36a6d36b4..1d531b7b9a 100644
--- a/dist/error-codes.md
+++ b/dist/error-codes.md
@@ -5,48 +5,44 @@
Critical errors indicate a problem with the Commerce on cloud infrastructure project configuration that causes deployment failure, for example incorrect, unsupported, or missing configuration for required settings. Before you can deploy, you must update the configuration to resolve these errors.
### Build stage
-
-{:.error-table}
| Error code | Build step | Error description (Title) | Suggested action |
| - | - | - | - |
-| 2 | | Cannot write to the `./app/etc/env.php` file | Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
-| 3 | | Configuration isn't defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
+| 2 | | Can not write to the `./app/etc/env.php` file | Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
+| 3 | | Configuration is not defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct and defined. |
| 4 | | Failed to parse the `.magento.env.yaml` file | The `./.magento.env.yaml` file format is invalid. Use a YAML parser to check the syntax and fix any errors. |
| 5 | | Unable to read the `.magento.env.yaml` file | Unable to read the `./.magento.env.yaml` file. Check file permissions. |
| 6 | | Unable to read the `.schema.yaml` file | Unable to read the `./vendor/magento/ece-tools/config/magento.env.yaml` file. Check file permissions and redeploy (`magento-cloud environment:redeploy`). |
-| 7 | refresh-modules | Cannot write to the `./app/etc/config.php` file | The deployment script cannot make required changes to the `/app/etc/config.php` file. Check your filesystem permissions. |
-| 8 | validate-config | Cannot read the `composer.json` file | Unable to read the `./composer.json` file. Check file permissions. |
-| 9 | validate-config | Composer.json is missing required autoload section | Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Cloud template, and add the missing configuration. |
-| 10 | validate-config | The file `.magento.env.yaml` contains an option that is not declared in the schema, or an option configured with an invalid value or stage | The `./.magento.env.yaml` file contains invalid configuration. Check the error log for detailed info. |
-| 11 | refresh-modules | Command failed: `/bin/magento module:enable --all` | Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
+| 7 | refresh-modules | Can not write to the `./app/etc/config.php` file | The deployment script can not make required changes to the `/app/etc/config.php` file. Check your filesystem permissions. |
+| 8 | validate-config | Can not read the `composer.json` file | Unable to read the `./composer.json` file. Check file permissions. |
+| 9 | validate-config | The `composer.json` file is missing required autoload section | Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Cloud template, and add the missing configuration. |
+| 10 | validate-config | The `.magento.env.yaml` file contains an option that is not declared in the schema, or an option configured with an invalid value or stage | The `./.magento.env.yaml` file contains invalid configuration. Check the error log for detailed info. |
+| 11 | refresh-modules | Command failed: `/bin/magento module:enable --all` | Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also, check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 12 | apply-patches | Failed to apply patch | |
-| 13 | set-report-dir-nesting-level | Cannot write to the file `/pub/errors/local.xml` | |
+| 13 | set-report-dir-nesting-level | Can not write to the file `/pub/errors/local.xml` | |
| 14 | copy-sample-data | Failed to copy sample data files | |
| 15 | compile-di | Command failed: `/bin/magento setup:di:compile` | Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
| 16 | dump-autoload | Command failed: `composer dump-autoload` | The `composer dump-autoload` command failed. Check the `cloud.log` for more information. |
| 17 | run-baler | The command to run `Baler` for Javascript bundling failed | Check the `SCD_USE_BALER` environment variable to verify that the Baler module is configured and enabled for JS bundling. If you do not need the Baler module, set `SCD_USE_BALER: false`. |
-| 18 | compress-static-content | Required utility wasn't found (timeout, bash) | |
+| 18 | compress-static-content | Required utility was not found (timeout, bash) | |
| 19 | deploy-static-content | Command `/bin/magento setup:static-content:deploy` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 20 | compress-static-content | Static content compression failed | Check the `cloud.log` for more information. |
| 21 | backup-data: static-content | Failed to copy static content into the `init` directory | Check the `cloud.log` for more information. |
| 22 | backup-data: writable-dirs | Failed to copy some writable directories into the `init` directory | Failed to copy writable directories into the `./init` folder. Check your filesystem permissions. |
| 23 | | Unable to create a logger object | |
| 24 | backup-data: static-content | Failed to clean the `./init/pub/static/` directory | Failed to clean `./init/pub/static` folder. Check your filesystem permissions. |
-| 25 | | Cannot find the Composer package | If you installed the Adobe Commerce application version directly from the GitHub repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured. |
+| 25 | | Can not find the Composer package | If you installed the Adobe Commerce application version directly from the GitHub repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured. |
| 26 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce and Magento Open Source 2.4 and later versions. | Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree payment support, use an official extension from the Commerce Marketplace instead. |
### Deploy stage
-
-{:.error-table}
| Error code | Deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 101 | pre-deploy: cache | Incorrect cache configuration (missing port or host) | Cache configuration is missing required parameters `server` or `port`. Check the `cloud.log` for more information. |
-| 102 | | Cannot write to the `./app/etc/env.php` file | Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
-| 103 | | Configuration isn't defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
+| 102 | | Can not write to the `./app/etc/env.php` file | Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
+| 103 | | Configuration is not defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
| 104 | | Failed to parse the `.magento.env.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
| 105 | | Unable to read the `.magento.env.yaml` file | Unable to read the `./.magento.env.yaml` file. Check file permissions. |
| 106 | | Unable to read the `.schema.yaml` file | |
-| 107 | pre-deploy: clean-redis-cache | Failed to clean the Redis cache | Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://devdocs.magento.com/cloud/project/services-redis.html). |
+| 107 | pre-deploy: clean-redis-cache | Failed to clean the Redis cache | Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/service/redis.html). |
| 108 | pre-deploy: set-production-mode | Command `/bin/magento maintenance:enable` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 109 | validate-config | Incorrect database configuration | Check that the `DATABASE_CONFIGURATION` environment variable is configured correctly. |
| 110 | validate-config | Incorrect session configuration | Check that the `SESSION_CONFIGURATION` environment variable is configured correctly. The configuration must contain at least the `save` parameter. |
@@ -57,10 +53,10 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 115 | | Database query execution failed | |
| 116 | install-update: setup | Command `/bin/magento setup:install` failed | Check the `cloud.log` and `install_upgrade.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 117 | install-update: config-import | Command `app:config:import` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
-| 118 | | Required utility wasn't found (timeout, bash) | |
+| 118 | | Required utility was not found (timeout, bash) | |
| 119 | install-update: deploy-static-content | Command `/bin/magento setup:static-content:deploy` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 120 | compress-static-content | Static content compression failed | Check the `cloud.log` for more information. |
-| 121 | deploy-static-content:generate | Cannot update the deployed version | Cannot update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions. |
+| 121 | deploy-static-content:generate | Can not update the deployed version | Can not update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions. |
| 122 | clean-static-content | Failed to clean static content files | |
| 123 | install-update: split-db | Command `/bin/magento setup:db-schema:split` failed | Check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to the `.magento.env.yaml` file. |
| 124 | clean-view-preprocessed | Failed to clean the `var/view_preprocessed` folder | Unable to clean the `./var/view_preprocessed` folder. Check your filesystem permissions. |
@@ -70,34 +66,30 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 128 | disable-maintenance-mode | Command `/bin/magento maintenance:disable` failed | Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
| 129 | install-update: reset-password | Unable to read reset password template | |
| 130 | install-update: cache_type | Command failed: `php ./bin/magento cache:enable` | Command `php ./bin/magento cache:enable` runs only when Adobe Commerce was installed but `./app/etc/env.php` file was absent or empty at the beginning of the deployment. Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
-| 131 | install-update | The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable | This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://devdocs.magento.com/cloud/env/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Add the Magento encryption key](https://devdocs.magento.com/cloud/setup/first-time-setup-import-import.html#encryption-key). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command ." |
+| 131 | install-update | The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable | This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/env/stage/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Adobe Commerce encryption key](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/develop/overview.html#gather-credentials). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command ." |
| 132 | | Can not connect to the Elasticsearch service | Check for valid Elasticsearch credentials and verify that the service is running |
-| 137 | | Can not connect to the Opensearch service | Check for valid Opensearch credentials and verify that the service is running |
+| 137 | | Can not connect to the OpenSearch service | Check for valid OpenSearch credentials and verify that the service is running |
| 133 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce or Magento Open Source 2.4 and later versions. | Support for the Braintree module is no longer included with Adobe Commerce or Magento Open Source 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree support, use an official Braintree Payments extension from the Commerce Marketplace instead. |
| 134 | validate-config | Adobe Commerce and Magento Open Source 2.4.0 require Elasticsearch service to be installed | Install Elasticsearch service |
-| 138 | validate-config | Adobe Commerce and Magento Open Source 2.4.4 requires Opensearch or Elasticsearch service to be installed | Install Opensearch service |
+| 138 | validate-config | Adobe Commerce and Magento Open Source 2.4.4 requires OpenSearch or Elasticsearch service to be installed | Install OpenSearch service |
| 135 | validate-config | The search engine must be set to Elasticsearch for Adobe Commerce and Magento Open Source >= 2.4.0 | Check the SEARCH_CONFIGURATION variable for the `engine` option. If it is configured, remove the option, or set the value to "elasticsearch". |
| 136 | validate-config | Split Database was removed starting from Adobe Commerce and Magento Open Source 2.5.0. | If you use split database you have to revert to or migrate to a single database or use an alternative approach. |
-| 139 | validate-config | Incorrect search engine | This Adobe Commerce or Magento Open Source version does not support Opensearch. You must use versions 2.3.7-p3, 2.4.3-p2, or higher |
+| 139 | validate-config | Incorrect search engine | This Adobe Commerce or Magento Open Source version does not support OpenSearch. You must use versions 2.3.7-p3, 2.4.3-p2, or later |
### Post-deploy stage
-
-{:.error-table}
| Error code | Post-deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 201 | is-deploy-failed | Deploy stage failed | |
-| 202 | | The `./app/etc/env.php` file is not writable | Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
-| 203 | | Configuration isn't defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
+| 202 | | The `./app/etc/env.php` file is not writable | Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
+| 203 | | Configuration is not defined in the `schema.yaml` file | Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined. |
| 204 | | Failed to parse the `.magento.env.yaml` file | The `./.magento.env.yaml` file format is invalid. Use a YAML parser to check the syntax and fix any errors. |
| 205 | | Unable to read the `.magento.env.yaml` file | Check file permissions. |
| 206 | | Unable to read the `.schema.yaml` file | |
-| 207 | warm-up | Failed to warm-up some pages | |
+| 207 | warm-up | Failed to preload some warm-up pages | |
| 208 | time-to-firs-byte | Failed to test time to first byte (TTFB) | |
| 227 | clean-cache | Command `/bin/magento cache:flush` failed | Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
### General
-
-{:.error-table}
| Error code | General step | Error description (Title) | Suggested action |
| - | - | - | - |
| 243 | | Configuration is not defined in the `schema.yaml` file | Check that the config variable name is correct, and that it defined. |
@@ -112,8 +104,6 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
Warning errors indicate a problem with the Commerce on cloud infrastructure project configuration such as incorrect, deprecated, unsupported, or missing configuration settings for optional features that can affect site operation. Although a warning does not cause deployment failure, you should review warning messages and update the configuration to resolve them.
### Build stage
-
-{:.error-table}
| Error code | Build step | Error description (Title) | Suggested action |
| - | - | - | - |
| 1001 | validate-config | File app/etc/config.php does not exist | |
@@ -122,11 +112,9 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 1004 | validate-config | The configuration is not compatible with this version of Magento | |
| 1005 | validate-config | SCD options ignored | |
| 1006 | validate-config | The configured state is not ideal | |
-| 1007 | run-baler | Baler JS bundling cannot be used | |
+| 1007 | run-baler | Baler JS bundling can not be used | |
### Deploy stage
-
-{:.error-table}
| Error code | Deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 2001 | pre-deploy:cache | Cache is configured for a Redis service that is not available. Configuration will be ignored. | |
@@ -149,7 +137,7 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 2018 | validate-config | Some services have passed EOL | |
| 2019 | validate-config | The MySQL search configuration option is deprecated | Use Elasticsearch instead. |
| 2029 | validate-config | Split Database was deprecated in the Adobe Commerce and Magento Open Source 2.4.2 and will be removed in 2.5. | If you use split database you should start planning to revert to or migrate to a single database or use an alternative approach. |
-| 2020 | install-update | Adobe Commerce installation completed, but the `app/etc/env.php` configuration file was missing or empty. | Required data will be restored from environment configurations and from .magento.env.yaml file. |
+| 2020 | install-update | Adobe Commerce installation completed, but the `app/etc/env.php` configuration file was missing or empty. | Required data will be restored from environment configurations and from the .magento.env.yaml file. |
| 2021 | install-update:db-connection | For split databases used custom connections | |
| 2022 | install-update:db-connection | You have changed to a database configuration that is not compatible with the slave connection. | |
| 2023 | install-update:split-db | Enabling a split database will be skipped. | |
@@ -158,36 +146,17 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 2026 | pre-deploy:restore-writable-dirs | Failed to restore some data generated during the build phase to the mounted directories | Check the `cloud.log` for more information. |
| 2027 | validate-config:mage-mode-variable | Mode value for MAGE_MODE environment variable not supported | Remove the MAGE_MODE environment variable, or change its value to "production". Adobe Commerce on cloud infrastructure supports "production" mode only. |
| 2028 | remote-storage | Remote storage could not be enabled. | Verify remote storage credentials. |
-| 2030 | validate-config | Elasticsearch and Opensearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and higher use Opensearch by default | Consider removing the Elasticsearch or Opensearch service from the infrastructure layer to optimize resource usage. |
+| 2030 | validate-config | Elasticsearch and OpenSearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and later use OpenSearch by default | Consider removing the Elasticsearch or OpenSearch service from the infrastructure layer to optimize resource usage. |
### Post-deploy stage
-
-{:.error-table}
| Error code | Post-deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 3001 | validate-config | Debug logging is enabled in Adobe Commerce | To save disk space, do not enable debug logging for your production environments. |
| 3002 | warm-up | Can not fetch store urls | |
| 3003 | warm-up | Can not fetch store url | |
-| 3004 | backup | Cannot create backup files | |
+| 3004 | backup | Can not create backup files | |
### General
-
-{:.error-table}
| Error code | General step | Error description (Title) | Suggested action |
| - | - | - | - |
| 4001 | | Can not get system processor count: | |
-
-
-
-
-
-
From 1b2e562bf2e2a27b2fe2cc8fe69dd9f3cb85fc5d Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Mon, 24 Jul 2023 13:40:57 -0500
Subject: [PATCH 20/25] Update error codes
---
dist/error-codes.md | 8 ++++++++
src/Command/Dev/GenerateSchemaError.php | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dist/error-codes.md b/dist/error-codes.md
index 1d531b7b9a..17355c3886 100644
--- a/dist/error-codes.md
+++ b/dist/error-codes.md
@@ -5,6 +5,7 @@
Critical errors indicate a problem with the Commerce on cloud infrastructure project configuration that causes deployment failure, for example incorrect, unsupported, or missing configuration for required settings. Before you can deploy, you must update the configuration to resolve these errors.
### Build stage
+
| Error code | Build step | Error description (Title) | Suggested action |
| - | - | - | - |
| 2 | | Can not write to the `./app/etc/env.php` file | Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions. |
@@ -34,6 +35,7 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 26 | validate-config | Remove Magento Braintree module configuration which is no longer supported in Adobe Commerce and Magento Open Source 2.4 and later versions. | Support for the Braintree module is no longer included with Magento 2.4.0 and later. Remove the CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL variable from the variables section of the `.magento.app.yaml` file. For Braintree payment support, use an official extension from the Commerce Marketplace instead. |
### Deploy stage
+
| Error code | Deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 101 | pre-deploy: cache | Incorrect cache configuration (missing port or host) | Cache configuration is missing required parameters `server` or `port`. Check the `cloud.log` for more information. |
@@ -77,6 +79,7 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 139 | validate-config | Incorrect search engine | This Adobe Commerce or Magento Open Source version does not support OpenSearch. You must use versions 2.3.7-p3, 2.4.3-p2, or later |
### Post-deploy stage
+
| Error code | Post-deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 201 | is-deploy-failed | Deploy stage failed | |
@@ -90,6 +93,7 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 227 | clean-cache | Command `/bin/magento cache:flush` failed | Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output. |
### General
+
| Error code | General step | Error description (Title) | Suggested action |
| - | - | - | - |
| 243 | | Configuration is not defined in the `schema.yaml` file | Check that the config variable name is correct, and that it defined. |
@@ -104,6 +108,7 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
Warning errors indicate a problem with the Commerce on cloud infrastructure project configuration such as incorrect, deprecated, unsupported, or missing configuration settings for optional features that can affect site operation. Although a warning does not cause deployment failure, you should review warning messages and update the configuration to resolve them.
### Build stage
+
| Error code | Build step | Error description (Title) | Suggested action |
| - | - | - | - |
| 1001 | validate-config | File app/etc/config.php does not exist | |
@@ -115,6 +120,7 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 1007 | run-baler | Baler JS bundling can not be used | |
### Deploy stage
+
| Error code | Deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 2001 | pre-deploy:cache | Cache is configured for a Redis service that is not available. Configuration will be ignored. | |
@@ -149,6 +155,7 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 2030 | validate-config | Elasticsearch and OpenSearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and later use OpenSearch by default | Consider removing the Elasticsearch or OpenSearch service from the infrastructure layer to optimize resource usage. |
### Post-deploy stage
+
| Error code | Post-deploy step | Error description (Title) | Suggested action |
| - | - | - | - |
| 3001 | validate-config | Debug logging is enabled in Adobe Commerce | To save disk space, do not enable debug logging for your production environments. |
@@ -157,6 +164,7 @@ Warning errors indicate a problem with the Commerce on cloud infrastructure proj
| 3004 | backup | Can not create backup files | |
### General
+
| Error code | General step | Error description (Title) | Suggested action |
| - | - | - | - |
| 4001 | | Can not get system processor count: | |
diff --git a/src/Command/Dev/GenerateSchemaError.php b/src/Command/Dev/GenerateSchemaError.php
index c70f3047e5..3083098b6b 100644
--- a/src/Command/Dev/GenerateSchemaError.php
+++ b/src/Command/Dev/GenerateSchemaError.php
@@ -116,7 +116,7 @@ private function generateDocs(array $errors): string
$result .= sprintf("\n### %s%s\n", ucfirst($stage), $stage === 'general' ? '' : ' stage');
$table = sprintf(
- "| Error code | %s step | Error description (Title) | Suggested action |\n",
+ "\n| Error code | %s step | Error description (Title) | Suggested action |\n",
ucfirst($stage)
);
$table .= "| - | - | - | - |\n";
From 30d416c6765b9080feb85e1a727368a377a66eb5 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Tue, 25 Jul 2023 17:35:56 -0500
Subject: [PATCH 21/25] MCLOUD-10863: Release ece-tools 2002.1.15
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 944f219af2..3d6248c0c0 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "magento/ece-tools",
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
"type": "magento2-component",
- "version": "2002.1.14",
+ "version": "2002.1.15",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {
From e851adfd3bf6d68eab5a7b60cadb1543636c3dda Mon Sep 17 00:00:00 2001
From: Oleksandr Shmyheliuk
Date: Tue, 29 Aug 2023 13:38:27 -0500
Subject: [PATCH 22/25] CEXT-2220: Add support for deployments on Commerce
Cloud
---
config/schema.error.yaml | 10 ++
config/schema.yaml | 11 ++
dist/error-codes.md | 2 +
scenario/build/generate.xml | 1 +
src/App/Error.php | 2 +
src/Config/StageConfigInterface.php | 1 +
src/Step/Build/EnableWebhooks.php | 94 ++++++++++
src/Test/Unit/Config/SchemaTest.php | 1 +
.../Unit/Step/Build/EnableWebhooksTest.php | 165 ++++++++++++++++++
9 files changed, 287 insertions(+)
create mode 100644 src/Step/Build/EnableWebhooks.php
create mode 100644 src/Test/Unit/Step/Build/EnableWebhooksTest.php
diff --git a/config/schema.error.yaml b/config/schema.error.yaml
index 2e57576a24..23e65fdced 100644
--- a/config/schema.error.yaml
+++ b/config/schema.error.yaml
@@ -440,6 +440,16 @@
suggestion: 'Check the `cloud.log` for more information.'
stage: general
type: critical
+!php/const Magento\MagentoCloud\App\Error::GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED:
+ title: 'Unable to generate a module for commerce webhooks'
+ suggestion: 'Check the `cloud.log` for more information.'
+ stage: general
+ type: critical
+!php/const Magento\MagentoCloud\App\Error::GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED:
+ title: 'Unable to enable a module for commerce webhooks'
+ suggestion: 'Check the `cloud.log` for more information.'
+ stage: general
+ type: critical
# Warning errors
!php/const Magento\MagentoCloud\App\Error::WARN_CONFIG_PHP_NOT_EXISTS:
title: 'File app/etc/config.php does not exist'
diff --git a/config/schema.yaml b/config/schema.yaml
index 5317b4d4ff..ab0342534c 100644
--- a/config/schema.yaml
+++ b/config/schema.yaml
@@ -717,6 +717,17 @@ variables:
- stage:
global:
ENABLE_EVENTING: true
+ ENABLE_WEBHOOKS:
+ description: Enables commerce webhooks.
+ type: boolean
+ stages:
+ - global
+ default:
+ global: false
+ examples:
+ - stage:
+ global:
+ ENABLE_WEBHOOKS: true
# Environment variables
ENV_RELATIONSHIPS:
diff --git a/dist/error-codes.md b/dist/error-codes.md
index 17355c3886..2a533fb308 100644
--- a/dist/error-codes.md
+++ b/dist/error-codes.md
@@ -102,6 +102,8 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 246 | | Unable to read the `.schema.yaml` file | |
| 247 | | Unable to generate a module for eventing | Check the `cloud.log` for more information. |
| 248 | | Unable to enable a module for eventing | Check the `cloud.log` for more information. |
+| 249 | | Unable to generate a module for commerce webhooks | Check the `cloud.log` for more information. |
+| 250 | | Unable to enable a module for commerce webhooks | Check the `cloud.log` for more information. |
## Warning Errors
diff --git a/scenario/build/generate.xml b/scenario/build/generate.xml
index 008161aa08..4e3ccbff1b 100644
--- a/scenario/build/generate.xml
+++ b/scenario/build/generate.xml
@@ -30,6 +30,7 @@
+
diff --git a/src/App/Error.php b/src/App/Error.php
index 11d6cd8307..7835f36798 100644
--- a/src/App/Error.php
+++ b/src/App/Error.php
@@ -96,6 +96,8 @@ class Error
public const GLOBAL_CONFIG_UNABLE_TO_READ_SCHEMA_YAML = 246;
public const GLOBAL_EVENTING_MODULE_GENERATE_FAILED = 247;
public const GLOBAL_EVENTING_MODULE_ENABLEMENT_FAILED = 248;
+ public const GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED = 249;
+ public const GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED = 250;
/**
* Build
diff --git a/src/Config/StageConfigInterface.php b/src/Config/StageConfigInterface.php
index 36d1ca4e83..5df54d5449 100644
--- a/src/Config/StageConfigInterface.php
+++ b/src/Config/StageConfigInterface.php
@@ -43,6 +43,7 @@ interface StageConfigInterface
public const VAR_SCD_NO_PARENT = 'SCD_NO_PARENT';
public const VAR_X_FRAME_CONFIGURATION = 'X_FRAME_CONFIGURATION';
public const VAR_ENABLE_EVENTING = 'ENABLE_EVENTING';
+ public const VAR_ENABLE_WEBHOOKS = 'ENABLE_WEBHOOKS';
/**
* Settings for deployment from git.
diff --git a/src/Step/Build/EnableWebhooks.php b/src/Step/Build/EnableWebhooks.php
new file mode 100644
index 0000000000..4f1c5ee677
--- /dev/null
+++ b/src/Step/Build/EnableWebhooks.php
@@ -0,0 +1,94 @@
+logger = $logger;
+ $this->magentoShell = $shellFactory->createMagento();
+ $this->globalConfig = $globalConfig;
+ }
+
+ /**
+ * Generates and enables a module for commerce webhooks
+ * if @see StageConfigInterface::VAR_ENABLE_WEBHOOKS set to true
+ *
+ * {@inheritDoc}
+ */
+ public function execute()
+ {
+ try {
+ if (!$this->globalConfig->get(StageConfigInterface::VAR_ENABLE_WEBHOOKS)) {
+ return;
+ }
+ } catch (ConfigException $e) {
+ throw new StepException($e->getMessage(), $e->getCode(), $e);
+ }
+
+ try {
+ $this->logger->notice('Generating module for commerce webhooks');
+ $this->magentoShell->execute('webhooks:generate:module');
+ } catch (ShellException $e) {
+ $this->logger->error(
+ 'Failed to generate the AdobeCommerceWebhookPlugins module. ' .
+ 'Refer to the commerce webhooks documentation to determine if all ' .
+ 'required modules are have been installed. ' .
+ 'Error: ' . $e->getMessage()
+ );
+ throw new StepException($e->getMessage(), Error::GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED, $e);
+ }
+
+ try {
+ $this->logger->notice('Enabling module for commerce webhooks');
+ $this->magentoShell->execute('module:enable Magento_AdobeCommerceWebhookPlugins');
+ } catch (ShellException $e) {
+ $this->logger->error('Failed to enable module for commerce webhooks: ' . $e->getMessage());
+ throw new StepException($e->getMessage(), Error::GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED, $e);
+ }
+ }
+}
diff --git a/src/Test/Unit/Config/SchemaTest.php b/src/Test/Unit/Config/SchemaTest.php
index e8ff400301..90e0643c25 100644
--- a/src/Test/Unit/Config/SchemaTest.php
+++ b/src/Test/Unit/Config/SchemaTest.php
@@ -175,6 +175,7 @@ public function testGetDefaultsForGlobalSection(): void
StageConfigInterface::VAR_MIN_LOGGING_LEVEL => '',
StageConfigInterface::VAR_X_FRAME_CONFIGURATION => 'SAMEORIGIN',
StageConfigInterface::VAR_ENABLE_EVENTING => false,
+ StageConfigInterface::VAR_ENABLE_WEBHOOKS => false,
],
$this->schema->getDefaults(StageConfigInterface::STAGE_GLOBAL)
);
diff --git a/src/Test/Unit/Step/Build/EnableWebhooksTest.php b/src/Test/Unit/Step/Build/EnableWebhooksTest.php
new file mode 100644
index 0000000000..eb2bcbd46e
--- /dev/null
+++ b/src/Test/Unit/Step/Build/EnableWebhooksTest.php
@@ -0,0 +1,165 @@
+loggerMock = $this->getMockForAbstractClass(LoggerInterface::class);
+ $this->magentoShellMock = $this->createMock(MagentoShell::class);
+ /** @var ShellFactory|MockObject $shellFactoryMock */
+ $shellFactoryMock = $this->createMock(ShellFactory::class);
+ $shellFactoryMock->expects($this->once())
+ ->method('createMagento')
+ ->willReturn($this->magentoShellMock);
+ $this->globalConfigMock = $this->createMock(GlobalSection::class);
+
+ $this->step = new EnableWebhooks(
+ $this->loggerMock,
+ $shellFactoryMock,
+ $this->globalConfigMock
+ );
+ }
+
+ /**
+ * @return void
+ * @throws StepException
+ */
+ public function testExecuteWebhooksNotEnabled()
+ {
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_WEBHOOKS)
+ ->willReturn(false);
+
+ $this->magentoShellMock->expects(self::never())
+ ->method('execute');
+ $this->loggerMock->expects(self::never())
+ ->method('notice');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws StepException
+ */
+ public function testExecuteGenerateCommandFailed()
+ {
+ $this->expectException(StepException::class);
+ $this->expectExceptionMessage('error during module generation');
+ $this->expectExceptionCode(Error::GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED);
+
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_WEBHOOKS)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::once())
+ ->method('execute')
+ ->with('webhooks:generate:module')
+ ->willThrowException(new ShellException('error during module generation'));
+ $this->loggerMock->expects(self::once())
+ ->method('notice');
+ $this->loggerMock->expects(self::once())
+ ->method('error');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws StepException
+ */
+ public function testExecuteEnableModuleCommandFailed()
+ {
+ $this->expectException(StepException::class);
+ $this->expectExceptionMessage('error during module enablement');
+ $this->expectExceptionCode(Error::GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED);
+
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_WEBHOOKS)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::at(0))
+ ->method('execute')
+ ->with('webhooks:generate:module');
+ $this->magentoShellMock->expects(self::at(1))
+ ->method('execute')
+ ->with('module:enable Magento_AdobeCommerceWebhookPlugins')
+ ->willThrowException(new ShellException('error during module enablement'));
+ $this->loggerMock->expects(self::exactly(2))
+ ->method('notice');
+ $this->loggerMock->expects(self::once())
+ ->method('error');
+
+ $this->step->execute();
+ }
+
+ /**
+ * @return void
+ * @throws StepException
+ */
+ public function testExecuteSuccess()
+ {
+ $this->globalConfigMock->expects(self::once())
+ ->method('get')
+ ->with(StageConfigInterface::VAR_ENABLE_WEBHOOKS)
+ ->willReturn(true);
+ $this->magentoShellMock->expects(self::at(0))
+ ->method('execute')
+ ->with('webhooks:generate:module');
+ $this->magentoShellMock->expects(self::at(1))
+ ->method('execute')
+ ->with('module:enable Magento_AdobeCommerceWebhookPlugins');
+ $this->loggerMock->expects(self::exactly(2))
+ ->method('notice');
+ $this->loggerMock->expects(self::never())
+ ->method('error');
+
+ $this->step->execute();
+ }
+}
From d9485633baaef36ef93829da197e314fd01847c8 Mon Sep 17 00:00:00 2001
From: Oleksandr Shmyheliuk
Date: Tue, 5 Sep 2023 09:42:17 -0500
Subject: [PATCH 23/25] CEXT-2220: Add support for deployments on Commerce
Cloud (#120)
* CEXT-2220: Add support for deployments on Commerce Cloud
---
config/schema.error.yaml | 4 ++--
config/schema.yaml | 2 +-
dist/error-codes.md | 4 ++--
src/Step/Build/EnableEventing.php | 2 +-
src/Step/Build/EnableWebhooks.php | 12 ++++++------
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/config/schema.error.yaml b/config/schema.error.yaml
index 23e65fdced..2f54cf7d11 100644
--- a/config/schema.error.yaml
+++ b/config/schema.error.yaml
@@ -441,12 +441,12 @@
stage: general
type: critical
!php/const Magento\MagentoCloud\App\Error::GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED:
- title: 'Unable to generate a module for commerce webhooks'
+ title: 'Failed to generate the AdobeCommerceWebhookPlugins module'
suggestion: 'Check the `cloud.log` for more information.'
stage: general
type: critical
!php/const Magento\MagentoCloud\App\Error::GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED:
- title: 'Unable to enable a module for commerce webhooks'
+ title: 'Failed to enable the AdobeCommerceWebhookPlugins module'
suggestion: 'Check the `cloud.log` for more information.'
stage: general
type: critical
diff --git a/config/schema.yaml b/config/schema.yaml
index ab0342534c..c9ac513cd1 100644
--- a/config/schema.yaml
+++ b/config/schema.yaml
@@ -718,7 +718,7 @@ variables:
global:
ENABLE_EVENTING: true
ENABLE_WEBHOOKS:
- description: Enables commerce webhooks.
+ description: Enables Commerce webhooks.
type: boolean
stages:
- global
diff --git a/dist/error-codes.md b/dist/error-codes.md
index 2a533fb308..1f41b718f8 100644
--- a/dist/error-codes.md
+++ b/dist/error-codes.md
@@ -102,8 +102,8 @@ Critical errors indicate a problem with the Commerce on cloud infrastructure pro
| 246 | | Unable to read the `.schema.yaml` file | |
| 247 | | Unable to generate a module for eventing | Check the `cloud.log` for more information. |
| 248 | | Unable to enable a module for eventing | Check the `cloud.log` for more information. |
-| 249 | | Unable to generate a module for commerce webhooks | Check the `cloud.log` for more information. |
-| 250 | | Unable to enable a module for commerce webhooks | Check the `cloud.log` for more information. |
+| 249 | | Failed to generate the AdobeCommerceWebhookPlugins module | Check the `cloud.log` for more information. |
+| 250 | | Failed to enable the AdobeCommerceWebhookPlugins module | Check the `cloud.log` for more information. |
## Warning Errors
diff --git a/src/Step/Build/EnableEventing.php b/src/Step/Build/EnableEventing.php
index 2dcc2f2a44..bac7e0fc44 100644
--- a/src/Step/Build/EnableEventing.php
+++ b/src/Step/Build/EnableEventing.php
@@ -75,7 +75,7 @@ public function execute()
} catch (ShellException $e) {
$this->logger->error(
'Failed to generate the Magento_AdobeCommerceEvents module. ' .
- 'Refer to the eventing documentation to determine if all required modules are have been installed. ' .
+ 'Refer to the eventing documentation to determine if all required modules have been installed. ' .
'Error: ' . $e->getMessage()
);
throw new StepException($e->getMessage(), Error::GLOBAL_EVENTING_MODULE_GENERATE_FAILED, $e);
diff --git a/src/Step/Build/EnableWebhooks.php b/src/Step/Build/EnableWebhooks.php
index 4f1c5ee677..4db26943fe 100644
--- a/src/Step/Build/EnableWebhooks.php
+++ b/src/Step/Build/EnableWebhooks.php
@@ -55,7 +55,7 @@ public function __construct(
}
/**
- * Generates and enables a module for commerce webhooks
+ * Generates and enables a module for Commerce webhooks
* if @see StageConfigInterface::VAR_ENABLE_WEBHOOKS set to true
*
* {@inheritDoc}
@@ -71,23 +71,23 @@ public function execute()
}
try {
- $this->logger->notice('Generating module for commerce webhooks');
+ $this->logger->notice('Generating module for Commerce webhooks');
$this->magentoShell->execute('webhooks:generate:module');
} catch (ShellException $e) {
$this->logger->error(
'Failed to generate the AdobeCommerceWebhookPlugins module. ' .
- 'Refer to the commerce webhooks documentation to determine if all ' .
- 'required modules are have been installed. ' .
+ 'Refer to the Commerce webhooks documentation to determine if all ' .
+ 'required modules have been installed. ' .
'Error: ' . $e->getMessage()
);
throw new StepException($e->getMessage(), Error::GLOBAL_WEBHOOKS_MODULE_GENERATE_FAILED, $e);
}
try {
- $this->logger->notice('Enabling module for commerce webhooks');
+ $this->logger->notice('Enabling module for Commerce webhooks');
$this->magentoShell->execute('module:enable Magento_AdobeCommerceWebhookPlugins');
} catch (ShellException $e) {
- $this->logger->error('Failed to enable module for commerce webhooks: ' . $e->getMessage());
+ $this->logger->error('Failed to enable module for Commerce webhooks: ' . $e->getMessage());
throw new StepException($e->getMessage(), Error::GLOBAL_WEBHOOKS_MODULE_ENABLEMENT_FAILED, $e);
}
}
From 34ae0d0bd0b5655f4ca49ac92025f24642190aa0 Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Tue, 10 Oct 2023 11:53:58 -0500
Subject: [PATCH 24/25] MAGREQ-8989: Add metadata file to active repos (#121)
---
.github/.metadata.json | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/.github/.metadata.json b/.github/.metadata.json
index 6da808bc71..ef79f7a4d2 100644
--- a/.github/.metadata.json
+++ b/.github/.metadata.json
@@ -1,14 +1,14 @@
{
- "templateVersion": "0.1",
+ "templateVersion": "0.2",
"product": {
"name": "Magento Commerce Cloud Deployment Tools",
"description": "ECE-Tools is a set of scripts and tools designed to manage and deploy Cloud projects"
},
"contacts": {
"team": {
- "name": "Magic Mountain",
- "DL": "Grp-magento-cloud-all",
- "slackChannel": "magic_mountain"
+ "name": "Mystic Mountain",
+ "DL": "Grp-Mystic-Mountain",
+ "slackChannel": "#mystic-mountain-team"
}
},
"ticketTracker": {
@@ -17,10 +17,8 @@
},
"securityJiraQueue": {
"projectKey": "MAGREQ",
- "component": "Magento Cloud Engineering"
+ "component": "MAGREQ/Magento Cloud Engineering"
}
},
- "staticScan": {
- "enable": false
- }
+ "productionCodeBranches": ["2002.0", "2002.1"]
}
From 4264e7b79dc98d972c8b7cf2bab4951a9ddaf72b Mon Sep 17 00:00:00 2001
From: Bohdan Korablov
Date: Tue, 10 Oct 2023 12:12:40 -0500
Subject: [PATCH 25/25] MCLOUD-11293: Release ECE-Tools 2002.1.16 (#123)
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 3d6248c0c0..acadd80651 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "magento/ece-tools",
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
"type": "magento2-component",
- "version": "2002.1.15",
+ "version": "2002.1.16",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {