-
-
Notifications
You must be signed in to change notification settings - Fork 17
Add MediaWiki 1.44 support #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThis update removes support for older MediaWiki versions, raising the minimum required version to 1.43 in both code and CI workflow. Namespace imports for several MediaWiki classes are made fully qualified throughout the codebase. Extension metadata and release notes are updated, and a new author is added to composer.json. Changes
Possibly related PRs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)
15-20: Consider testing the declared minimum PHP versionThe extension advertises
>=8.0, yet the matrix now starts at 8.1. If 8.0 remains an officially supported floor, keeping one 8.0 job (even allowed to fail) safeguards against unnoticed regressions.src/SimpleBatchUpload.php (1)
36-36: Update the docblock type hint to match the new namespace import.The docblock still uses the old
\Parsertype hint while the import now usesMediaWiki\Parser\Parser. Update for consistency.- * @param \Parser $parser + * @param Parser $parser
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.github/workflows/ci.yml(1 hunks)composer.json(1 hunks)extension.json(2 hunks)release-notes.md(1 hunks)src/ParameterProvider.php(1 hunks)src/SimpleBatchUpload.php(1 hunks)src/SpecialBatchUpload.php(1 hunks)src/UploadButtonRenderer.php(1 hunks)tests/phpunit/SimpleBatchUploadTest.php(1 hunks)
🔇 Additional comments (9)
src/SpecialBatchUpload.php (1)
27-27: Namespace import looks goodThe switch to
MediaWiki\SpecialPage\SpecialPageis correct and aligns the file with MW-core namespacing.composer.json (1)
13-17: Author entry added correctlyMetadata remains valid JSON and the new organisation details are well-formed.
src/ParameterProvider.php (1)
27-27: Consistent Message namespacingImporting
MediaWiki\Message\Messageremoves reliance on the root-namespace alias—nice.src/SimpleBatchUpload.php (1)
26-26: LGTM! Namespace import updated correctly.The import statement has been properly updated to use the fully qualified
MediaWiki\Parser\Parsernamespace, which aligns with MediaWiki 1.43+ requirements.extension.json (3)
3-3: LGTM! Version bump to 3.0.0 is appropriate.The major version bump correctly reflects the breaking change of dropping support for MediaWiki versions below 1.43.
6-6: LGTM! Author name correction.The removal of the dot from "Professional.Wiki" to "Professional Wiki" improves consistency.
15-15: LGTM! MediaWiki version requirement correctly updated.The minimum MediaWiki version has been properly raised to 1.43, which aligns with the PR objectives to add MediaWiki 1.44 support and drop older versions.
release-notes.md (1)
3-7: LGTM! Release notes accurately document the changes.The new release notes section for version 3.0.0 correctly documents both the raised minimum MediaWiki version to 1.43 and the added support for MediaWiki 1.44, which aligns perfectly with the PR objectives and extension.json changes.
tests/phpunit/SimpleBatchUploadTest.php (1)
25-26: LGTM! Namespace imports updated correctly.Both
OutputPageandParserimports have been properly updated to use fully qualified MediaWiki namespaces (MediaWiki\Output\OutputPageandMediaWiki\Parser\Parser), which is consistent with the changes throughout the codebase for MediaWiki 1.43+ compatibility.
| use MediaWiki\Html\Html; | ||
| use MediaWiki\Parser\Parser; | ||
| use MediaWiki\Parser\PPFrame; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Import Message to drop the fragile global fallback
Html, Parser, and PPFrame are now fully-qualified, but the class still falls back on the root-namespace \Message further down (lines 93 & 100). Adding a namespaced import keeps style consistent and future-proofs the code against a potential alias removal.
use MediaWiki\Html\Html;
use MediaWiki\Parser\Parser;
use MediaWiki\Parser\PPFrame;
+use MediaWiki\Message\Message;Outside this hunk, replace \Message::newFromKey with Message::newFromKey.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use MediaWiki\Html\Html; | |
| use MediaWiki\Parser\Parser; | |
| use MediaWiki\Parser\PPFrame; | |
| use MediaWiki\Html\Html; | |
| use MediaWiki\Parser\Parser; | |
| use MediaWiki\Parser\PPFrame; | |
| use MediaWiki\Message\Message; |
🤖 Prompt for AI Agents
In src/UploadButtonRenderer.php around lines 26 to 29, add an import statement
for the Message class to avoid using the fragile global fallback. Then, outside
this hunk, replace all occurrences of \Message::newFromKey with
Message::newFromKey to maintain consistent namespacing and prevent potential
issues if the global alias is removed.
Fixes #68
Summary by CodeRabbit
New Features
Breaking Changes
Chores