Page MenuHomePhabricator

Prefer a parameter over a configuration for importing translations in SecurePoll
Open, In Progress, Needs TriagePublic

Description

T310909: SecurePoll (votewiki) should import translations from Meta-Wiki seems to have never made it into production, as it required a configuration change that was never done. While we're here, instead of a configuration let's make this a user-serviceable parameter. This has the bonus of making it easier to test on different environments without needing to deploy configuration changes.

Acceptance Criteria:

  • The configuration option $wgSecurePollTranslationImportSourceUrl is instead some kind of parameter that can be input by the user when they want to import translations from another wiki
    • bonus points if it can validate the API URL that's generated from the user input
    • bonus points if you have the option to pick a wiki by its name (eg metawiki) or some other user-friendly selection instead of having to know the API URL
  • The feature and how a non-technical user is expected to use it is documented on WikiTech

Context:
Some notes on how the feature e2e works: https://phabricator.wikimedia.org/T310909#8807183

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mimurawil changed the task status from Open to In Progress.Apr 14 2025, 5:53 PM
Mimurawil claimed this task.

Change #1138127 had a related patch set uploaded (by Mimurawil; author: Mimurawil):

[mediawiki/extensions/SecurePoll@master] Prefer a parameter for importing translations in SecurePoll

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

Just posting some test instructions (mostly copied from https://phabricator.wikimedia.org/T310909#8807183

To test this locally:

  1. Create test election pages (ie, TestElection/en, TestElection/fr)
  2. Populate those pages with a test election (you can get a working one from /extensions/SecurePoll/tests/qunit/data/parser/TextWithCorrectTags.txt
  3. Create a testing STV poll and go to the translations page
  4. When clicking on import translations, fill in the source API URL and the test page created previously
    Screenshot 2025-04-23 at 10.36.00 AM.png (549×241 px, 22 KB)
  5. You should see a report of the translation scripts
    Screenshot 2025-04-23 at 10.40.22 AM.png (519×466 px, 25 KB)

Change #1138127 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Prefer a parameter for importing translations in SecurePoll

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

The merged patch created a Wikimedia-production-error tracked in {T394900}

Change #1148824 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SecurePoll@master] Add mediawiki.ForeignApi.core as a dependency

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

Change #1148824 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] Add mediawiki.ForeignApi.core as a dependency

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

Change #1148830 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/SecurePoll@wmf/1.45.0-wmf.2] Add mediawiki.ForeignApi.core as a dependency

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

Change #1148830 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@wmf/1.45.0-wmf.2] Add mediawiki.ForeignApi.core as a dependency

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

Mentioned in SAL (#wikimedia-operations) [2025-05-21T13:13:44Z] <reedy@deploy1003> Started scap sync-world: Backport for [[gerrit:1148859|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148860|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148830|Add mediawiki.ForeignApi.core as a dependency (T387720)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-21T13:15:59Z] <reedy@deploy1003> reedy, stran: Backport for [[gerrit:1148859|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148860|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148830|Add mediawiki.ForeignApi.core as a dependency (T387720)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-05-21T13:24:36Z] <reedy@deploy1003> Finished scap sync-world: Backport for [[gerrit:1148859|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148860|Stop setting $wgCaptchaClass in extension.json files (T394814)]], [[gerrit:1148830|Add mediawiki.ForeignApi.core as a dependency (T387720)]] (duration: 10m 52s)