Page MenuHomePhabricator

Log when admins are added to or removed from SecurePoll elections
Closed, ResolvedPublic3 Estimated Story PointsJan 12 2021

Description

Following T271270: Create new logging table in SecurePoll, log when admins are added to or removed from an election.

This task is only for adding a row to the log table.

Details of how we could do this are outlined in T270313#6707097.

Event Timeline

ARamirez_WMF set the point value for this task to 3.Jan 6 2021, 5:46 PM
ARamirez_WMF changed the subtype of this task from "Task" to "Deadline".

Change 655746 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/SecurePoll@master] WIP Log when an admin is added to or removed from an election

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

Change 655746 merged by jenkins-bot:
[mediawiki/extensions/SecurePoll@master] Log when an admin is added to or removed from an election

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

dom_walden added a subscriber: dom_walden.

If you add or remove admins when editing an election, this gets recorded in Special:SecurePollLog.

admin_list.png (187×940 px, 79 KB)

When creating an election, the admins you have chosen are not recorded in the log. I guess this is not necessary.

If you don't touch the admins when editing (even if you change their order) nothing gets recorded in the logs.

In case of regression, I tested adding and removing an admin on beta, which does not have logging enabled.

With JS disabled, there can be some weird behaviour. For example, if you change the election admin from Other Electionadmin to Other_Electionadmin, we appear to treat them as two different users and you get a misleading log entry:

log_misleading.png (52×991 px, 22 KB)

In the same way, you can also add/remove the same admin more than once, and this gets recorded multiple times in the log.
log_multiple.png (46×829 px, 18 KB)

I don't think this is likely to happen in practice, nor would it be a big problem if it did, but I may raise a bug about normalising usernames without JS.

Also, something I think @Tchanders mentioned in the code review comments, is that we are taking user ids from the user table, when we should now be using the actor table. Perhaps there should be a follow up task for that. The same goes for T271276 (which I forgot to comment on that ticket).

Test Environments

  • local vagrant SecurePoll 2.0.0 (1ebc4fd).
  • vote.wikimedia.beta.wmflabs.org MediaWiki 1.36.0-alpha (08f821e) 07:37, 10 February 2021 SecurePoll 2.0.0 (bc7fd59) 09:31, 10 February 2021.

When creating an election, the admins you have chosen are not recorded in the log. I guess this is not necessary.

Raised T274790.

Also, something I think @Tchanders mentioned in the code review comments, is that we are taking user ids from the user table, when we should now be using the actor table. [...]

As discussed in a meeting, we went with the user table in the end, so this is correct.