Skip to content

Commit

Permalink
Merge pull request #87 from magento-commerce/MCLOUD-8574
Browse files Browse the repository at this point in the history
MCLOUD-8574: Release Cloud Tools
  • Loading branch information
BaDos authored Mar 30, 2022
2 parents 4231e3d + 4a9eb66 commit d980a6e
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 34 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.9",
"version": "2002.1.10",
"license": "OSL-3.0",
"repositories": {
"repo.magento.com": {
Expand Down
48 changes: 24 additions & 24 deletions config/schema.error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_MISSED_REQUIRED_AUTOLOAD:
step: validate-config
title: 'Composer.json 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 Magento Cloud template, and add the missing configuration.'
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:
Expand Down Expand Up @@ -133,13 +133,13 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_PACKAGE_NOT_FOUND:
title: 'Cannot find the Composer package'
suggestion: '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.'
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
!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 Magento 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 Magento Marketplace instead.'
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.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_CACHE_CONFIGURATION:
Expand Down Expand Up @@ -188,7 +188,7 @@
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_CONFIGURATION_DB:
step: validate-config
title: 'Incorrect database configuration'
suggestion: 'Check that the the `DATABASE_CONFIGURATION` environment variable is configured correctly.'
suggestion: 'Check that the `DATABASE_CONFIGURATION` environment variable is configured correctly.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_CONFIGURATION_SESSION:
Expand Down Expand Up @@ -312,13 +312,13 @@
!php/const Magento\MagentoCloud\App\Error::DEPLOY_CACHE_ENABLE_FAILED:
step: 'install-update: cache_type'
title: 'Command failed: `php ./bin/magento cache:enable`'
suggestion: '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.'
suggestion: '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.'
stage: deploy
type: critical
!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 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 .\""
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 .\""
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ES_CANNOT_CONNECT:
Expand All @@ -333,31 +333,31 @@
type: critical
!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 Magento 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 support, use an official Braintree Payments extension from the Magento Marketplace instead.'
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.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ES_SERVICE_NOT_INSTALLED:
step: validate-config
title: 'Magento 2.4.0 requires Elasticsearch service to be installed'
title: 'Adobe Commerce and Magento Open Source 2.4.0 require Elasticsearch service to be installed'
suggestion: 'Install Elasticsearch service'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_OS_SERVICE_NOT_INSTALLED:
step: validate-config
title: 'Magento 2.4.4 requires Opensearch or Elasticsearch service to be installed'
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:
step: validate-config
title: 'The search engine must be set to Elasticsearch for Magento >= 2.4.0'
title: 'The search engine must be set to Elasticsearch for Adobe Commerce and Magento Open Source >= 2.4.0'
suggestion: 'Check the SEARCH_CONFIGURATION variable for the `engine` option. If it is configured, remove the option, or set the value to "elasticsearch".'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_REMOVED_SPLIT_DB:
step: validate-config
title: 'Split Database was removed starting from Magento 2.5.0.'
title: 'Split Database was removed starting from Adobe Commerce and Magento Open Source 2.5.0.'
suggestion: 'If you use split database you have to revert to or migrate to a single database or use an alternative approach.'
stage: deploy
type: critical
Expand Down Expand Up @@ -504,12 +504,12 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_SOLR_DEPRECATED:
title: 'Solr support has been deprecated in Magento 2.1.'
title: 'Solr support has been deprecated in Adobe Commerce and Magento Open Source 2.1.'
stage: deploy
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_SOLR_NOT_SUPPORTED:
title: 'Solr is no longer supported by Magento 2.2 or later.'
title: 'Solr is no longer supported by Adobe Commerce and Magento Open Source 2.2 or later.'
stage: deploy
step: validate-config
type: warning
Expand All @@ -520,12 +520,12 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_ES_VERSION_MISMATCH:
title: 'Elasticsearch service version on infrastructure layer is not compatible with current version of the elasticsearch/elasticsearch module, used by your Magento application.'
title: 'Elasticsearch service version on infrastructure layer is not compatible with current version of the elasticsearch/elasticsearch module, used by your Adobe Commerce application.'
stage: deploy
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_CONFIG_NOT_COMPATIBLE:
title: 'The current configuration is not compatible with this version of Magento'
title: 'The current configuration is not compatible with this version of Adobe Commerce'
stage: deploy
step: validate-config
type: warning
Expand All @@ -550,7 +550,7 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_SERVICE_VERSION_NOT_COMPATIBLE:
title: 'The current configuration is not compatible with this version of Magento'
title: 'The current configuration is not compatible with this version of Adobe Commerce'
stage: deploy
step: validate-config
type: warning
Expand All @@ -566,13 +566,13 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_DEPRECATED_SPLIT_DB:
title: 'Split Database was deprecated in the Magento 2.4.2 and will be removed in 2.5.'
title: 'Split Database was deprecated in the Adobe Commerce and Magento Open Source 2.4.2 and will be removed in 2.5.'
stage: deploy
suggestion: 'If you use split database you should start planning to revert to or migrate to a single database or use an alternative approach.'
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_ENV_PHP_MISSED:
title: 'Magento installation completed, but the `app/etc/env.php` configuration file was missing or empty.'
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.'
stage: deploy
step: install-update
Expand Down Expand Up @@ -611,7 +611,7 @@
!php/const Magento\MagentoCloud\App\Error::WARN_NOT_SUPPORTED_MAGE_MODE:
title: 'Mode value for MAGE_MODE environment variable not supported'
stage: deploy
suggestion: 'Remove the MAGE_MODE environment variable, or change its value to "production". Magento Cloud supports "production" mode only.'
suggestion: 'Remove the MAGE_MODE environment variable, or change its value to "production". Adobe Commerce on cloud infrastructure supports "production" mode only.'
step: 'validate-config:mage-mode-variable'
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_REMOTE_STORAGE_CANNOT_BE_ENABLED:
Expand All @@ -621,7 +621,7 @@
step: remote-storage
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_DEBUG_LOG_ENABLED:
title: 'Debug logging is enabled in Magento'
title: 'Debug logging is enabled in Adobe Commerce'
suggestion: 'To save disk space, do not enable debug logging for your production environments.'
stage: post-deploy
step: validate-config
Expand All @@ -646,14 +646,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. Magento 2.4.4 and higher uses Opensearch by default'
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.'
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 Magento 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 higher'
stage: deploy
type: critical
15 changes: 8 additions & 7 deletions src/Command/Dev/GenerateSchemaError.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ private function generateDocs(array $errors): string
public function getErrorTypeDescription(): array
{
return [
'critical' => '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.',
'warning' => '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.',
'critical' => '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.',
'warning' => '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.',
];
}
}
7 changes: 5 additions & 2 deletions src/Service/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ class Validator
'>=2.2.0 <2.2.8 || 2.3.0' => '~1.7.0 || ~2.4.0 || ~5.2.0',
'>=2.2.8 <2.3.0 || >=2.3.1 <2.3.5' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0',
'>=2.3.5 <2.3.7' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~6.8.0 || ~7.5.0 || ~7.6.0 || ~7.7.0',
'>=2.3.7 <2.4.0' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~6.8.0 || ~7.5.0 || ~7.6.0 || ~7.7.0' .
'>=2.3.7 <2.3.7-p3' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~6.8.0 || ~7.5.0 || ~7.6.0 || ~7.7.0' .
' || ~7.9.0',
'>=2.3.7-p3 <2.4.0' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~6.8.0 || ~7.5.0 || ~7.6.0 || ~7.7.0' .
' || ~7.9.0 || ~7.10.0',
'>=2.4.0 <2.4.2' => '~7.5.0 || ~7.6.0 || ~7.7.0',
'>=2.4.2' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.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',
],
ServiceInterface::NAME_OPENSEARCH => [
'>=2.3.7-p3 <2.4.0 || >=2.4.3-p2' => '~1.1 || ~1.2.1',
Expand Down
49 changes: 49 additions & 0 deletions src/Test/Unit/Service/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,55 @@ public function validateVersionsDataProvider(): array
],
0
],
[
'2.3.7-p2',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
],
1
],
[
'2.3.7-p3',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
],
0
],
[
'2.4.0',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
],
1
],
[
'2.4.1',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
],
1
],
[
'2.4.2',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
],
1
],
[
'2.4.3',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
],
0
],
[
'2.4.4',
[
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
],
0
],
];
}
}

0 comments on commit d980a6e

Please sign in to comment.