Page MenuHomePhabricator

Central Global Repository for Templates, Lua modules, and Gadgets
Open, MediumPublic

Assigned To
None
Authored By
DannyH
Dec 15 2015, 12:51 AM
Referenced Files
None
Tokens
"Love" token, awarded by TadejM."Heartbreak" token, awarded by Sophivorus."Mountain of Wealth" token, awarded by matej_suchanek."Yellow Medal" token, awarded by TiagoLubiana."Like" token, awarded by xSavitar."Like" token, awarded by Rical."Like" token, awarded by Billinghurst."Love" token, awarded by KuboF."Love" token, awarded by Liuxinyu970226."Love" token, awarded by Capankajsmilyo."Love" token, awarded by robkam."Like" token, awarded by MarcoAurelio."Like" token, awarded by daniel."Barnstar" token, awarded by Zppix."Love" token, awarded by Shizhao.

Description

This card tracks a top 10 wish from the Community Wishlist Survey: https://meta.wikimedia.org/wiki/2015_Community_Wishlist_Survey

Original proposal: We could use a single location where to keep templates, Lua modules, and Gadgets that are used on all the wikipedia projects. Just like images from commons can be used on other projects, code from such site would be visible to all the projects. The current system of 100's of out of sync copies of the same templates or Lua modules occasionally synchronized with the original is very hard to maintain. --@Jarekt (talk) 20:06, 10 November 2015 (UTC)

Community Tech preliminary analysis:

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 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 this year.

Project page: https://meta.wikimedia.org/wiki/Community_Tech/Central_repository_for_gadgets,_templates_and_Lua_modules

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
OpenNone
OpenNone
OpenNone
ResolvedSamwilson
OpenNone
ResolvedNone
StalledNone
OpenFeatureNone
DuplicateNone
OpenNone
DeclinedNone
StalledNone
ResolvedLegoktm
OpenNone
OpenFeatureNone
ResolvedTTO
OpenFeatureNone
ResolvedNone
ResolvedNone
OpenNone
OpenNone
ResolvedAmire80
Resolved Whatamidoing-WMF
OpenNone
OpenNone
OpenNone
DeclinedNone
DeclinedNone
OpenNone
OpenNone
OpenFeatureNone
DeclinedNone
ResolvedNone
InvalidNone
OpenNone
InvalidJackmcbarn
OpenNone
DeclinedRical
DeclinedNone
DeclinedNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedBUG REPORTthiemowmde
OpenNone
OpenFeatureNone
OpenNone
ResolvedAmire80
Resolved ppelberg
ResolvedNikerabbit
ResolvedNikerabbit
ResolvedNikerabbit
Resolvedabi_
Resolvedabi_
Resolvedabi_
ResolvedFeatureabi_
Openabi_
OpenBUG REPORTNone
DuplicateNone
DeclinedNone
Stalled DAbad

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

I'm trying to clean up the tasks around this topic. It's time for another round of merging duplicates.

My proposal is:

  1. This one (T121470) should probably remain as the main reference point for global templates, modules, and gadgets, simply because it appears to be linked to from so many places (correct me if I'm wrong). Duplicates:
  2. There should be one subtask for global gadgets. Probably T22153: Implement global gadgets (WMF-wide)
    1. Duplicates:
      1. T153263: Allow easier downloading of userscripts/gadgets (from enwiki and such)
    2. Subtasks:
      1. T117540: Introduce global registry for gadget module identifiers
  3. There should be one subtask for global templates and modules, because they are mostly similar (but see below). It can be T52329: We need a common repository for Scribunto modules and templates.
  4. The common task for templates and modules should have further subtasks for things that different for templates and for modules. Examples:
    1. Modules:
      1. T135845: Convert any module as central or centralisable
      2. T41610: Scribunto should support global module invocations
    2. Templates:
      1. T3126: Interwiki templates
      2. T6547: Support crosswiki template inclusion (transclusion => interwiki templates, etc.)
  5. I'm not sure what to do with even more generic tasks, such as these:
    1. T66475: Make crosswiki bits and pieces truly global (tracking) - This task (T121470) can probably be its subtask.
    2. T11890: Reasonably efficient interwiki transclusion
    3. T91162: RFC: Shadow namespaces - this should probably a blocker for T121470 if @Legoktm and other relevant people still think that it's the way forward as the internal technical solution.

This list is probably not complete, but it's a beginning.

Furthermore, I suggest to decline the tasks that ask for global user scripts. We already have global personal Common.js, and (hacky) cross-wiki loading of user scripts. So it's enough to have global gadgets at some future point, and when this becomes possible, if anyone wants to make a user script global, it won't be too hard to convert it into a gadget and make it global.

(yet another example)
I want to fix https://he.wikipedia.org/wiki/Module:Infobox_gene to use getEntity instead of getEntityObject which is legacy alias, it is cloned from https://en.wikipedia.org/wiki/Module:Infobox_gene which is protected.
What is the best way to achieve it?

  1. Ask sysop permissions /templateeditor permissions in enwiki, fix it there, port it back to hewiki, hope that 20 other wikis will update their forks as well?
  2. Update hewiki and let enwiki pull back the changes, ope that 20 other wikis will update their forks as well?
  3. Split the module to logic that is common to all wikis, put it in shared repo, and fix it there

I suggest you or anybody as Assignee. It is time to name for an assignee (Amire, other..) for credibility. We can beging with this Wikipedia (and add Wikidata and other projects). It must divided in three task and one common task. I am interested in Global Templates. TemplateDate for every (global) template can be used in Wikidata. And translation tags (as in Mediawiki) for translations. Test.Wipiedia.org can be used for tests. Time to begin or create another task with other authors, workers, assignees. No more
procrastination.

What's taking this so long? Has any decision been made on how to implement this? There are a lot of wikis like sawiki which don't have enough tech contributors. They will be more than happy to adopt it as compared to frwiki which has a huge army of tech people. We can start with allowing sawiki to use modules of enwiki from mediawiki directly. Any comments?

@BoldLuis: This is not a forum; please also see https://www.mediawiki.org/wiki/Bug_management/Phabricator_etiquette if you'd like to be active here. Thanks!

I tried to help to fix the bug with ideas.

From the source you leaded to me :

Criticize ideas, A healthy amount of constructive criticism and vibrant debate helps to improve our software and is encouraged.

I am going to try to help to fix bugs. This is a global bug an need goal fixes in different projects. Thanks for your understanding 🙏

BoldLuis changed the status of subtask T278048: TemplateData and Wikidata for global templates from Stalled to Open.

https://phabricator.wikimedia.org/tag/abstract_wikipedia/ interesting for global templates and funcstions.

A related proposal from the Community Wishlist survey 2022.

Without raw you get back a HTML blob rendered by a different parser, there is no end to the exciting bugs that could cause (local interface changes would get ignored, for example; links would be blue or red based on whether they exist on the templatecommons wiki). If you prefix all template names with raw:central_wiki_name, they won't work on the central wiki itself (I guess that would be not super hard to fix). It will also break cache invalidation and maybe performance, plus Parsoid would have to be updated to support it. Functionally, this is more or less what the shadow namespace proposal was aiming at (but it was a wishlist item and wasn't finished within the year, so I imagine there must be much more complexity to it than I can see at a glance).

For what it's worth, I created wikitemplates.org as a demo wiki for the Wikitemplates proposal, did some experiments with the "raw" prefix and drafted some best practices. It seems the templates do work at the central wiki itself.

Well, a bot has been written with very much the same mindset.

Unfortunately that bot has been broken for over a year now. :-(

See Synchronizer for a semi-automated tool for solving or mitigating this issue.