Page MenuHomePhabricator

For non-global elections, check for min edits before a date or during a period, at time of vote rather than election setup
Closed, ResolvedPublic

Description

Currently, SecurePoll allows setting eligibility criteria on basis of a minimum number of edits before a given date, or between two given dates. However, this is available under "Eligbility lists" using the "populate list automatically" option. A list of all users satisfying the requirements gets generated in a job, a slow process.

We could instead perform these checks when a user attempts to vote as both checks are possible with indexed db queries (provided the number of edits to check for is not too large).

Benefits:

  • Speeds up the election setup process.
  • Users who became eligible to vote after election setup or mid-election will be able to vote.
  • Removes need to store the list in db – tens of thousands of rows.

This would be useful for enwiki Arbcom elections.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

image.png (1,118×623 px, 55 KB)

We have "minimum edits" up at the top here. I happened to test this today and this is computed on the fly and stays current. If the threshold is 500 edits, and the voter starts the election with 499 edits, and gets their 500th edit during the election, SecurePoll figures it out and lets them vote.

Knowing this, do you still think code changes are needed?

Side note, the difference between "basic options" and "eligibility list -> populate list automatically" isn't exactly clear to me. I wonder if we need "eligibility list -> populate list automatically" at all, or if anything unique about it should just be moved up to the "basic options" above.

We have "minimum edits" up at the top here. I happened to test this today and this is computed on the fly and stays current.

That's the check for minimum edit count (overall). This task is about the checks for minimum # of edits before a date and between two dates, which is only possible with eligibility lists.

Screenshot 2025-06-21 at 3.30.11 PM.png (1,652×1,266 px, 135 KB)

Side note, the difference between "basic options" and "eligibility list -> populate list automatically" isn't exactly clear to me. I wonder if we need "eligibility list -> populate list automatically" at all, or if anything unique about it should just be moved up to the "basic options" above.

The difference is the former is checked at vote-time. I am indeed proposing to move the options under "populate list automatically" into "basic options".

Not just because it makes the interface simpler, but also because I think it's going to more stable. It's unclear to me if PopulateVoterListJob even works (T190087) and checking its the code, I see some uses of COUNT(*) which can cause problems with users with massive edit counts (T302761).

Change #1164695 had a related patch set uploaded (by SD0001; author: SD0001):

[mediawiki/extensions/SecurePoll@master] Add eligibility options to require minimum edit count in time intervals

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

Change #1164696 had a related patch set uploaded (by SD0001; author: SD0001):

[mediawiki/extensions/SecurePoll@master] Remove automatic list generation

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

@jrbs, do you ever use the "populate list automatically" part of the voter eligibility page?

image.png (894×699 px, 53 KB)

We are thinking of moving these up to the "basic options" (switching them from a one time job that writes names to the database, to on-the-fly calculation), then deleting this part of the form entirely. Just want to see what your workflow is and how fast/slow we should move on this particular idea. Thanks.

I'm all for computers doing things so humans don't have to, My only concern here is that (at least on enwiki) voter suffrage is determined by the community at an RFC. Implementing this automatic system would constrain the community to only using criteria which the software supports. If the community decided they only wanted editors whose usernames contained a Thorn to be eligible to vote, we'd be stuck. That is, of course, a silly example. But one could easily imagine less silly constraints which the community decides are important but happen not to be supported by this process. At the very least, we need to ensure we can revert to an enumerated list of eligible voters to accommodate such a situation.

@RoySmith This is not a proposal to remove eligibility lists, just the automatic population of eligibility lists. If that sounds unfamiliar, it's because it's a feature that has never been used for any actual election, and at this point has become tech debt. The feature generates lists internally on the jobrunner infra based on 2-3 criteria, which seems illogical to me as we can instead check the same criteria on the fly, sidestepping the process of chugging through 40 million user accounts.

Enwiki elections have always used lists that are externally generated. It will still be possible to upload lists created through WMCS/Hadoop/Spark/whatever process that works. (For arbcom elections, it shouldn't be needed any more though as the criteria it uses are being added to the on-the-fly checks.)

Yeah. There's 3 ways to configure voter eligibility:

  1. the criteria at the top of the voter eligibility page, which does it on the fly
  2. a manually uploaded eligibility list
  3. an eligibility list that is generated via the MediaWiki job queue

This ticket is basically proposing that we move 3 to 1, then delete 3.

This ticket could probably be re-written to express this better in the ticket title and ticket first post.

Implementing this automatic system would constrain the community to only using criteria which the software supports.

2 will be retained and allows things like Cyberpower generating his list of eligible voters and then that can get manually uploaded. 2 is powerful and lets us use any criteria we want.

OK, sounds good. I should have been smart enough to assume you guys knew what you were doing :-)

@jrbs, do you ever use these? If not let me now since we'll probably delete it soon. (Long story short, we want to switch from doing this as a job to doing it on the fly. But I think both of these only affect local elections, and you mainly do global elections.)

image.png (1,035×953 px, 117 KB)

Change #1164695 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add eligibility options to require minimum edit count in time intervals

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

Novem_Linguae assigned this task to SD0001.
Novem_Linguae removed a project: Patch-For-Review.

Oops, sorry, this was unsent:

@jrbs, do you ever use the "populate list automatically" part of the voter eligibility page?

image.png (894×699 px, 53 KB)

No - I don't actually think any of these options actually work.

Change #1164696 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Remove automatic list generation

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