Page MenuHomePhabricator

Minimal viable product for the maintenance import script
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

Continuing T416949 we will merge a first version of the maintenance script. This will allow us to demonstrate the transfer of information from CiviCRM end to end.

User story

As a user I want my donor status synced with my account so that the interface tailors itself to me.

Precursors

Requirements

  • Code should live in WikimediaCustomizations as we will need to share constants with preferences.
  • The script is merged and can be manually run in production

The script will process every file in the provided CSV as follows:

  • Make the maintenance script accept the CSV pathe on standard input. This is really important for making it k8s friendly (it will likely be located at /var/lib/fundraising-data-uploader)
    • If the e-mail address does not correspond with any user in the user table, the row will be discarded.
  • If the e-mail address corresponds with a user who has not consented to donor identification the row will be discarded.
  • If the e-mail address corresponds with a user that has not confirmed their email address the row will be discarded.
    • If the email address corresponds with a user that has confirmed their email address and given consent, a donor preference will be derived from the donor segment provided by the CSV. This will be a json with the donor status value (since preferences are stored as a blob Amir recommended this is preferable to multiple preferences). In future the blob will allow us to also store date of consent and possibly version number if we need to make breaking changes
  • After the CSV has been fully processed (and is not using dry-run), the CSV will be discarded (or will notify an external service that this has been done)
  • The script takes a dry-run parameter to allow us to update

Descoped for follow up in T424089: Discuss batching requirements for finalizing the donor preference sync script

[] The script can operate safely on ~250k contacts normally, ~1m when donation volume is higher. See {T418164#11643063}
[] The script should be able to handle large CSVs e.g. 1 million rows in a way that doesn't cause problems for SRE.

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

  • Add mockups and design requirements

Acceptance criteria

  • We have a merged patch that is capable of parsing the file exported by CiviCRM
  • The script can process large CSVs and has safeguards in place to avoid writing / reading too many rows from the database.

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

Event Timeline

Jdlrobson-WMF set the point value for this task to 5.Mar 23 2026, 5:17 PM
Jdlrobson-WMF moved this task from Backlog to Ready for sprint on the Reader Experience Team board.
Jdrewniak changed the task status from Open to Stalled.Mar 24 2026, 5:44 PM
Jdlrobson-WMF changed the task status from Stalled to Open.Apr 7 2026, 5:38 PM
Jdlrobson-WMF updated the task description. (Show Details)
HFan-WMF lowered the priority of this task from High to Medium.Apr 9 2026, 5:03 PM
HFan-WMF subscribed.

Triaging to medium in the context of the sprint

@Jdlrobson-WMF Have we decided on "Discuss whether we should store a JSON blob or an integer" ?

I would like us to store as a JSON blob, yes. The maintenance script should be flexible/robust enough that we can easily change the storage requirement at a later date prior to launch.

and is https://gerrit.wikimedia.org/r/plugins/gitiles/wikimedia/fundraising/tools/+/refs/heads/master/mediawiki_donor_export/sample_output.csv still the format we expect for the csv?

yes.

Do we know what the structure of the JSON would be? which fields or we start with one field?

Jdlrobson-WMF raised the priority of this task from Medium to High.Apr 14 2026, 9:37 PM

Change #1275487 had a related patch set uploaded (by Aude; author: Aude):

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaCustomizations] Add CentralAuth dependency

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

Change #1275487 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaCustomizations] Add CentralAuth dependency

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

Mentioned in SAL (#wikimedia-releng) [2026-04-21T13:27:43Z] <James_F> Zuul: [mediawiki/extensions/WikimediaCustomizations] Add CentralAuth dependency, for T420548

Change #1276725 had a related patch set uploaded (by Aude; author: Aude):

[integration/config@master] 1275487: Zuul: [mediawiki/extensions/WikimediaCustomizations] Add AntiSpoof dependency

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

Change #1276725 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/WikimediaCustomizations] Add AntiSpoof dependency

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

Mentioned in SAL (#wikimedia-releng) [2026-04-23T15:47:16Z] <James_F> Zuul: [mediawiki/extensions/WikimediaCustomizations] Add AntiSpoof dependency, for T420548

Jdlrobson-WMF renamed this task from Finalize the maintenance import script to Minimal viable product for the maintenance import script.Apr 24 2026, 10:17 PM
Jdlrobson-WMF updated the task description. (Show Details)

We ran the maintenance script successfully on Tuesday 5th.