Skip to content

Drop redundant load_composer_autoloader#131

Merged
paladox merged 1 commit into
masterfrom
drop-redundant-load-composer-autoloader
Jun 4, 2026
Merged

Drop redundant load_composer_autoloader#131
paladox merged 1 commit into
masterfrom
drop-redundant-load-composer-autoloader

Conversation

@alistair3149

Copy link
Copy Markdown
Member

The extension.json load_composer_autoloader key only require_onces the
extension's own vendor/autoload.php — a file_exists-guarded include, fully
independent of AutoloadNamespaces/AutoloadClasses. It is only useful when an
extension ships its own third-party Composer dependencies in a local vendor/.

SemanticScribunto has no composer autoload block and no third-party runtime
Composer dependencies (require is php + composer/installers only;
composer/installers is a build-time plugin never loaded at runtime). Its own
classes load via AutoloadNamespaces (SMW\Scribunto\src/), and the
Scribunto/Semantic MediaWiki dependencies are MediaWiki extensions
(requires.extensions), not Composer libraries. So the key loads nothing and is
dead weight. This matches the SemanticCompoundQueries end state.

Verification

Run in the docker-compose-ci container (MediaWiki 1.43, SMW dev-master,
Scribunto REL1_43), with the key removed:

  • composer analyze clean (parallel-lint + PHPCS + minus-x).
  • composer phpunit green — 161 tests, 492 assertions (7 pre-existing
    environment-gated skips).
  • Live eval.php checks: the extension still loads from the manifest
    (ExtensionRegistry::isLoaded true), the ScribuntoExternalLibraries hook is
    registered in the real hook container, and SMW\Scribunto\HooksHandler
    autoloads via AutoloadNamespaces.

The extension.json load_composer_autoloader key only require_once's the
extension's own vendor/autoload.php (a file_exists-guarded include,
independent of AutoloadNamespaces). SemanticScribunto has no composer
autoload block and no third-party runtime composer dependencies — its
require lists only php and composer/installers — so there is no local
vendor autoloader worth loading; SMW\Scribunto classes load via
AutoloadNamespaces. Remove the key, matching SemanticCompoundQueries.
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.97%. Comparing base (8a185c9) to head (6b8ccc2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #131   +/-   ##
=========================================
  Coverage     97.97%   97.97%           
  Complexity       72       72           
=========================================
  Files             4        4           
  Lines           198      198           
=========================================
  Hits            194      194           
  Misses            4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alistair3149 alistair3149 marked this pull request as ready for review June 4, 2026 19:15
@alistair3149 alistair3149 requested a review from paladox June 4, 2026 19:15
@paladox paladox merged commit 8b13add into master Jun 4, 2026
6 checks passed
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