Skip to content

Commit fe29ac8

Browse files
authored
MCLOUD-8548: Fix the service validator for ElasticSearch (#86)
1 parent 798d06f commit fe29ac8

File tree

3 files changed

+62
-9
lines changed

3 files changed

+62
-9
lines changed

src/Command/Dev/GenerateSchemaError.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ private function generateDocs(array $errors): string
168168
public function getErrorTypeDescription(): array
169169
{
170170
return [
171-
'critical' => 'Critical errors indicate a problem with the Commerce on cloud infrastructure project configuration ' .
172-
'that causes deployment failure, for example incorrect, unsupported, or missing configuration for ' .
173-
'required settings. Before you can deploy, you must update the configuration to resolve these errors.',
174-
'warning' => 'Warning errors indicate a problem with the Commerce on cloud infrastructure project configuration ' .
175-
'such as incorrect, deprecated, unsupported, or missing configuration settings for optional features ' .
176-
'that can affect site operation. Although a warning does not cause deployment failure, you ' .
177-
'should review warning messages and update the configuration to resolve them.',
171+
'critical' => 'Critical errors indicate a problem with the Commerce on cloud infrastructure project ' .
172+
'configuration that causes deployment failure, for example incorrect, unsupported, or missing ' .
173+
'configuration for required settings. Before you can deploy, you must update the configuration ' .
174+
'to resolve these errors.',
175+
'warning' => 'Warning errors indicate a problem with the Commerce on cloud infrastructure project ' .
176+
'configuration such as incorrect, deprecated, unsupported, or missing configuration settings for ' .
177+
'optional features that can affect site operation. Although a warning does not cause deployment ' .
178+
'failure, you should review warning messages and update the configuration to resolve them.',
178179
];
179180
}
180181
}

src/Service/Validator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ class Validator
6666
'>=2.2.0 <2.2.8 || 2.3.0' => '~1.7.0 || ~2.4.0 || ~5.2.0',
6767
'>=2.2.8 <2.3.0 || >=2.3.1 <2.3.5' => '~1.7.0 || ~2.4.0 || ~5.2.0 || ~6.5.0',
6868
'>=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',
69-
'>=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' .
69+
'>=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' .
7070
' || ~7.9.0',
71+
'>=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' .
72+
' || ~7.9.0 || ~7.10.0',
7173
'>=2.4.0 <2.4.2' => '~7.5.0 || ~7.6.0 || ~7.7.0',
72-
'>=2.4.2' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0',
74+
'>=2.4.2 <2.4.3' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0',
75+
'>=2.4.3' => '~7.5.0 || ~7.6.0 || ~7.7.0 || ~7.9.0 || ~7.10.0',
7376
],
7477
ServiceInterface::NAME_OPENSEARCH => [
7578
'>=2.3.7-p3 <2.4.0 || >=2.4.3-p2' => '~1.1 || ~1.2.1',

src/Test/Unit/Service/ValidatorTest.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,55 @@ public function validateVersionsDataProvider(): array
332332
],
333333
0
334334
],
335+
[
336+
'2.3.7-p2',
337+
[
338+
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
339+
],
340+
1
341+
],
342+
[
343+
'2.3.7-p3',
344+
[
345+
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
346+
],
347+
0
348+
],
349+
[
350+
'2.4.0',
351+
[
352+
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
353+
],
354+
1
355+
],
356+
[
357+
'2.4.1',
358+
[
359+
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
360+
],
361+
1
362+
],
363+
[
364+
'2.4.2',
365+
[
366+
ServiceInterface::NAME_ELASTICSEARCH => '7.10' //wrong
367+
],
368+
1
369+
],
370+
[
371+
'2.4.3',
372+
[
373+
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
374+
],
375+
0
376+
],
377+
[
378+
'2.4.4',
379+
[
380+
ServiceInterface::NAME_ELASTICSEARCH => '7.10'
381+
],
382+
0
383+
],
335384
];
336385
}
337386
}

0 commit comments

Comments
 (0)