Page MenuHomePhabricator

Let stewardbot display temporary rightchanges too
Closed, ResolvedPublic

Description

For example, I saw this at IRC:
[18:21:08] <StewardBot> (self) Matiia changed user rights for Matiia@diqwiki from (none) to checkuser with the following comment: Checking possible sockpuppet

the log entry for this is:
18:21, 1 May 2017 Matiia (talk | contribs) changed group membership for Matiia@diqwiki from (none) to CheckUser (temporary, until 18:26, 1 May 2017) (Checking possible sockpuppet)

StewardBot should show this expiry too.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 1 2017, 4:31 PM
MarcoAurelio changed the task status from Open to Stalled.May 1 2017, 5:22 PM
MarcoAurelio triaged this task as Low priority.
MarcoAurelio added a subscriber: bd808.

StewardBot parses the log using a regex which detects which permissions got
added and removed. If we were to implement that it'd require a rewrite of
that and that's something I do not know how to do as I have no idea of
Python, in which the bot is written. Stalled for now. Being realistic the
only maintence happening on this project has been me and @bd808 when
required. Being myself retired from MediaWiki development, at least
temporary, unless Bryan figures out a way to achieve this, this will not be
resolved soon. IIRC a whole rewrite for the bot was planned but I don't
know the status of that goal.

I made some tries this morning and it seems that it isn't yet possible. StewardBot gets his informations from the RC feed on #meta.wikimedia@irc.wikimedia.org and this feed doesn't mention yet the expiracy of the permission (My try with an expiracy of 1 day gives: [[Special:Log/rights]] rights * Linedwell * changed group membership for User:Linedwell@testwiki from (none) to autopatrolled: test forStewardBot update exactly the same log as a permanent permission change). When the RC feed will mention it, I will be able to submit a patch to allow StewardBot to take this value into account.

Stryn added a subscriber: Stryn.Jul 14 2017, 6:48 PM
Masti added a subscriber: Masti.Jul 14 2017, 6:56 PM

<StewardBot> Masti changed user rights for Luensu1959@lijwiki from sysop to sysop with the following comment: [[Special:Permalink/16996278]]

that really makes sense to look for expiration date of rights.
In the case above the right were still valid till 17:34, 25 July 2017 when I changed it
(change visibility) 18:40, 14 July 2017 Masti (talk | contribs | block) changed group membership for Luensu1959@lijwiki from administrator (temporary, until 17:34, 25 July 2017) to administrator (temporary, until 18:40, 14 July 2018) (Special:Permalink/16996278)

What I said at T164204#3225569 is still valid. Unfortunately I do not speak python so I cannot fix the code to support that. I'm not sure if @dungodung or other python-expert would like to look at the code at rTSTW tool-stewardbots and provide a fix?

As I said in T164204#3334618, the bot's code cannot be updated while the RC feed doesn't mention the expiration date of rights (the bot cannot guess it if the feed doesn't mention it). Once T167568 closed, we will be able to update the bot code.

@Linedwell @bd808 And what about switching to EventStreams? RCstream is being deprecated in favor of EventStreams. Maybe we should think on making a bot that could use that information? Does EventStreams display temporary rights changes? Regards.

EventStream
event: message
id: [{"topic":"codfw.mediawiki.recentchange","partition":0,"offset":-1},{"topic":"eqiad.mediawiki.recentchange","partition":0,"offset":291979059}]
data: {"bot":false,"comment":"test T164204 on EventStream","id":10118494,"log_action":"rights","log_action_comment":"changed group membership for User:MarcoAurelio@testwiki from sysop to sysop, bot: test T164204 on EventStream","log_id":22786802,"log_params":{"newgroups":["sysop","bot"],"newmetadata":[{"expiry":null},{"expiry":"20170715205247"}],"oldgroups":["sysop"],"oldmetadata":[{"expiry":null}]},"log_type":"rights","meta":{"domain":"meta.wikimedia.org","dt":"2017-07-14T20:52:47+00:00","id":"644801ae-68d6-11e7-9531-141877613a1c","request_id":"efdf3b98-15a6-42c3-8290-5323d3bb9e37","schema_uri":"mediawiki/recentchange/1","topic":"eqiad.mediawiki.recentchange","uri":"https://meta.wikimedia.org/wiki/User:MarcoAurelio@testwiki","partition":0,"offset":291979058},"namespace":2,"server_name":"meta.wikimedia.org","server_script_path":"/w","server_url":"https://meta.wikimedia.org","timestamp":1500065567,"title":"User:MarcoAurelio@testwiki","type":"log","user":"MarcoAurelio","wiki":"metawiki"}

EventStream does display if rights are temporary or not, and if they were previously temporary or not as well.

EventStreams are likely to get a lot more love for feature enhancements than the private irc network. The core reason for this is that EventStreams are being actively developed by the Foundation to provide a data feed for other internal services like cache invalidation. The irc feed is used by a lot of tools developers and others, but it doesn't have an engaged owner/maintainer.

Melos claimed this task.Aug 25 2017, 12:11 AM

Change 374051 had a related patch set uploaded (by Melos; owner: Melos):
[labs/tools/stewardbots@master] Show user rights expiry in user rights notification message

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

Change 374051 merged by jenkins-bot:
[labs/tools/stewardbots@master] Show user rights expiry in user rights notification message

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

Luke081515 closed this task as Resolved.Aug 26 2017, 11:49 PM
[21:13:16] <StewardBot> (self) Melos changed user rights for Melos@testwiki from editor, reviewer to editor, reviewer, sysop (expiry: 19:16, 26 August 2017) with the following comment: test sb

looks good for me.

Tested again, looks good to me as well. I've updated the stewardbot public code.