This repository was archived by the owner on Oct 28, 2026. It is now read-only.
Repository navigation
Install extension/skin composer dependencies from core root - #28
Merged
Merged
Conversation
MediaWiki loads exactly one Composer autoloader — the core checkout's vendor/ — so running `composer install` inside extensions/Foo produced a vendor/ nothing ever autoloads, and resolved that extension's constraints in isolation from core's. git-checkout, git-pull, repo-register and both rsync verbs now detect when the checkout they just updated is an extension or skin of a core tree (the nearest ancestor with a composer.json holding it under extensions/ or skins/, so versions/<ver> wins over the deploy root above it), declare the manifest globs in that root's composer.local.json for wikimedia/composer-merge-plugin, and run composer install from the root. A checkout that is nobody's extension still installs in place. composer.local.json is written non-destructively: existing content and any other merge-plugin settings are kept, globs are only appended, and a second run is a no-op. Several extensions synced under one root install that root once rather than once per checkout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QKzD8eUV1sT45NMNnjKSAg
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe shim is updated to version 2.2.0. Nested extension and skin checkouts now merge Composer manifests into the nearest MediaWiki core and install dependencies from the core root. Synchronization avoids repeated installs. Documentation and tests cover the new behavior. ChangesCore-root Composer installation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Sync
participant install_dependencies
participant CoreRoot
participant Composer
Sync->>install_dependencies: process extension or skin path
install_dependencies->>CoreRoot: resolve and prepare composer.local.json
install_dependencies->>Composer: run one root-level install
Composer-->>CoreRoot: update shared vendor tree
Sync->>install_dependencies: process next checkout
install_dependencies-->>Sync: skip already-installed Composer root
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change implements proper Composer dependency management for MediaWiki extensions and skins by installing them from the core root rather than in place. This ensures all dependencies resolve together into a single
vendor/directory that MediaWiki actually autoloads.Key Changes
New
composer_merge_root()function: Determines if a checkout is an extension or skin by finding the nearest ancestor with acomposer.jsonthat contains the path underextensions/orskins/. ReturnsNonefor standalone checkouts (core itself, tools, etc.) that install in place.New
ensure_composer_merge_plugin()function: Managescomposer.local.jsonin the core root, declaring extension and skin manifest globs (extensions/*/composer.json,skins/*/composer.json) via Composer's merge plugin. Preserves existing content and only writes when necessary.Updated
install_dependencies()function: Now detects when a checkout is an extension/skin and installs from the core root instead. Accepts optionalcomposer_rootsset to track already-installed roots and avoid redundant installs when multiple extensions share one core.Updated
install_dependencies_for_sync()function: Tracks composer roots across a batch of synced paths so path-restricted rsyncs of multiple extensions under one core install that root only once.Documentation updates: Added "Composer and the merge plugin" section to
OPERATIONS.mdexplaining the behavior, and updatedSALT-INTEGRATION.mdto note that the web user needs write access to the core root'scomposer.local.jsonandvendor/.Version bump: Updated from 2.1.0 to 2.2.0.
Implementation Details
wikimedia/composer-merge-plugin(a core dependency) to merge extension/skin manifests into core'scomposer.jsonat install timecomposer.local.jsonmanagement, and multi-extension sync scenarioshttps://claude.ai/code/session_01QKzD8eUV1sT45NMNnjKSAg
Summary by CodeRabbit
New Features
Documentation