In the handbook of running global elections there are many places that the person running the election must log in to the primary database of votewiki and run write queries. This is a recipe for disaster and can easily corrupt data by honest mistakes. It should be at least a maint script
Description
Related Objects
Event Timeline
https://wikitech.wikimedia.org/wiki/SecurePoll mentions one use of primary database:
After election creation, manually insert into the database a property with name need-central-list and the value being the name of the list given to makeGlobalVoterList.php.
$ sql votewiki --write
wikiadmin@10.192.0.120(votewiki)> insert into securepoll_properties (pr_entity,pr_key,pr_value) values (1079,'need-central-list', 'board-vote-2021');
Are there any others in that Google doc? (I don't have access.)
I can provide what the doc says here. It's outdated now really but we do still use SQL writes to alter settings mid-election (i.e. when the interface is otherwise locked). Some of these are no longer needed thanks to improvements in SecurePoll's interface, I'm including them here anyway.
Altering the election settings (this should be updated to no longer refer to GPG, otherwise fine)
sql votewiki --write SELECT * FROM securepoll_properties WHERE pr_entity="759" AND pr_key NOT IN ("gpg-encrypt-key", "gpg-sign-key", "gpg-decrypt-key"); begin; INSERT INTO securepoll_properties (pr_entity, pr_key, pr_value) VALUES ("759", "not-blocked", "1"); UPDATE securepoll_properties SET pr_value="1" WHERE pr_entity="759" AND pr_key="not-blocked"; SELECT * FROM securepoll_properties WHERE pr_entity="759" AND pr_key NOT IN ("gpg-encrypt-key", "gpg-sign-key", "gpg-decrypt-key"); commit; exit
Altering the start or end dates of an election (note, this one has both local and global instructions hence the duplication)
sql votewiki --write sql uawikimedia --write SELECT * FROM securepoll_elections; SELECT * FROM securepoll_elections WHERE el_entity="826"; begin; UPDATE securepoll_elections SET el_start_date="20210225153000" WHERE el_entity="826"; UPDATE securepoll_elections SET el_end_date="20210226153000" WHERE el_entity="826"; commit; exit
Altering the election admins mid-election (this is no longer necessary since you can do this in the interface now)
sql votewiki --write SELECT * FROM securepoll_properties WHERE pr_entity="759" AND pr_key NOT IN ("gpg-encrypt-key", "gpg-sign-key", "gpg-decrypt-key"); begin; UPDATE securepoll_properties SET pr_value="JSutherland (WMF)|Samuel (WMF)" WHERE pr_entity="759" AND pr_key="admins"; SELECT * FROM securepoll_properties WHERE pr_entity="759" AND pr_key NOT IN ("gpg-encrypt-key", "gpg-sign-key", "gpg-decrypt-key"); commit; exit
Adding people to the voter roll (likewise I don't think this is necessary anymore)
sql enwiki --write SELECT user_id, user_name FROM user WHERE user_name = "Fox"; begin; SELECT DISTINCT li_name FROM securepoll_lists; SELECT COUNT(*) FROM li_name WHERE li_name="759/list/need-list"; INSERT INTO securepoll_lists (li_name, li_member) VALUES ("759/list/need-list", "5019622"); SELECT COUNT(*) FROM li_name WHERE li_name="759/list/need-list"; commit; exit
Thanks. Summarizing:
- Adding name of central list to election, no UI support ❌ - part of T288183?
- Altering the election settings - can be done in UI ✅ at least for eligibility settings changes shown in example above.
- Altering the start or end dates of an election - can be done in UI before election starts ✅. After election begins ❌ - T378817.
- Altering the election admins mid-election - supported in UI now ✅
- Adding people to the voter roll (non-centralauth based voter rolls) - supported in UI now ✅