Skip to content

Commit 5c4a42e

Browse files
Merge pull request #117 from creative-commoners/pulls/1.17/graphql-consts
FIX Use installer 5.3 with graphql 5.2
2 parents 00933af + 2079660 commit 5c4a42e

File tree

3 files changed

+105
-3
lines changed

3 files changed

+105
-3
lines changed

consts.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@
417417
'silverstripe-environmentcheck' => '3.0',
418418
'silverstripe-externallinks' => '3.2',
419419
'silverstripe-fluent' => '7.1',
420-
'silverstripe-graphql' => '5.2',
420+
// GraphQL is commented out here to ensure that it's installed using
421+
// installer 5.3, instead of installer 5.2
422+
// This is done because otherwise an elemental behat test will fail because
423+
// it needs a fix which is in framework 5.3
424+
// 'silverstripe-graphql' => '5.2',
421425
'silverstripe-gridfield-bulk-editing-tools' => '4.0',
422426
'silverstripe-gridfieldextensions' => '4.0',
423427
'silverstripe-gridfieldqueuedexport' => '3.2',

job_creator.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function getInstallerVersion(
5656
foreach (INSTALLER_TO_REPO_MINOR_VERSIONS[$installerVersion] as $_repo => $_repoVersions) {
5757
$repoVersions = is_array($_repoVersions) ? $_repoVersions : [$_repoVersions];
5858
foreach ($repoVersions as $repoVersion) {
59-
if ($this->repoName === $_repo && $repoVersion === preg_replace('#-release$#', '', $this->branch)) {
59+
$thisBranch = preg_replace('#-release$#', '', $this->branch);
60+
if ($this->repoName === $_repo && $thisBranch === $repoVersion) {
6061
return $installerVersion . '.x-dev';
6162
}
6263
}
@@ -374,7 +375,7 @@ private function getListOfPhpVersionsByBranchName(): array
374375
// Fallback to using a CMS major based on the version of PHP in composer.json
375376
$json = $this->getComposerJsonContent();
376377
if ($json) {
377-
$php = $json->require->php ?? null;
378+
$php = $json->require->php ?? '';
378379
$php = str_replace('^', '', $php);
379380
$cmsMajors = array_keys(MetaData::PHP_VERSIONS_FOR_CMS_RELEASES);
380381
$cmsMajors = array_filter($cmsMajors, fn($v) => !str_contains($v, '.'));

tests/JobCreatorTest.php

+97
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,103 @@ public function provideCreateJson(): array
11441144
],
11451145
]
11461146
],
1147+
// test for graphql 5.2 which is used in both installer 5.3 and installer 5.2
1148+
// it should use installer 5.3.x-dev
1149+
[
1150+
implode("\n", [
1151+
$this->getGenericYml(),
1152+
<<<EOT
1153+
github_repository: 'myaccount/silverstripe-graphql'
1154+
github_my_ref: '5.2'
1155+
parent_branch: ''
1156+
EOT
1157+
]),
1158+
false,
1159+
false,
1160+
false,
1161+
[
1162+
[
1163+
'installer_version' => '5.3.x-dev',
1164+
'php' => '8.1',
1165+
'db' => DB_MYSQL_57,
1166+
'composer_require_extra' => '',
1167+
'composer_args' => '--prefer-lowest',
1168+
'name_suffix' => '',
1169+
'phpunit' => 'true',
1170+
'phpunit_suite' => 'all',
1171+
'phplinting' => 'false',
1172+
'phpcoverage' => 'false',
1173+
'endtoend' => 'false',
1174+
'endtoend_suite' => 'root',
1175+
'endtoend_config' => '',
1176+
'endtoend_tags' => '',
1177+
'js' => 'false',
1178+
'doclinting' => 'false',
1179+
'needs_full_setup' => 'true',
1180+
'name' => '8.1 prf-low mysql57 phpunit all',
1181+
],
1182+
[
1183+
'installer_version' => '5.3.x-dev',
1184+
'php' => '8.2',
1185+
'db' => DB_MARIADB,
1186+
'composer_require_extra' => '',
1187+
'composer_args' => '',
1188+
'name_suffix' => '',
1189+
'phpunit' => 'true',
1190+
'phpunit_suite' => 'all',
1191+
'phplinting' => 'false',
1192+
'phpcoverage' => 'false',
1193+
'endtoend' => 'false',
1194+
'endtoend_suite' => 'root',
1195+
'endtoend_config' => '',
1196+
'endtoend_tags' => '',
1197+
'js' => 'false',
1198+
'doclinting' => 'false',
1199+
'needs_full_setup' => 'true',
1200+
'name' => '8.2 mariadb phpunit all',
1201+
],
1202+
[
1203+
'installer_version' => '5.3.x-dev',
1204+
'php' => '8.3',
1205+
'db' => DB_MYSQL_80,
1206+
'composer_require_extra' => '',
1207+
'composer_args' => '',
1208+
'name_suffix' => '',
1209+
'phpunit' => 'true',
1210+
'phpunit_suite' => 'all',
1211+
'phplinting' => 'false',
1212+
'phpcoverage' => 'false',
1213+
'endtoend' => 'false',
1214+
'endtoend_suite' => 'root',
1215+
'endtoend_config' => '',
1216+
'endtoend_tags' => '',
1217+
'js' => 'false',
1218+
'doclinting' => 'false',
1219+
'needs_full_setup' => 'true',
1220+
'name' => '8.3 mysql80 phpunit all',
1221+
],
1222+
[
1223+
'installer_version' => '5.3.x-dev',
1224+
'php' => '8.3',
1225+
'db' => DB_MYSQL_84,
1226+
'composer_require_extra' => '',
1227+
'composer_args' => '',
1228+
'name_suffix' => '',
1229+
'phpunit' => 'true',
1230+
'phpunit_suite' => 'all',
1231+
'phplinting' => 'false',
1232+
'phpcoverage' => 'false',
1233+
'endtoend' => 'false',
1234+
'endtoend_suite' => 'root',
1235+
'endtoend_config' => '',
1236+
'endtoend_tags' => '',
1237+
'js' => 'false',
1238+
'doclinting' => 'false',
1239+
'needs_full_setup' => 'true',
1240+
'name' => '8.3 mysql84 phpunit all',
1241+
],
1242+
]
1243+
],
11471244
];
11481245
}
11491246

0 commit comments

Comments
 (0)