Skip to content

Commit 62f8e1f

Browse files
authored
Merge pull request #33 from magento-commerce/develop
Merge develop into 1.0
2 parents ac81526 + 3410bcc commit 62f8e1f

Some content is hidden

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

45 files changed

+1424
-478
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/magento-cloud-patches",
33
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "1.0.10",
5+
"version": "1.0.11",
66
"license": "OSL-3.0",
77
"require": {
88
"php": "^7.0",

config/patch-categories.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"name": "Performance"
4+
},
5+
{
6+
"name": "Web API"
7+
},
8+
{
9+
"name": "GraphQL"
10+
},
11+
{
12+
"name": "B2B"
13+
},
14+
{
15+
"name": "Content"
16+
},
17+
{
18+
"name": "Fastly/Varnish"
19+
},
20+
{
21+
"name": "Redis/Memcache"
22+
},
23+
{
24+
"name": "Cron"
25+
},
26+
{
27+
"name": "Inventory"
28+
},
29+
{
30+
"name": "Elasticsearch"
31+
},
32+
{
33+
"name": "Import/Export"
34+
},
35+
{
36+
"name": "Catalog/Product"
37+
},
38+
{
39+
"name": "Catalog Search"
40+
},
41+
{
42+
"name": "Payments"
43+
},
44+
{
45+
"name": "Reports"
46+
},
47+
{
48+
"name": "Customer"
49+
},
50+
{
51+
"name": "Shipping"
52+
},
53+
{
54+
"name": "Order"
55+
},
56+
{
57+
"name": "Shopping Cart"
58+
},
59+
{
60+
"name": "Emails"
61+
},
62+
{
63+
"name": "Admin"
64+
},
65+
{
66+
"name": "Other"
67+
}
68+
]

config/services.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,29 @@
8787
<argument type="service" id="Magento\CloudPatches\Shell\Command\PatchDriver"/>
8888
</argument>
8989
</service>
90+
<service id="Magento\CloudPatches\Patch\Collector\SupportCollector">
91+
<argument key="$getPatchesConfig" type="service" id="Magento\CloudPatches\Patch\Collector\GetSupportPatchesConfig"/>
92+
</service>
93+
<service id="Magento\CloudPatches\Patch\Collector\CommunityCollector">
94+
<argument key="$getPatchesConfig" type="service" id="Magento\CloudPatches\Patch\Collector\GetCommunityPatchesConfig"/>
95+
</service>
96+
<service id="Magento\CloudPatches\Patch\GetCategoriesList">
97+
<argument key="$providers" type="collection">
98+
<argument type="service" id="Magento\CloudPatches\Patch\CategoriesList\GetLocalPatchCategories"/>
99+
<argument type="service" id="Magento\CloudPatches\Patch\CategoriesList\GetSupportPatchCategories"/>
100+
</argument>
101+
</service>
102+
<service id="Magento\CloudPatches\Patch\Pool\OptionalPool">
103+
<argument key="$collectors" type="collection">
104+
<argument type="service" id="Magento\CloudPatches\Patch\Collector\CloudCollector"/>
105+
<argument type="service" id="Magento\CloudPatches\Patch\Collector\SupportCollector"/>
106+
<argument type="service" id="Magento\CloudPatches\Patch\Collector\CommunityCollector"/>
107+
</argument>
108+
</service>
109+
<service id="Magento\CloudPatches\Patch\Pool\RequiredPool">
110+
<argument key="$collectors" type="collection">
111+
<argument type="service" id="Magento\CloudPatches\Patch\Collector\CloudCollector"/>
112+
</argument>
113+
</service>
90114
</services>
91115
</container>

patches.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
},
236236
"Pagination Not working - product_list_limit=all": {
237237
">=2.3.2 <2.3.4": "MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.2.patch",
238-
">=2.3.4 <2.4.0": "MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.4.patch"
238+
">=2.3.4 <2.3.6": "MCLOUD-5684__pagination_not_working_product_list_limit_all__2.3.4.patch"
239239
},
240240
"Sitemap Generation Warnings": {
241241
">=2.3.0 <2.3.2": "MCLOUD-3025__sitemap_generation_warnings__2.3.0.patch",

src/Command/Process/Action/ApplyOptionalAction.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\CloudPatches\App\RuntimeException;
1111
use Magento\CloudPatches\Command\Process\Renderer;
12+
use Magento\CloudPatches\Patch\Collector\SupportCollector;
1213
use Magento\CloudPatches\Patch\Conflict\Processor as ConflictProcessor;
1314
use Magento\CloudPatches\Patch\Pool\OptionalPool;
1415
use Magento\CloudPatches\Patch\Applier;
@@ -24,6 +25,7 @@
2425
* Applies optional patches.
2526
*
2627
* Patches are applying from top to bottom of config list.
28+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2729
*/
2830
class ApplyOptionalAction implements ActionInterface
2931
{
@@ -139,7 +141,7 @@ private function getPatchList(array $patchFilter): array
139141
{
140142
if (empty($patchFilter)) {
141143
return array_filter(
142-
$this->optionalPool->getOptionalAll(),
144+
$this->optionalPool->getOptionalListByOrigin([SupportCollector::ORIGIN]),
143145
function ($patch) {
144146
return !$patch->isDeprecated();
145147
}

src/Command/Process/Action/ReviewAppliedAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\CloudPatches\Command\Process\Action;
99

10+
use Magento\CloudPatches\Patch\Collector\SupportCollector;
1011
use Magento\CloudPatches\Patch\Pool\OptionalPool;
1112
use Magento\CloudPatches\Patch\Status\StatusPool;
1213
use Psr\Log\LoggerInterface;
@@ -59,7 +60,7 @@ public function __construct(
5960
public function execute(InputInterface $input, OutputInterface $output, array $patchFilter)
6061
{
6162
$appliedOptionalPatches = array_filter(
62-
$this->optionalPool->getOptionalAll(),
63+
$this->optionalPool->getOptionalListByOrigin([SupportCollector::ORIGIN]),
6364
function ($patch) {
6465
return $this->statusPool->isApplied($patch->getId());
6566
}

src/Command/Process/Renderer.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\CloudPatches\Console\ConfirmationQuestionFactory;
1111
use Magento\CloudPatches\Console\TableFactory;
12+
use Magento\CloudPatches\Patch\Collector\CommunityCollector;
1213
use Magento\CloudPatches\Patch\Data\AggregatedPatchInterface;
1314
use Magento\CloudPatches\Patch\Data\PatchInterface;
1415
use Magento\CloudPatches\Patch\Status\StatusPool;
@@ -26,6 +27,10 @@ class Renderer
2627

2728
const TITLE = 'Title';
2829

30+
const CATEGORY = 'Category';
31+
32+
const ORIGIN = 'Origin';
33+
2934
const TYPE = 'Type';
3035

3136
const STATUS = 'Status';
@@ -80,7 +85,7 @@ public function __construct(
8085
public function printTable(OutputInterface $output, array $patchList)
8186
{
8287
$table = $this->tableFactory->create($output);
83-
$table->setHeaders([self::ID, self::TITLE, self::TYPE, self::STATUS, self::DETAILS]);
88+
$table->setHeaders([self::ID, self::TITLE, self::CATEGORY, self::ORIGIN, self::STATUS, self::DETAILS]);
8489
$table->setStyle('box-double');
8590

8691
$rows = [];
@@ -89,6 +94,9 @@ public function printTable(OutputInterface $output, array $patchList)
8994
}
9095

9196
usort($rows, function ($a, $b) {
97+
if ($a[self::STATUS] === $b[self::STATUS]) {
98+
return strcmp($a[self::ORIGIN], $b[self::ORIGIN]);
99+
}
92100
return strcmp($a[self::STATUS], $b[self::STATUS]);
93101
});
94102

@@ -165,7 +173,10 @@ public function printQuestion(InputInterface $input, OutputInterface $output, st
165173
*/
166174
private function createRow(AggregatedPatchInterface $patch): array
167175
{
168-
$details = '';
176+
$details = 'Patch type: '
177+
. ($patch->isDeprecated() ? '<error>DEPRECATED</error>' : $patch->getType())
178+
. PHP_EOL;
179+
169180
if ($patch->getReplacedWith()) {
170181
$details .= '<info>Recommended replacement: ' . $patch->getReplacedWith() . '</info>' . PHP_EOL;
171182
}
@@ -191,7 +202,8 @@ function ($item) {
191202
return [
192203
self::ID => '<comment>' . $id . '</comment>',
193204
self::TITLE => $title,
194-
self::TYPE => $patch->isDeprecated() ? '<error>DEPRECATED</error>' : $patch->getType(),
205+
self::CATEGORY => implode(PHP_EOL, $patch->getCategories()),
206+
self::ORIGIN => $patch->getOrigin(),
195207
self::STATUS => $this->statusPool->get($patch->getId()),
196208
self::DETAILS => $details
197209
];

0 commit comments

Comments
 (0)