From a8ce88621217ea9ce5cc0997532e098fe6702b02 Mon Sep 17 00:00:00 2001 From: Heather Guthrie Date: Wed, 5 Apr 2023 11:59:43 -0500 Subject: [PATCH 1/3] 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 6c0cd68bc..2e57576a2 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 1d8e3fb82..5317b4d4f 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 128b9e3d0..d56f5cf1a 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 f33ba0437..22739dbab 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 2/3] 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 22739dbab..b1f002e0e 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 3/3] 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 b1f002e0e..c70f3047e 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) );