Page MenuHomePhabricator

Block durations may not default correctly
Closed, ResolvedPublic

Description

I just noticed that on fawiki, the block duration for existing filters is shown as "2 hours"; I thought we addressed it in https://gerrit.wikimedia.org/r/#/c/412892/ but apparently it did not work.

Event Timeline

Huji triaged this task as High priority.Mar 24 2018, 1:12 AM
Huji added a project: Technical-Debt.

Setting to high, as it may cause confusion to the sysops and also they may save filters without realizing this, causing the block duration to change from the defaults.

@Huji the reason is quite easy, I already pointed it out but didn't think it had the possibility to happen. For old filters, the default durations are set to the global variables values, which are 7 and 14 days for fa.wiki. However, ipboptions doesn't have such durations inside, thus the given defaults aren't found in the dropdown and it stays to the lower value, i.e. 2 hours.
The solution is instead less clear. I see these options:
-Add global durations to ipblocklist
-Change globals to the nearest values in ipboptions (I don't like this, however changing "7 days" to "1 week" would solve half of the problem, and we should do that for other wikis if necessary)
-Write a specific function which, in case the defaulf isn't found, cycles trough ipblocklist, parses every option and determines where to insert the new value. However, I in this case we don't have a localized version to display.

Actually, I think both 1 and 2 weeks are on ipboptions, thus solution 2 would solve this for fa.wiki. However, it's still good to talk about a solution and make sure no other wikis use such alternative wording. Or maybe we may handle it in the function of point 3, like we already do for infinite durations.

Change 421691 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[operations/mediawiki-config@master] Change wording for block durations

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

This will solve the problem for some wikis. I don't know whether we may face this problem again in the future, but since we want to be sure I'll also submit a patch for AF for recognising different wordings. The only remaining point is: should I also handle missing values like I said above?

Change 421692 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Make sure blocks from ipboptions have the same wording as globals

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

Change 421691 merged by jenkins-bot:
[operations/mediawiki-config@master] Change wording for AbuseFilter global block durations

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

@Huji may you please check if block durations are now fixed?

Mentioned in SAL (#wikimedia-operations) [2018-03-27T13:37:13Z] <zfilipin@tin> Synchronized wmf-config/abusefilter.php: SWAT: [[gerrit:421691|Change wording for AbuseFilter global block durations (T190602)]] (duration: 00m 57s)

Huji removed a project: Patch-For-Review.

Yes, it is resolved. Thanks for identifying the issue with the wording and fixing it so quickly.

@Huji Nice to know! I've been quick since I had already suspected this might have came out. However, although the specific problem of this task has been solved, this was a robust but temporary solution. To be totally sure for the future we should merge the other commit as well :-)

Daimona renamed this task from Block duration defaults to 2 hours to Block durations may not default correctly.Mar 27 2018, 5:29 PM
Daimona lowered the priority of this task from High to Medium.
Daimona added a project: Patch-For-Review.

Change 421692 merged by jenkins-bot:
[mediawiki/extensions/AbuseFilter@master] Make sure blocks from ipboptions have the same wording as globals

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

Huji removed a project: Patch-For-Review.