Page MenuHomePhabricator

Provide a way to automatically download extension X for MediaWiki 1.Y
Open, Needs TriagePublicFeature

Description

Automating MediaWiki upgrades (e.g. for Docker containers) requires a way to automatically fetch the latest version of extension X for MediaWiki 1.Y.

Current link format (example: PluggableAuth):

(A) https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_35-efff551.tar.gz

A more useful link format for automation would be:

(B) https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_35.tar.gz

A symlink from B to A should automatically always be created.

Alternatively (or more elegantly), Special:ExtensionDistributor should provide a documented way for automatically fetching the necessary link, ideally as a 307 redirect to the .tar.gz file. If it exists, where can I find the documentation?

I'm currently parsing the HTML output of https://extdist.wmflabs.org/dist/extensions/ or https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=PluggableAuth&extdistversion=REL1_35 , which seems very unelegant and error-prone to me.

Event Timeline

Aklapper renamed this task from ExtensionDistributor / MediaWiki extensions: Provide a way to automatically download extension X for MediaWiki 1.Y to Provide a way to automatically download extension X for MediaWiki 1.Y.Dec 16 2021, 12:55 PM

If used on automating, the api provides machine readable format instead of using screen scraping.

help: https://www.mediawiki.org/w/api.php?modules=query+extdistbranches|query+extdistrepos
Query: https://www.mediawiki.org/w/api.php?action=query&list=extdistbranches&edbexts=PluggableAuth

The UI is also calling the api modules to show the dropdowns.
If the docker supports git commands, that could be easier.

This could be converted to a documentation task for https://www.mediawiki.org/wiki/Extension:ExtensionDistributor to add the api modules.