Page MenuHomePhabricator

Use jobs to fetch scores and then attempt reverts
Open, HighPublic

Description

Since we determined that we shouldn't depend on ORES in T359050: Investigate hard ORES dependency for AutoModerator pilot, we should run our score fetching and revert code from jobs.
We can use ORES as a template since it is already working well at scale:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/ORES/+/refs/heads/master/includes/Services/FetchScoreJob.php

Note that ORES fetches the score from a job and then runs a hook that provides the score. If we create a near-identical job + hook, it will make implementing ORES as a soft dependency (to avoid requesting the same score twice) an easier optimization in the future. In this arrangement, our revert code would be run from an implementation of our hook that provides the score.

Event Timeline

Scardenasmolinar changed the task status from Open to In Progress.Mar 30 2024, 1:03 AM
Scardenasmolinar claimed this task.
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

Change #1018395 had a related patch set uploaded (by Scardenasmolinar; author: Scardenasmolinar):

[mediawiki/extensions/AutoModerator@master] Use job to fetch scores

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

Change #1018395 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Use job to fetch scores

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

We have some followups here, @jsn.sherman to document :)

jsn.sherman removed Scardenasmolinar as the assignee of this task.
jsn.sherman moved this task from Done to Ready on the Moderator-Tools-Team (Kanban) board.

Reopening this for the followup rather than authoring a new task:
Per T363592#9758945, we should do an early "successful" return in the job when receive a 422 response from the api. 422 indicates that a revision is not scorable, so we want to mark the job as a success to prevent retries. We should do the same thing when a revision is not found in LiftWingClient.php#122. We don't need to create http responses in our client the way we currently are, since there is no consumer, so we can simplify/cleanup the liftwing client returns.