Page MenuHomePhabricator

[backend][leaderboard] Experiment with retrieving edit data from Toolhub
Closed, ResolvedPublic

Description

Use PAWS to experiment with fetching and parsing edit data from Toolhub

  • Find which endpoint(s) to use by consulting the Toolhub API docs
  • Fetch all edits from the last 30 days
  • Present the data in a table (or similar) showing total edits per user
  • Order the data from most to least prolific editors
  • Discuss whether it would be worth creating a new Toolhub endpoint to make this process easier.

Event Timeline

After some experimentation, I determined that /api/auditlogs is the most appropriate endpoint for this task, with the query string ?action=1 (filters for "edited").

The rest of my work is here:
https://public.paws.wmcloud.org/User:NicoleLBee/Toolhunt_Data_retrieval_PoC.ipynb

There are a few downsides to using this endpoint:

  1. We aren't able to get information about the specific field that was edited (if we deem that necessary).
  2. We aren't able to determine whether a tool was edited using Toolhunt or not.
  3. There is an awful lot of "noise" in the results. For instance, when testing my functions on the actual Toolhub site, I discovered that when a tool is added to a list, that also counts as an "edit." There were also a lot of edits made to "toolforge-authors" with the following comment:

Import from https://toolsadmin.wikimedia.org/tools/toolinfo/v1.2/toolinfo.json

I don't know what that means, but it isn't the sort of edit we're trying to track. I don't think that I could anticipate and filter out all of these "false positives."

NicoleLBee changed the task status from Open to In Progress.Dec 8 2022, 10:59 PM

After some more examination of the api, I have discovered that I can also add the query string target_type=tool to filter out non-tool items such as lists.

Having been enlightened by @Slst2020's comments at T324749#8456588, I wrote a function to filter results by the content of the comment field.

I am now pretty confident that I can gather, filter and parse data by user and/or date.

I don't think that there is any reason to add another endpoint to Toolhub; this is completely possible with the tools we have available.

Thank you, @NicoleLBee! All this is very useful information and just what I'd hoped we would get out of this task. You can move the task to the Done column on our board, but I'd keep it open for now to use as future reference, and easy access to the notebook link.

NicoleLBee updated the task description. (Show Details)