Page MenuHomePhabricator

Produnto package fetcher
Closed, ResolvedPublic

Description

When a Scribunto external package is updated or added, MediaWiki needs to fetch it from GitLab.

As discussed at T412317, there is an opportunity to share code with Gadgets and anything else in the MediaWiki ecosystem that needs a package or plugin concept. So I'm proposing that the package fetcher be in a separate extension called Produnto.

There will be a GitLab webhook for tag events in the relevant repositories. This will post JSON to a MediaWiki REST API endpoint.

  • Check and remove a configured repository URL prefix to extract the package name.
  • Check for duplicate requests
  • Insert a row into the package versions table, with state "fetching". Use a unique index to deduplicate requests.
  • Queue a job
  • Fetch a zip file from GitLab
  • Iterate over files
    • Hash the contents of the file
    • Check if the hash is present in the file store. If not, insert it.
      • Note that the file modification times in the zip are set to the commit time, so they are not useful for incremental updates.
    • Insert a row into the file version table, linking the package version to the content hash
  • Set the package version state to "ready"

This can all be in shared tables. The webhook will only post to a single wiki.

Event Timeline

Third-party wikis will want to use packages. Having the GitLab webhook post directly to the wiki is not a solution for them. Also they can't fetch zip files directly from GitLab, there would need to be a CDN.

tstarling renamed this task from Package fetcher to Produnto package fetcher.Jan 27 2026, 12:31 AM
tstarling updated the task description. (Show Details)

Change #1237375 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] GitLab tag webhook endpoint and infrastructure

https://gerrit.wikimedia.org/r/1237375

Change #1244979 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Produnto@master] Propagate the Git ref from the webhook to the fetcher

https://gerrit.wikimedia.org/r/1244979

Change #1237375 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] GitLab tag webhook endpoint and infrastructure

https://gerrit.wikimedia.org/r/1237375

Change #1244979 merged by jenkins-bot:

[mediawiki/extensions/Produnto@master] Propagate the Git ref from the webhook to the fetcher

https://gerrit.wikimedia.org/r/1244979

tstarling claimed this task.