Skip to content

Commit 823972b

Browse files
authored
Merge branch 'develop' into MCLOUD-6235
2 parents 4502b75 + 4e3547d commit 823972b

File tree

72 files changed

+1045
-361
lines changed

Some content is hidden

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

72 files changed

+1045
-361
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/ece-tools",
33
"description": "Provides tools to build and deploy Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "2002.1.0",
5+
"version": "2002.1.1",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {

config/schema.error.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
step: validate-config
440440
type: warning
441441
!php/const Magento\MagentoCloud\App\Error::WARN_NOT_CORRECT_LOCAL_XML_FILE:
442-
title: 'Invalid file config ./pub/errors/local.xml'
442+
title: 'Invalid configuration in the ./pub/errors/local.xml file.'
443443
stage: deploy
444444
step: validate-config
445445
type: warning
@@ -544,7 +544,7 @@
544544
step: 'install-update:split-db'
545545
type: warning
546546
!php/const Magento\MagentoCloud\App\Error::WARN_NOT_ENOUGH_DATA_SPLIT_DB_VAR:
547-
title: 'The SPLIT_DB variable does not have data which were already split.'
547+
title: 'The SPLIT_DB variable is missing the configuration for split connection types.'
548548
stage: deploy
549549
step: 'install-update:split-db'
550550
type: warning

config/schema.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,20 @@ variables:
643643
- stage:
644644
global:
645645
X_FRAME_CONFIGURATION: SAMEORIGIN
646+
QUALITY_PATCHES:
647+
description: Specify a list of Magento quality patches that will be applied during deployment.
648+
type: array
649+
stages:
650+
- build
651+
default:
652+
build: []
653+
examples:
654+
- stage:
655+
build:
656+
QUALITY_PATCHES:
657+
- MC-31387
658+
- MDVA-4567
659+
- MC-45634
646660

647661
# Environment variables
648662
ENV_RELATIONSHIPS:

dist/error-codes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
| 2001 | pre-deploy:cache | Cache is configured for a Redis service that is not available. Configuration will be ignored. | |
122122
| 2002 | validate-config | The configured state is not ideal | |
123123
| 2003 | validate-config | The directory nesting level value for error reporting has not been configured | |
124-
| 2004 | validate-config | Invalid file config ./pub/errors/local.xml | |
124+
| 2004 | validate-config | Invalid configuration in the ./pub/errors/local.xml file. | |
125125
| 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. |
126126
| 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. |
127127
| 2007 | validate-config | Update php version to recommended version | |
@@ -141,7 +141,7 @@
141141
| 2021 | install-update:db-connection | For split databases used custom connections | |
142142
| 2022 | install-update:db-connection | You have changed to a database configuration that is not compatible with the slave connection. | |
143143
| 2023 | install-update:split-db | Enabling a split database will be skipped. | |
144-
| 2024 | install-update:split-db | The SPLIT_DB variable does not have data which were already split. | |
144+
| 2024 | install-update:split-db | The SPLIT_DB variable is missing the configuration for split connection types. | |
145145
| 2025 | install-update:split-db | Slave connection not set. | |
146146

147147
### Post-deploy stage

scenario/deploy.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<arguments>
66
<argument name="logger" xsi:type="object">Psr\Log\LoggerInterface</argument>
77
<argument name="steps" xsi:type="array">
8+
<item name="restore-patch-log" xsi:type="object" priority="25">Magento\MagentoCloud\Step\Deploy\PreDeploy\RestorePatchLog</item>
89
<item name="check-state" xsi:type="object" priority="50">Magento\MagentoCloud\Step\Deploy\PreDeploy\CheckState</item>
910
<item name="cache" xsi:type="object" priority="100">Magento\MagentoCloud\Step\Deploy\PreDeploy\ConfigUpdate\Cache</item>
1011
<item name="clean-static-content" xsi:type="object" priority="200">Magento\MagentoCloud\Step\Deploy\PreDeploy\CleanStaticContent</item>

src/Command/Dev/UpdateComposer/ComposerGenerator.php

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
*/
1818
class ComposerGenerator
1919
{
20+
/**
21+
* Types of supported Magento component packages
22+
*/
23+
private const COMPONENT_PACKAGE_TYPES = [
24+
'magento2-module',
25+
'magento2-theme',
26+
'magento2-language',
27+
'magento2-library'
28+
];
29+
2030
/**
2131
* @var DirectoryList
2232
*/
@@ -81,10 +91,13 @@ public function generate(array $repoOptions): array
8191
$baseRepoFolder = $this->directoryList->getMagentoRoot() . '/' . $repoDir;
8292

8393
$dirComposerJson = $baseRepoFolder . '/composer.json';
94+
$isModuleRoot = false;
8495
if ($this->file->isExists($dirComposerJson)) {
8596
$dirPackageInfo = json_decode($this->file->fileGetContents($dirComposerJson), true);
86-
if (isset($dirPackageInfo['type']) && $dirPackageInfo['type'] == 'project') {
97+
if ($this->isProjectPackage($dirPackageInfo)) {
8798
$composer['require'] = array_merge($composer['require'], $dirPackageInfo['require']);
99+
} elseif ($this->isComponentPackage($dirPackageInfo)) {
100+
$isModuleRoot = true;
88101
}
89102
}
90103

@@ -99,12 +112,16 @@ public function generate(array $repoOptions): array
99112
];
100113
$composer['require'][$packageName] = '*@dev';
101114
}
102-
$excludeRepoStr = empty($repoPackages) ? '' : "--exclude='" . join("' --exclude='", $repoPackages) . "' ";
103-
$preparePackagesScripts[] = sprintf(
104-
"rsync -azhm --stats $excludeRepoStr--exclude='dev/tests' --exclude='.git' " .
105-
"--exclude='composer.json' --exclude='composer.lock' ./%s/ ./",
106-
$repoDir
107-
);
115+
if (!$isModuleRoot) {
116+
$excludeRepoStr = empty($repoPackages)
117+
? ''
118+
: "--exclude='" . join("' --exclude='", $repoPackages) . "' ";
119+
$preparePackagesScripts[] = sprintf(
120+
"rsync -azhm --stats $excludeRepoStr--exclude='dev/tests' --exclude='.git' " .
121+
"--exclude='composer.json' --exclude='composer.lock' ./%s/ ./",
122+
$repoDir
123+
);
124+
}
108125
}
109126
$composer['scripts']['prepare-packages'] = $preparePackagesScripts;
110127
$composer['scripts']['post-install-cmd'] = ['@prepare-packages'];
@@ -208,7 +225,6 @@ private function getBaseComposer(array $repoOptions): array
208225
private function findPackages(string $path)
209226
{
210227
$path = rtrim($path, '\\/');
211-
$packageTypes = ['magento2-module', 'magento2-theme', 'magento2-language', 'magento2-library'];
212228
$pathLength = strlen($path . '/');
213229

214230
$dirIterator = $this->file->getRecursiveFileIterator(
@@ -219,11 +235,33 @@ private function findPackages(string $path)
219235
$packages = [];
220236
foreach ($dirIterator as $currentFileInfo) {
221237
$packageInfo = json_decode($this->file->fileGetContents($currentFileInfo->getPathName()), true);
222-
if (isset($packageInfo['type']) && in_array($packageInfo['type'], $packageTypes)) {
238+
if ($this->isComponentPackage($packageInfo)) {
223239
$packages[$packageInfo['name']] = substr($currentFileInfo->getPath(), $pathLength);
224240
}
225241
}
226242

227243
return $packages;
228244
}
245+
246+
/**
247+
* Check if provided package info belongs to a Magento component package
248+
*
249+
* @param array $packageInfo
250+
* @return bool
251+
*/
252+
private function isComponentPackage(array $packageInfo): bool
253+
{
254+
return isset($packageInfo['type']) && in_array($packageInfo['type'], self::COMPONENT_PACKAGE_TYPES);
255+
}
256+
257+
/**
258+
* Check if provided package info belongs to a Magento project package
259+
*
260+
* @param array $packageInfo
261+
* @return bool
262+
*/
263+
private function isProjectPackage(array $packageInfo): bool
264+
{
265+
return isset($packageInfo['type']) && $packageInfo['type'] == 'project';
266+
}
229267
}

src/Command/ErrorShow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787
} else {
8888
$errors = $this->reader->read();
8989
if (empty($errors)) {
90-
$output->writeln('The error log is empty or doesn\'t exist');
90+
$output->writeln('The error log is empty or does not exist');
9191

9292
return 1;
9393
}

src/Config/Schema/Validator/SplitDb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function validate(string $key, $value): ResultInterface
3737
if (array_diff($value, DeployInterface::SPLIT_DB_VALUES)) {
3838
return $this->resultFactory->error(sprintf(
3939
'The %s variable contains the invalid value. '
40-
. 'It should be array with next available values: [%s].',
40+
. 'It should be an array with following values: [%s].',
4141
$key,
4242
implode(', ', DeployInterface::SPLIT_DB_VALUES)
4343
));

src/Config/Stage/BuildInterface.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ interface BuildInterface extends StageConfigInterface
2222
public const VAR_ERROR_REPORT_DIR_NESTING_LEVEL = 'ERROR_REPORT_DIR_NESTING_LEVEL';
2323

2424
/**
25-
* Perfom Baler JS bundling
25+
* Perform Baler JS bundling
2626
*/
2727
public const VAR_SCD_USE_BALER = 'SCD_USE_BALER';
28+
29+
/**
30+
* Magento quality patches list
31+
*/
32+
public const VAR_QUALITY_PATCHES = 'QUALITY_PATCHES';
2833
}

src/Config/Validator/Deploy/DebugLogging.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public function validate(): ResultInterface
6666

6767
return $this->resultFactory->error(
6868
'Debug logging is enabled in Magento',
69-
'To save space in Magento Cloud, '
70-
. 'debug logging should not be enabled for your production environments.',
69+
'To save space in Magento Cloud, disable debug logging for your production environments.',
7170
Error::WARN_DEBUG_LOG_ENABLED
7271
);
7372
}

0 commit comments

Comments
 (0)