Page MenuHomePhabricator

MediaWiki.org: Generate infoboxes from extension.json in git
Closed, ResolvedPublic

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

There are a very large number of changes, so older changes are hidden. Show Older Changes
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.

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.

RHeigl subscribed.

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.

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.

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

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

@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?

DannyS712 subscribed.

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.

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.

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.

@DannyS712 Are you still working on this? If not, I was thinking maybe parts of this could be broken into smaller chunks and made into GCI tasks

Aklapper lowered the priority of this task from Medium to Low.Mar 1 2021, 11:39 AM

Hmm. We might soonhit a scaling limit with the bot, as Module:extensionJson is getting close to 2mb max page size

Should the information be split up across different pages?

Or we can implement gzip in Lua :)

Yeah, just chunk by size or first letter, probably.

Alternatively, create a separate Lua module per extension/skin. That would prevent use cases which involve presenting information about many extensions at the same time, but do we have such use cases?

Or we can implement gzip in Lua :)

+2!

Alternatively, create a separate Lua module per extension/skin. That would prevent use cases which involve presenting information about many extensions at the same time, but do we have such use cases?

I was thinking of using the information in Module:extensionJson to install extensions (T297384) and, as long as there is a way to find all the information in Module:extensionJson from a single endpoint (even if I have to do more queries from there), this is fine.

I was thinking of using the information in Module:extensionJson to install extensions (T297384) and, as long as there is a way to find all the information in Module:extensionJson from a single endpoint (even if I have to do more queries from there), this is fine.

As long as you do not need it inside a wikitext context specifically, you should just use https://extjsonuploader.toolforge.org/ExtensionJson.json (which does not have size limits).

I was thinking of using the information in Module:extensionJson to install extensions (T297384) and, as long as there is a way to find all the information in Module:extensionJson from a single endpoint (even if I have to do more queries from there), this is fine.

Not sure if you mean via a Lua module, but if you don't: the info is available in a JSON file at https://extjsonuploader.toolforge.org/ExtensionJson.json

I was thinking of using the information in Module:extensionJson to install extensions (T297384) and, as long as there is a way to find all the information in Module:extensionJson from a single endpoint (even if I have to do more queries from there), this is fine.

Not sure if you mean via a Lua module, but if you don't: the info is available in a JSON file at https://extjsonuploader.toolforge.org/ExtensionJson.json

I got confused. Of course, the entire json file is available, but that isn't what my comment is about.

The git repository is not available from the toolforge url. There is no pointer, for example, to SemanticMediaWiki's repository at https://github.com/SemanticMediaWiki/SemanticMediaWiki.git ...

There is the url field, but that points to the "home page" for the extension (in SMW's case, https://www.semantic-mediawiki.org/).

And, in case it wasn't clear, this would be especially helpful for extensions not hosted in Gerrit.

Tgr assigned this task to Bawolff.

Nothing actionable left here I think. Thanks @Bawolff for implementing the bot and the several people who adjusted the template and Lua module!

The git repository is not available from the toolforge url. There is no pointer, for example, to SemanticMediaWiki's repository at https://github.com/SemanticMediaWiki/SemanticMediaWiki.git ...

There is the url field, but that points to the "home page" for the extension (in SMW's case, https://www.semantic-mediawiki.org/).

And, in case it wasn't clear, this would be especially helpful for extensions not hosted in Gerrit.

FWIW this was done in rLTEU0a529e5c3b85: Add Git repository info to extension data.