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

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...

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 :)

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 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 subscribed.

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-Team 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 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