Page MenuHomePhabricator

Call BlockUser in AbuseFilterRunner.php
Closed, ResolvedPublic

Description

Once https://gerrit.wikimedia.org/r/c/mediawiki/core/+/588104 is merged, we should have a backend class for blocking users.

Event Timeline

Reedy created this task.Mar 28 2020, 2:40 PM

Personally, I just wasn't aware of that method. I can't tell whether it could break anything though.

Of note, before trying, perhaps the method should be moved elsewhere, as calling ::processForm from a non-form context looks weird...

Reedy added a comment.Mar 28 2020, 2:49 PM

Personally, I just wasn't aware of that method. I can't tell whether it could break anything though.

Of note, before trying, perhaps the method should be moved elsewhere, as calling ::processForm from a non-form context looks weird...

Ditto. I somehow missed it when doing T246368: Create maintenance script to block a list of users, when the API clearly uses it (and I'm sure I looked at the APIs code)

It shouldn't be too difficult to confirm all the parameters get swapped over etc

I don't disagree that it probably should live somewhere else, but that's probably more in scope for something like T221075: Introduce a BlockStore service (or another block refactoring type task), rather than here :)

Urbanecm claimed this task.Mar 28 2020, 5:09 PM
Restricted Application added a project: User-Urbanecm. · View Herald TranscriptMar 28 2020, 5:09 PM

Change 584128 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/AbuseFilter@master] Refactor AbuseFilterRunner::doAbuseFilterBlock to use SpecialBlock::processForm

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

Urbanecm triaged this task as Low priority.Mar 28 2020, 5:20 PM
Urbanecm moved this task from Backlog to Waiting on review on the User-Urbanecm board.

I don't disagree that it probably should live somewhere else, but that's probably more in scope for something like T221075: Introduce a BlockStore service (or another block refactoring type task), rather than here :)

Sure, it doesn't belong here. However, I was wondering whether we should wait for that service to be created, before migrating the caller. I've skimmed through the patch above, and the first thing I noticed is that SpecialBlock::processForm has an annoying depdnency on a whole RequestContext object. As I wrote on gerrit, that's a pattern we tend to avoid in new code, because it's very hard to maintain (and it introduces a lot of coupling).

So, perhaps we should really wait for that service to be created before moving on?

Urbanecm renamed this task from Call SpecialBlock::processForm in AbuseFilterRunner.php to Call BlockUser in AbuseFilterRunner.php.Apr 11 2020, 6:53 PM
Urbanecm changed the task status from Open to Stalled.
Urbanecm removed Urbanecm as the assignee of this task.
Urbanecm updated the task description. (Show Details)
Urbanecm added a subscriber: Urbanecm.

Change 584128 abandoned by Urbanecm:
Refactor AbuseFilterRunner::doAbuseFilterBlock to use SpecialBlock::processForm

Reason:
wait for https://gerrit.wikimedia.org/r/c/mediawiki/core/ /588104 to be reviewed&merged

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

So, perhaps we should really wait for that service to be created before moving on?

Anti-Harassment are looking into working on T221075: Introduce a BlockStore service as part of our work on blocking via Special:Investigate (T248528) if it helps.

Urbanecm changed the task status from Stalled to Open.Sep 24 2020, 12:03 AM

So, perhaps we should really wait for that service to be created before moving on?

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/588104 was merged!

Change 633381 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Use new services in AbuseFilterRunner

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

Daimona claimed this task.Oct 11 2020, 9:40 PM
Daimona raised the priority of this task from Low to Medium.

Change 633381 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Use new services in AbuseFilterRunner

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

Daimona closed this task as Resolved.Oct 24 2020, 9:09 PM