From 501096b90c946fd6ce15ea9cc0dfb40c39148b98 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 31 Jan 2024 17:48:30 +1300 Subject: [PATCH] FIX Use installer for silverstripe/serve and silverstripe/behat-extension --- consts.php | 6 ++++++ job_creator.php | 3 ++- tests/JobCreatorTest.php | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/consts.php b/consts.php index 53d8c69..3ba697c 100644 --- a/consts.php +++ b/consts.php @@ -102,6 +102,12 @@ 'silverstripe-config', ]; +// Repositories that either don't have a composer type or have a weird composer type, though we still want installer +const FORCE_INSTALLER_UNLOCKEDSTEPPED_REPOS = [ + 'silverstripe-behat-extension', + 'silverstripe-serve', +]; + const CMS_TO_REPO_MAJOR_VERSIONS = [ '4' => [ 'recipe-authoring-tools' => '1', diff --git a/job_creator.php b/job_creator.php index 6cb0289..d5d075d 100644 --- a/job_creator.php +++ b/job_creator.php @@ -58,7 +58,7 @@ public function getInstallerVersion(): string } } } - if (file_exists($this->composerJsonPath)) { + if (file_exists($this->composerJsonPath) && !in_array($this->repoName, FORCE_INSTALLER_UNLOCKEDSTEPPED_REPOS)) { $json = json_decode(file_get_contents($this->composerJsonPath)); // We shouldn't try to infer the installer version for regular repositories // that weren't already detected via the const-based logic above @@ -67,6 +67,7 @@ public function getInstallerVersion(): string 'silverstripe-module', 'silverstripe-recipe', 'silverstripe-theme', + ]; if (!isset($json->type) || !in_array($json->type, $silverstripeRepoTypes)) { return ''; diff --git a/tests/JobCreatorTest.php b/tests/JobCreatorTest.php index 7a1fa70..f1c9a50 100644 --- a/tests/JobCreatorTest.php +++ b/tests/JobCreatorTest.php @@ -146,6 +146,9 @@ public function provideGetInstallerVersion(): array ['myaccount/silverstripe-html5', '2.3', '4.10.x-dev'], ['myaccount/silverstripe-html5', '2.4', '4.11.x-dev'], ['myaccount/silverstripe-html5', 'burger', $currentMinor], + // force installer unlockedstepped repo + ['myaccount/silverstripe-serve', '2', $nextMinor], + ['myaccount/silverstripe-behat-extension', '2', $nextMinor], ]; }