Skip to content

Commit ba77cab

Browse files
authored
MCLOUD-6144: Adjust service validators prior to 2.4.0 version (magento#737)
1 parent 2929eec commit ba77cab

File tree

5 files changed

+72
-10
lines changed

5 files changed

+72
-10
lines changed

config/eol.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ php:
88
eol: 2020-11-30
99
- version: '7.3'
1010
eol: 2021-12-06
11+
- version: '7.4'
12+
eol:
1113
mariadb:
1214
- version: '10.0'
1315
eol: 2019-03-31
1416
- version: '10.1'
1517
eol: 2020-10-17
1618
- version: '10.2'
1719
eol: 2022-05-23
20+
- version: '10.3'
21+
eol: 2023-05-25
22+
- version: '10.4'
23+
eol: 2024-06-18
1824
elasticsearch:
1925
- version: '1.7'
2026
eol: 2017-01-16
@@ -24,8 +30,16 @@ elasticsearch:
2430
eol: 2018-07-31
2531
- version: '6.5'
2632
eol: 2020-05-14
33+
- version: '6.8'
34+
eol: 2020-11-20
35+
- version: '7.2'
36+
eol: 2020-12-25
2737
- version: '7.5'
28-
eol: 2021-06-02
38+
eol: 2021-06-02
39+
- version: '7.6'
40+
eol: 2021-08-11
41+
- version: '7.7'
42+
eol: 2021-11-13
2943
rabbitmq:
3044
- version: '3.5'
3145
eol: 2016-10-31
@@ -37,8 +51,10 @@ redis:
3751
- version: '3.2'
3852
eol: 2018-10-17
3953
- version: '4.0'
40-
eol:
54+
eol: 2020-04-30
4155
- version: '5.0'
4256
eol:
4357
- version: '5.2'
4458
eol:
59+
- version: '6.0'
60+
eol:

src/Config/Validator/Deploy/ElasticSearchVersion.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,19 @@ class ElasticSearchVersion implements ValidatorInterface
7777
'esVersionRaw' => '6.x',
7878
],
7979
[
80-
'packageVersion' => '~7.0',
81-
'esVersion' => '~7.0',
82-
'esVersionRaw' => '7.x',
80+
'packageVersion' => '>=7.0 <7.2',
81+
'esVersion' => '>=7.0 <7.2',
82+
'esVersionRaw' => '>=7.0 <7.2',
83+
],
84+
[
85+
'packageVersion' => '>=7.2 <7.4',
86+
'esVersion' => '>=7.2 <7.4',
87+
'esVersionRaw' => '>=7.2 <7.4',
88+
],
89+
[
90+
'packageVersion' => '>=7.4',
91+
'esVersion' => '>=7.4',
92+
'esVersionRaw' => '>=7.4',
8393
],
8494
];
8595

src/Service/Validator.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ class Validator
2727
'>=2.2.5 <2.2.10' => '>=7.0 <7.2', //'~7.0.13|~7.1.0',
2828
'>=2.2.10 <2.3.0' => '>=7.1 <7.3', //'~7.1.0|~7.2.0',
2929
'>=2.3.0 <2.3.3' => '>=7.1 <7.3', //'~7.1.3 || ~7.2.0',
30-
'>=2.3.3' => '>=7.1 <7.4', // '~7.1.3||~7.2.0||~7.3.0'
30+
'>=2.3.3 <2.4.0' => '>=7.1 <7.4', // '~7.1.3||~7.2.0||~7.3.0'
31+
'>=2.4.0' => '>=7.3 <7.5', // '~7.3.0||~7.4.0'
3132
],
3233
ServiceInterface::NAME_DB => [
33-
'*' => '>=10.0 <10.3',
34+
'<2.4.0' => '>=10.0 <10.3',
35+
'>=2.4.0' => '>=10.2 <10.5',
3436
],
3537
ServiceInterface::NAME_NGINX => [
3638
'*' => '^1.9.0',
@@ -47,7 +49,8 @@ class Validator
4749
'<2.2.0' => '~1.7.0 || ~2.4.0',
4850
'>=2.2.0 <2.2.8 || 2.3.0' => '~1.7.0 || ~2.4.0 || ~5.2.0',
4951
'>=2.2.8 <2.3.0 || >=2.3.1 <2.3.5' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0',
50-
'>=2.3.5' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~7.5.0',
52+
'>=2.3.5 <2.4.0' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0 || ~6.8.0|| ~7.4.0 || ~7.5.0 || ~7.6.0 || ~7.7.0',
53+
'>=2.4.0' => '~7.4.0 || ~7.5.0 || ~7.6.0 || ~7.7.0',
5154
],
5255
ServiceInterface::NAME_RABBITMQ => [
5356
'<2.3.0' => '~3.5.0',

src/Test/Unit/Config/Validator/Deploy/ElasticSearchVersionTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,14 @@ public function validateDataProvider(): array
236236
['5.1', '5.0', Success::class],
237237
['5.2', '5.1', Success::class],
238238
['7.0', '7.1', Success::class],
239-
['7.4', '7.2', Success::class],
239+
['7.1', '7.0', Success::class],
240+
['7.2', '7.3', Success::class],
241+
['7.3', '7.2', Success::class],
242+
['7.4', '7.6', Success::class],
243+
['7.6', '7.4', Success::class],
244+
['7.4', '7.5', Success::class],
245+
['7.5', '7.4', Success::class],
246+
['7.4', '7.2', Error::class],
240247
['6.1', '2.0', Error::class],
241248
[
242249
'6.2',

src/Test/Unit/Service/ValidatorTest.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,42 @@ public function validateVersionsDataProvider(): array
144144
[
145145
'2.5.0',
146146
[
147-
ServiceInterface::NAME_PHP => '7.2.13',
147+
ServiceInterface::NAME_PHP => '7.2.13', // wrong
148148
ServiceInterface::NAME_DB => '10.2.1',
149149
ServiceInterface::NAME_NGINX => '1.9',
150150
ServiceInterface::NAME_VARNISH => '5.5',
151151
ServiceInterface::NAME_REDIS => 'latest',
152152
ServiceInterface::NAME_ELASTICSEARCH => '6.7', // wrong
153153
ServiceInterface::NAME_RABBITMQ => '3.7'
154154
],
155+
2
156+
],
157+
[
158+
'2.4.0',
159+
[
160+
ServiceInterface::NAME_PHP => '7.4',
161+
ServiceInterface::NAME_DB => '10.4',
162+
ServiceInterface::NAME_NGINX => '1.9',
163+
ServiceInterface::NAME_VARNISH => '6.2',
164+
ServiceInterface::NAME_REDIS => '5.0',
165+
ServiceInterface::NAME_ELASTICSEARCH => '6.8', // wrong
166+
ServiceInterface::NAME_RABBITMQ => '3.8'
167+
],
155168
1
156169
],
170+
[
171+
'2.4.0',
172+
[
173+
ServiceInterface::NAME_PHP => '7.4',
174+
ServiceInterface::NAME_DB => '10.4',
175+
ServiceInterface::NAME_NGINX => '1.9',
176+
ServiceInterface::NAME_VARNISH => '6.2',
177+
ServiceInterface::NAME_REDIS => '5.0',
178+
ServiceInterface::NAME_ELASTICSEARCH => '7.4', // wrong
179+
ServiceInterface::NAME_RABBITMQ => '3.8'
180+
],
181+
0
182+
],
157183
[
158184
'2.1.4',
159185
[ServiceInterface::NAME_PHP => '5.6'],

0 commit comments

Comments
 (0)