Skip to content

Commit

Permalink
Merge pull request #117 from creative-commoners/pulls/1.17/graphql-co…
Browse files Browse the repository at this point in the history
…nsts

FIX Use installer 5.3 with graphql 5.2
  • Loading branch information
GuySartorelli authored Jan 21, 2025
2 parents 00933af + 2079660 commit 5c4a42e
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 3 deletions.
6 changes: 5 additions & 1 deletion consts.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@
'silverstripe-environmentcheck' => '3.0',
'silverstripe-externallinks' => '3.2',
'silverstripe-fluent' => '7.1',
'silverstripe-graphql' => '5.2',
// GraphQL is commented out here to ensure that it's installed using
// installer 5.3, instead of installer 5.2
// This is done because otherwise an elemental behat test will fail because
// it needs a fix which is in framework 5.3
// 'silverstripe-graphql' => '5.2',
'silverstripe-gridfield-bulk-editing-tools' => '4.0',
'silverstripe-gridfieldextensions' => '4.0',
'silverstripe-gridfieldqueuedexport' => '3.2',
Expand Down
5 changes: 3 additions & 2 deletions job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function getInstallerVersion(
foreach (INSTALLER_TO_REPO_MINOR_VERSIONS[$installerVersion] as $_repo => $_repoVersions) {
$repoVersions = is_array($_repoVersions) ? $_repoVersions : [$_repoVersions];
foreach ($repoVersions as $repoVersion) {
if ($this->repoName === $_repo && $repoVersion === preg_replace('#-release$#', '', $this->branch)) {
$thisBranch = preg_replace('#-release$#', '', $this->branch);
if ($this->repoName === $_repo && $thisBranch === $repoVersion) {
return $installerVersion . '.x-dev';
}
}
Expand Down Expand Up @@ -374,7 +375,7 @@ private function getListOfPhpVersionsByBranchName(): array
// Fallback to using a CMS major based on the version of PHP in composer.json
$json = $this->getComposerJsonContent();
if ($json) {
$php = $json->require->php ?? null;
$php = $json->require->php ?? '';
$php = str_replace('^', '', $php);
$cmsMajors = array_keys(MetaData::PHP_VERSIONS_FOR_CMS_RELEASES);
$cmsMajors = array_filter($cmsMajors, fn($v) => !str_contains($v, '.'));
Expand Down
97 changes: 97 additions & 0 deletions tests/JobCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,103 @@ public function provideCreateJson(): array
],
]
],
// test for graphql 5.2 which is used in both installer 5.3 and installer 5.2
// it should use installer 5.3.x-dev
[
implode("\n", [
$this->getGenericYml(),
<<<EOT
github_repository: 'myaccount/silverstripe-graphql'
github_my_ref: '5.2'
parent_branch: ''
EOT
]),
false,
false,
false,
[
[
'installer_version' => '5.3.x-dev',
'php' => '8.1',
'db' => DB_MYSQL_57,
'composer_require_extra' => '',
'composer_args' => '--prefer-lowest',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.1 prf-low mysql57 phpunit all',
],
[
'installer_version' => '5.3.x-dev',
'php' => '8.2',
'db' => DB_MARIADB,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.2 mariadb phpunit all',
],
[
'installer_version' => '5.3.x-dev',
'php' => '8.3',
'db' => DB_MYSQL_80,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.3 mysql80 phpunit all',
],
[
'installer_version' => '5.3.x-dev',
'php' => '8.3',
'db' => DB_MYSQL_84,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
'phpunit' => 'true',
'phpunit_suite' => 'all',
'phplinting' => 'false',
'phpcoverage' => 'false',
'endtoend' => 'false',
'endtoend_suite' => 'root',
'endtoend_config' => '',
'endtoend_tags' => '',
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.3 mysql84 phpunit all',
],
]
],
];
}

Expand Down

0 comments on commit 5c4a42e

Please sign in to comment.