Page MenuHomePhabricator

MediaWiki.org: Generate infoboxes from extension.json in git
Open, NormalPublic

Description

Problem

There are some widely used information templates on mediawiki.org which display some software information that could be easily extracted from the source code, but those templates are currently created and maintained manually. This is inefficient and ineffective - it's a significant amount of manual work and often not done, or not updated when code changes. Example: extension, extension install, hook and config variable templates.

Who would benefit

  • Developers who don't need to spend time on creating or updating hook/config var pages whenever they
  • Extension maintainers (especially people who routinely change others' extensions) who don't need to track things like required MW version in two different places
  • Developers and site admins who will gain access to correct and complete documentation
  • Possibly site admins running older MW versions because this would allow a much more user-friendly presentation of MW compatibility information

Proposed solution

  1. find a place to store structured mw.org infobox data - there are several possible approaches, see T155024: Store structured data needed for MediaWiki documentation for discussion
  2. write a bot to extract the data from git (extension.json, hooks.txt, DefaultSettings.php phpdoc) and upload it
  3. fetch the data in the infoboxes
  4. for hook/configvar pages, make the bot create them automatically with stub content when they don't exist
  5. run a bot with some regular frequency (e.g. weekly) to update the pages accordingly

Event Timeline

cscott created this task.Jan 10 2017, 6:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 10 2017, 6:40 PM
Jdforrester-WMF renamed this task from Generate extension infobox from extension.json to MediaWiki.org: Generate extension infobox from extension.json in git.Jan 10 2017, 7:16 PM
Jdforrester-WMF moved this task from Backlog to External on the Wikimedia-Site-requests board.
Tgr added a subscriber: Tgr.Jan 27 2017, 9:58 PM

Also hook documentation pages (we already parse hooks.txt) and configuration variable documentation pages (just needs some phpdoc parser).

A past attempt to do (partially) that was T91626: Technology to transclude git content into wiki pages (intended as an OPW project but did not make the cut). In hindsight it's probably overcomplicated.

The task to discuss how this should be implemented is T155024: Store structured data needed for MediaWiki documentation. Probably should be turned to an RfC at some point.

Tgr renamed this task from MediaWiki.org: Generate extension infobox from extension.json in git to MediaWiki.org: Generate infoboxes from extension.json in git.Jan 27 2017, 10:15 PM
Tgr updated the task description. (Show Details)

Original task description:

(10:36:32 AM) bawolff: Id really like the extension infobox to be loaded from extension.json
(10:36:54 AM) bawolff: Almost all of our code works
(10:37:14 AM) James_F: bawolff: I'd really like to kill most of the content of MW.org and load it "live" from git.
(10:37:19 AM) ***brion hmm, i may want to realign my priorities for 2017 to support roadmap & docs explicitly
(10:37:23 AM) addshore: James_F: +1 to that
(10:37:32 AM) bawolff: yep
(10:37:48 AM) James_F: bawolff: That way we can version the documentation properly for the version you have, rather than in one document try to explain config for MW 1.12 all the way up to master.
(10:37:50 AM) MatmaRex_mobile: James_F: hmm, didn't we have an OPW intern who wrote an extension to allow that?
(10:37:57 AM) MatmaRex_mobile: load stuff into MediaWiki from a Git repo

Don't see any actionable config change request here.

Huji updated the task description. (Show Details)Jan 28 2017, 2:01 AM
Huji added a subscriber: Huji.
cicalese added a subscriber: cicalese.
RHeigl added a subscriber: RHeigl.

Meets an important requirement of the MediaWiki Usage Report 2015: extension management :-)

This project is selected for the Developer-Wishlist voting round and will be added to a MediaWiki page very soon. To the subscribers, or proposer of this task: please help modify the task description: add a brief summary (10-12 lines) of the problem that this proposal raises, topics discussed in the comments, and a proposed solution (if there is any yet). Remember to add a header with a title "Description," to your content. Please do so before February 5th, 12:00 pm UTC.

Krinkle added a subscriber: Krinkle.Feb 6 2017, 8:03 PM

Due to the natural separation of content in the current reality (one in git, one on-wiki) there is currently a problem that is mostly invisible, but will likely become a problem if this process is automated. Namely the fact that most users do not run master, they run stable versions instead. As such, we need to find a solution to this separation.

One way to do this would be to consider integration with the extension distributor in some fashion. It is already capable of tracking multiple branches. From that special page, it could extract additional information and for example inform users that the master version of the extension requires MediaWiki 1.29alpha+ or higher, but that the "REL1_28 (current stable)" branch still supports MediaWiki 1.23 and higher. (e.g. the breaking change to drop older support happened recently in master, but we don't want to discourage users from using the extension between now and the release of 1.29).

This was the eleventh most popular item in the Developer Wishlist results.

Bawolff added a comment.EditedMay 7 2018, 12:55 AM

I made the minimum possible version of this (Perfect is the enemy of barely good enough)

Hence https://www.mediawiki.org/wiki/Module:ExtensionJson

Krinkle removed a subscriber: Krinkle.Apr 15 2019, 9:12 PM
cicalese triaged this task as Normal priority.Jul 31 2019, 12:08 AM
cicalese moved this task from Inbox to Needs Volunteer on the MediaWiki-Stakeholders-Group board.

@Bawolff we'd like to keep this moving forward and know you've done a lot here. Could you point us to how the lua is generated on wiki?

Tgr added a comment.Jul 31 2019, 8:20 AM

@MarkAHershberger Tool:Extjsonuploader has a nutshell explanation of the process.

DannyS712 added a subscriber: DannyS712.

Assuming that https://www.mediawiki.org/wiki/Module:ExtensionJson is kept updated by bot, I can update the template to extract data from there. At https://www.mediawiki.org/wiki/Module:Extension/sandbox I'm rewriting the current template display in lua, which eventually will control the entire infobox rather than just providing specific pieces of data.

Restricted Application added a project: User-DannyS712. · View Herald TranscriptAug 20 2019, 10:34 AM

Assuming that https://www.mediawiki.org/wiki/Module:ExtensionJson is kept updated by bot, I can update the template to extract data from there. At https://www.mediawiki.org/wiki/Module:Extension/sandbox I'm rewriting the current template display in lua, which eventually will control the entire infobox rather than just providing specific pieces of data.

One thing to keep in mind, is not all extensions are in gerrit (and not all extensions that are in gerrit fully use extension.json). So there still should be a way to override the infobox for extensions not in gerrit or doing config stuff in callbacks.

Tgr added a comment.Wed, Aug 21, 11:06 AM

Thanks @DannyS712, that would be great! (The specific task for it is T222479: Display autogenerated extension information in Template:Extension, FWIW.)

Daimona added a subscriber: Daimona.Mon, Sep 2, 8:14 PM