Page MenuHomePhabricator

Create a script for determining which extensions uses which hooks
Closed, ResolvedPublic

Description

The goal is to be able to create a data set for analyzing hook usage. The data set should be represnted as a CSV file that can be imported into a spreadsheet or an SQL database for analysis.

The script takes as input a file that contains the name of an extension in each line.
For reach extension name (i.e. for each line in the file), the script loads the extension.json file for that extension from the git repo. That can be done using the following URL pattern: https://raw.githubusercontent.com/wikimedia/mediawiki-extensions-{NAME}/master/extension.json.

From the extension.json file, the script looks at the top level key "Hooks", which contains an object (a map) of hook names to hook hander names. We are only interested in the hook names, the handler can be ignored.

For each entry in the Hooks map, the script output as csv line, with the extension name in the first column, and the hook name in the second column.

Event Timeline

codebug changed the task status from Open to In Progress.Jan 10 2024, 8:23 PM

Change 989910 had a related patch set uploaded (by WQuarshie; author: WQuarshie):

[mediawiki/tools/code-utils@master] Extensions and Hooks

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

Change 990632 had a related patch set uploaded (by WQuarshie; author: WQuarshie):

[mediawiki/tools/code-utils@master] support stdout

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

Change 989910 merged by jenkins-bot:

[mediawiki/tools/code-utils@master] Extensions and Hooks

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

Change 991321 had a related patch set uploaded (by WQuarshie; author: WQuarshie):

[mediawiki/tools/code-utils@master] stdin

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

Change 991758 had a related patch set uploaded (by WQuarshie; author: WQuarshie):

[mediawiki/tools/code-utils@master] stdin and stdout

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

Change 990632 abandoned by WQuarshie:

[mediawiki/tools/code-utils@master] support stdout

Reason:

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

Change 991321 abandoned by WQuarshie:

[mediawiki/tools/code-utils@master] stdin

Reason:

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

We now have good baseline functionality. But so far, this does not work for skins.

Change 991758 merged by jenkins-bot:

[mediawiki/tools/code-utils@master] stdin and stdout

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

FJoseph-WMF subscribed.

@codebug @daniel Please create a separate ticket for skins improvements. We can call this one done, instead of expanding the scope of this ticket.

@codebug @daniel Please create a separate ticket for skins improvements. We can call this one done, instead of expanding the scope of this ticket.

Done: T355956. Closing this ticket.