From 98d8db03ed21ee6a115ed7a64e17ac1233d6eda5 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Sat, 13 Jun 2026 12:49:08 +0200 Subject: [PATCH 1/3] CI: clone MediaWiki with git instead of wget+tar GitHub recently converted older MediaWiki release refs (REL1_39 through REL1_42, plus all old extension/skin branches down to REL1_20) from branches to tags, leaving both refs in place under the same name. The bare `archive/.tar.gz` URL form now returns HTTP 300 Multiple Choices for those names instead of a tarball: the given path has multiple possibilities: #, # The master matrix only covers REL1_43+ so this isn't surfacing today, but the bare URL form is a latent hazard as future versions move through the same conversion. Switching to `git clone --depth 1 --branch ` resolves either ref form transparently and is robust to whatever Wikimedia does with the refs next. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/installWiki.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/installWiki.sh b/.github/workflows/installWiki.sh index 4439067..bc3e4ce 100644 --- a/.github/workflows/installWiki.sh +++ b/.github/workflows/installWiki.sh @@ -3,10 +3,7 @@ MW_BRANCH=$1 EXTENSION_NAME=$2 -wget https://github.com/wikimedia/mediawiki/archive/$MW_BRANCH.tar.gz -nv - -tar -zxf $MW_BRANCH.tar.gz -mv mediawiki-$MW_BRANCH mediawiki +git clone --depth 1 --branch ${MW_BRANCH} https://github.com/wikimedia/mediawiki.git mediawiki cd mediawiki From 34e81f52ecf6a2fb49bd254b7a954728675648a8 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Sat, 13 Jun 2026 12:49:35 +0200 Subject: [PATCH 2/3] CI: drop redundant wget for phpunit.xml.template MediaWiki marks phpunit.xml.template with `export-ignore` in `.gitattributes`, which excludes it from `git archive` output (and therefore from GitHub's `archive/.tar.gz` tarball endpoint). That's why the new-runner code path had to fetch it separately, and why the existing inline TODO anticipated this cleanup. `git clone` does not honour `export-ignore`; the file is in the working tree after a normal checkout. With installWiki.sh now using `git clone`, the separate wget for the template becomes dead code. Drop it. Bump the cache key to invalidate existing wget-era entries (which lack `phpunit.xml.template` because they were populated from the archive tarball); without the bump, on every cache hit the file would be absent and `composer phpunit:config` would fail. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4e7ac3..c7157f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: mediawiki !mediawiki/extensions/ !mediawiki/vendor/ - key: mw_${{ matrix.mw }}-php${{ matrix.php }} + key: mw_${{ matrix.mw }}-php${{ matrix.php }}-v2 - name: Cache Composer cache uses: actions/cache@v4 @@ -90,11 +90,5 @@ jobs: - name: Run PHPUnit (MW master) if: matrix.mw == 'master' run: | - # TODO: phpunit.xml.template is export-ignored from GitHub's tarball - # archive, so we fetch it separately. Remove this once installWiki.sh - # switches to `git clone`, or MW drops the export-ignore. - if [ ! -f phpunit.xml.template ]; then - wget -q -O phpunit.xml.template "https://raw.githubusercontent.com/wikimedia/mediawiki/${{ matrix.mw }}/phpunit.xml.template" - fi composer phpunit:config vendor/bin/phpunit --group extension-bootstrap From 2ca5a601f13c45a0227356bf205de7dd25607bdc Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Sat, 13 Jun 2026 13:47:54 +0200 Subject: [PATCH 3/3] CI: add MediaWiki 1.46 and detect the PHPUnit runner MediaWiki 1.46 removed the tests/phpunit/phpunit.php legacy entry point in favour of vendor/bin/phpunit with phpunit.xml generated by composer phpunit:config. Consolidate the previously-split "MW < master" and "MW master" PHPUnit steps into a single step that detects which runner is available at the file-existence level, matching the pattern already in use in Chameleon and BootstrapComponents. Add REL1_46 to the matrix as a non-experimental row (it now passes with the new runner) and drop the duplicate master/PHP 8.4 row in favour of REL1_46/PHP 8.4 + master/PHP 8.5. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/ci.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7157f1..e7af5d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,9 @@ jobs: - mw: 'REL1_45' php: 8.3 experimental: false - - mw: 'master' + - mw: 'REL1_46' php: 8.4 - experimental: true + experimental: false - mw: 'master' php: 8.5 experimental: true @@ -80,15 +80,12 @@ jobs: - name: Composer update run: composer update - # "master" currently tracks MW >= 1.46, where tests/phpunit/phpunit.php - # was removed. Once REL1_46 lands in the matrix, it needs the master - # invocation below as well. - - name: Run PHPUnit (MW < master) - if: matrix.mw != 'master' - run: php tests/phpunit/phpunit.php -c extensions/Bootstrap/ - - - name: Run PHPUnit (MW master) - if: matrix.mw == 'master' + - name: Run PHPUnit run: | - composer phpunit:config - vendor/bin/phpunit --group extension-bootstrap + if [ -f tests/phpunit/phpunit.php ]; then + php tests/phpunit/phpunit.php -c extensions/Bootstrap/ + else + # MW 1.46 and later + composer phpunit:config + vendor/bin/phpunit --group extension-bootstrap + fi