Community Tech/Central repository for gadgets, templates and Lua modules

Tracked in Phabricator:
Task T121470

The central repository for gadgets, templates and Lua modules project aims to create a way for us to use gadgets, templates and Lua modules on all wikis.

Rationale

edit

At the moment, it isn't easy to use e.g. a template found on another Wikimedia wiki. You can import templates and dependencies, but you need special rights and easily end up importing things you don't want. A central template page with translatable templates would mean that you could use that template everywhere. This was the third most popular suggestion in the 2015 Community Wishlist Survey, with 87 supporting votes.

Also every wiki admin having to repeat the same process of adapting templates for their own wiki is a huge waste of time and effort that could be far better spent elsewhere.

Current status

edit

Like cross-wiki watchlists, this is a fairly large project that requires some substantial back-end changes to MediaWiki. The main new feature that is required to support this request is implementation of shadow namespaces (phabricator:T91162). As a first step, Legoktm has been working on unifying the existing global user pages and foreignfilerepo features (both of which dynamically pull in content from other wikis). Once that is complete, it can be used as the basis for an abstracted shadow namespaces feature.

Most of the progress so far has been on reducing duplication and technical debt, as well as identifying and fixing performance issues. More details can be found in the shadow namespaces roadmap.

Technical discussion and background

edit

Internal Community Tech team assessment

edit
Support: High. Strong support, but there are some important concerns expressed in the voting about the difficulty of using templates across wikis. Templates are already complicated, and this project could be offering a technical solution to a problem that needs social, consensus-based solutions.
Impact: High. Existing templates, gadgets and modules (across all wikis) will probably be affected.
Feasibility: Difficult. We're currently working (mid-January) on getting the Gadgets 2.0 Gadget Manager ready for review (see T31398). That doesn't include global gadgets, but it's a step in that direction. Creating a global repository will depend on using shadow namespaces -- there's currently an RfC about shadow namespaces on mediawiki.org. There are also notes and discussions from the 2016 Developer Summit in early January here: T115762.
Risk: High. Templates, gadgets, and modules are implemented differently and may need different solutions. Templates often transclude other templates. Adding translation support to templates will make them harder to maintain. We'll need to figure out how permissions will work, and how template and module editors can test on multiple wikis or provide a warning of changes. We need to also think about Gerrit-like code review needs for templates, gadgets and modules and possibly even a versioning system. It will be difficult to come up with a solution that will truly work across projects and will fit into the social structures of diverse communities.
Status: This work will probably depend on the shadow namespaces work, which is still being discussed, and probably won't be complete by the end of 2016.