Page MenuHomePhabricator

Hard-deprecate AbstractBlock::getTarget and introduce AbstractBlock::getTargetIdentity
Closed, DuplicatePublic

Description

Same idea as in T274329

  • Introduce AbstractBlock::getTargetIdentity
  • Find all usages of AbstractBlock::getTarget, replace
  • Hard-deprecate AbstractBlock::getTarget

Event Timeline

daniel triaged this task as High priority.Mar 9 2021, 6:26 PM

Change 671603 had a related patch set uploaded (by Peter.ovchyn; owner: Peter.ovchyn):
[mediawiki/core@master] Introduce getTargetIdentity for AbstractBlock

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

I have a concern about this: blocks can target IP ranges. This is also the reason why AbstractBlock::$target can be a string. I see that the patch above will create a UserIdentityValue by supplying the range as username. Unless I'm missing something (in which case I apologize), this is wrong because it violates the requirements of the UserIdentity interface.

Yup, the patch is incorrect. We only need to return UserOdentity when previously User was returned. String for the ip range should still be returned

Yup, the patch is incorrect. We only need to return UserOdentity when previously User was returned. String for the ip range should still be returned

Oh right, this makes sense. I thought we wanted to always return a UserIdentity, which would be impossible right now, and I somehow didn't consider that we can just keep returning a string in the range case.

Change 673068 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Hard-deprecate AbstractBlock::parseTarget

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

Change 673068 merged by jenkins-bot:
[mediawiki/core@master] Hard-deprecate AbstractBlock::parseTarget

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

Change 671603 abandoned by Ppchelko:

[mediawiki/core@master] WIP: Introduce Blocked interface to represent block target

Reason:

superseded

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