Page MenuHomePhabricator

Use jobs to fetch scores and then attempt reverts
Closed, ResolvedPublic

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.

Change #1027021 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/extensions/AutoModerator@master] [WIP]: Use jobs to fetch scores and then attempt reverts: Early Return from Job for 4xx status codes so as to not kick job off again.

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

Change #1027021 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Use jobs to fetch scores and then attempt reverts:

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

Change #1029611 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/AutoModerator@master] Don't tag revisions to track rev check status

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

Change #1029617 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/AutoModerator@master] Cleanup FetchRevScoreJob return logic and messages

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

jsn.sherman moved this task from Done to Code review on the Moderator-Tools-Team (Kanban) board.
jsn.sherman added a subscriber: Kgraessle.

@Kgraessle I have a couple of followup patches ready for review!

Change #1029611 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Don't tag revisions to track rev check status

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

Change #1029617 merged by jenkins-bot:

[mediawiki/extensions/AutoModerator@master] Cleanup FetchRevScoreJob return logic and messages

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