Skip to content

Use the namespaced class for Scribunto as the alias was removed#24

Merged
malberts merged 1 commit intomasterfrom
namespaced-Scribunto
Jan 6, 2026
Merged

Use the namespaced class for Scribunto as the alias was removed#24
malberts merged 1 commit intomasterfrom
namespaced-Scribunto

Conversation

@physikerwelt
Copy link
Collaborator

@physikerwelt physikerwelt commented Jan 6, 2026

From ChatGPT via @LizzAlice

Scribunto_LuaLibraryBase (the old underscore-style global class) was an alias for the namespaced class:

MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase (gerrit.wikimedia.org)

In current Scribunto, the alias line class_alias( LibraryBase::class, 'Scribunto_LuaLibraryBase' ); was removed (along with the autoload entry for Scribunto_LuaLibraryBase). (gerrit.wikimedia.org)

Summary by CodeRabbit

  • Refactor
    • Updated internal code architecture and library dependencies to improve maintainability and stability. These structural enhancements strengthen the technical foundation for future development while maintaining complete backward compatibility with all existing features and functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

From ChatGPT via @LizzAlice

Scribunto_LuaLibraryBase (the old underscore-style global class) was an alias for the namespaced class:

MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase ([gerrit.wikimedia.org][1])

In current Scribunto, the alias line class_alias( LibraryBase::class, 'Scribunto_LuaLibraryBase' ); was removed (along with the autoload entry for Scribunto_LuaLibraryBase). ([gerrit.wikimedia.org][2])

[1]: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Scribunto/%2B/refs/heads/master/includes/Engines/LuaCommon/LibraryBase.php "includes/Engines/LuaCommon/LibraryBase.php - mediawiki/extensions/Scribunto - Gitiles"
[2]: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Scribunto/%2B/a6dbdff2cd2a6d9b879be45f68b00d7770bf9c4d%5E%21/ "Diff - a6dbdff2cd2a6d9b879be45f68b00d7770bf9c4d^! - mediawiki/extensions/Scribunto - Gitiles"
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The SparqlLua class base class inheritance was updated from Scribunto_LuaLibraryBase to LibraryBase, with the corresponding use import changed to MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase. No method signatures or functional logic modifications were made.

Changes

Cohort / File(s) Summary
Base class refactoring
src/SparqlLua.php
Updated class inheritance from Scribunto_LuaLibraryBase to LibraryBase and revised the import statement to MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: replacing the removed alias Scribunto_LuaLibraryBase with the namespaced LibraryBase class, which is the core purpose of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI Agents
In @src/SparqlLua.php:
- Line 11: SparqlLua extends the namespaced LibraryBase from Scribunto but
composer.json lacks the Scribunto dependency; add "mediawiki/scribunto" with a
minimum version (e.g. >=3.1) to the composer.json "require" section, then run
composer update/install to update composer.lock so the
MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase class is available
at runtime.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3770846 and 33e5d09.

📒 Files selected for processing (1)
  • src/SparqlLua.php
🧰 Additional context used
🪛 GitHub Actions: CI
src/SparqlLua.php

[error] 11-11: Class "MediaWiki\Extension\Scribunto\Engines\LuaCommon\LibraryBase" not found.

🔇 Additional comments (1)
src/SparqlLua.php (1)

9-9: LGTM! Correct namespaced import.

The use statement correctly imports the namespaced LibraryBase class from Scribunto, replacing the deprecated global alias.

@malberts
Copy link
Contributor

malberts commented Jan 6, 2026

We will need to drop MW 1.39 support along with this. Which should be fine since that is EOL now anyway.

@malberts malberts merged commit c0e21ec into master Jan 6, 2026
10 of 16 checks passed
@malberts malberts deleted the namespaced-Scribunto branch January 6, 2026 13:17
@malberts malberts mentioned this pull request Jan 6, 2026
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