Skip to content

Fix CI: update mediawiki-codesniffer and drop MediaWiki 1.39 to 1.42 jobs - #195

Merged
malberts merged 2 commits into
masterfrom
fix/ci-codesniffer-52
Nov 12, 2026
Merged

malberts merged 2 commits into
masterfrom
fix/ci-codesniffer-52

Conversation

@alistair3149

@alistair3149 alistair3149 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Composer now refuses to install package versions with known security advisories, which broke this repository's CI: the code style and static analysis jobs fail installing mediawiki-codesniffer 40, and the MediaWiki 1.39 to 1.42 PHPUnit jobs fail installing MediaWiki itself. This updates mediawiki-codesniffer to 52, applies its new rules with phpcbf, and drops the 1.39 to 1.42 jobs.

Human input

Goal and shape: set by @alistair3149; Claude found the cause and made the changes within that shape.

  • Directions: "the WikibaseExport CI was already broken, not from this PR, we should fix it" (about Fix Special:WikibaseExport constructor on MediaWiki 1.46 and later #194).
  • Choices: updating mediawiki-codesniffer and dropping the MediaWiki 1.39 to 1.42 jobs, picked from three options Claude offered.
  • Alternatives @alistair3149 weighed: turning off Composer's advisory blocking in CI, as NeoWiki's CI does; updating mediawiki-codesniffer only, leaving the 1.39 to 1.42 jobs red.

Outcome: not reviewed by a human yet. Left for you: a skim of the phpcbf changes, and whether extension.json should keep declaring MediaWiki 1.39 as the minimum.

Claude's calls

  • Not discussed with @alistair3149: ^52.0.0, so installing the dev tools needs PHP 8.3; the extension itself still needs only PHP 8.0. All phpcbf fixes are kept, including the heredoc closers in WideCsvPresenterTest, whose comma now sits on the next line as the new comma-spacing rule requires.
  • Considered by Claude, omitted: raising requires.MediaWiki in extension.json to 1.43, a support decision separate from fixing CI; replacing the deprecated Generic.Formatting.NoSpaceAfterCast rule in phpcs.xml, which still runs but warns.
  • Where your judgment helps: whether to drop MediaWiki 1.39 to 1.42 from extension.json too, now that CI no longer tests them.

The change

  • .github/workflows/ci.yml: the PHPUnit matrix keeps only REL1_43.
  • composer.json: mediawiki-codesniffer ^40.0.0 → ^52.0.0.
  • 11 PHP files: phpcbf fixes only (static arrow functions, ?DataValue $value = null, catch on the closing-brace line, whitespace).

#194 also changes src/EntryPoints/SpecialWikibaseExport.php, in different lines; either can merge first.

Verification evidence
  • Master CI runs 42613730974 and 41441519760: code style and static analysis fail at "Composer install" (squizlabs/php_codesniffer[3.7.1] … affected by security advisories ("PKSA-rdkp-vv9z-mjkg")); PHPUnit REL1_39 to REL1_42 fail at "Install MediaWiki" (PHPUnit 9.6.16, Guzzle and mediawiki-codesniffer 43 blocked).
  • PKSA-rdkp-vv9z-mjkg affects php_codesniffer below 3.13.6; mediawiki-codesniffer 52.0.x requires 3.13.6.
  • Locally, PHP 8.3.36 and Composer 2.10.3 with advisory blocking on: composer install succeeds. vendor/bin/phpcs reported 14 errors and 9 warnings in 11 files, all fixed by phpcbf; afterwards it reports none. php -l passes on every changed file.
  • CI on this PR (pull_request run 43255527350, push run 43255477692): code style, static analysis (PHPStan and Psalm), PHPUnit REL1_43 and linting all pass.

AI-authored — Claude Code, Opus 5.5, on a Professional Wiki account

alistair3149 and others added 2 commits November 12, 2026 11:08
Composer now refuses to install package versions with known security
advisories. MediaWiki 1.39 to 1.42 pin dependencies that have one, such as
PHPUnit 9.6.16 and Guzzle, so these jobs fail while installing MediaWiki,
before any test runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Composer refuses to install mediawiki-codesniffer 40 because the
PHP_CodeSniffer version it pins has a security advisory, so the code style
and static analysis CI jobs failed during composer install. Version 52
requires PHP_CodeSniffer 3.13.6, which has the fix.

Apply the new rules with phpcbf: static arrow functions, explicit nullable
types and whitespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alistair3149
alistair3149 marked this pull request as ready for review November 12, 2026 17:28
@malberts
malberts merged commit b0d88b3 into master Nov 12, 2026
8 checks passed
@malberts
malberts deleted the fix/ci-codesniffer-52 branch November 12, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants