From ed9d9d201bcbf289ca1c2938357bee002a1388c8 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 8 May 2024 15:26:19 +1200 Subject: [PATCH 1/2] ENH Update reference to supported modules data --- composer.json | 3 ++- src/Translator.php | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 0b4d8c5..8d573cc 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ } ], "require": { - "php": "^7.4 || ^8.1", + "php": "^8.1", + "silverstripe/supported-modules": "dev-main", "symfony/console": "^4 || ^5 || ^6", "symfony/process": "^4 || ^5 || ^6", "symfony/yaml": "^4 || ^5 || ^6", diff --git a/src/Translator.php b/src/Translator.php index c6a64a9..8415508 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -9,6 +9,7 @@ use RuntimeException; use LogicException; use Symfony\Component\Console\Formatter\OutputFormatter; +use SilverStripe\SupportedModules\MetaData; class Translator { @@ -150,15 +151,16 @@ private function getFrameworkMajor(): string private function setModulePaths(): void { - $client = new Client(); $cmsMajor = $this->getFrameworkMajor(); - $url = "https://raw.githubusercontent.com/silverstripe/supported-modules/$cmsMajor/modules.json"; - $body = (string) $client->request('GET', $url)->getBody(); + $modules = MetaData::removeReposNotInCmsMajor( + MetaData::getAllRepositoryMetaData()[MetaData::CATEGORY_SUPPORTED], + $cmsMajor + ); $supportedVendors = []; $supportedModules = []; - foreach ($this->jsonDecode($body) as $data) { - $supportedModules[] = $data['composer']; - $supportedVendors[] = explode('/', $data['composer'])[0]; + foreach ($modules as $module) { + $supportedModules[] = $module['packagist']; + $supportedVendors[] = explode('/', $module['packagist'])[0]; } $vendorDir = dirname(dirname(dirname(__DIR__))); foreach ($this->scandir($vendorDir) as $vendor) { From da502436584c89d6373bc99093e8a120236491f2 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 8 May 2024 15:51:34 +1200 Subject: [PATCH 2/2] MNT Use regular CI Required both for using a correct PHP version and making sure patches get auto-tagged --- .github/workflows/ci.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e7a4da..bf02210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,30 +4,8 @@ on: push: pull_request: workflow_dispatch: - # Every Tuesday at 2:00pm UTC - schedule: - - cron: '0 14 * * 2' jobs: - build: + ci: name: CI - runs-on: ubuntu-latest - steps: - - - name: Checkout code - uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2.4.2 - - - name: Install PHP - uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1 - with: - php-version: 7.4 - tools: composer:v2 - - - name: Composer install - run: composer install - - - name: PHPUnit - run: vendor/bin/phpunit - - - name: PHP linting - run: vendor/bin/phpcs + uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1