Page MenuHomePhabricator

Perform CPR on Matching Gifts process.
Closed, ResolvedPublic

Description

Folks want to start using the Employer autocomplete form variants added last year. Let's bring this module back to life and add in the missing process to deploy the matching gift employer's data file as originally envisaged.

Sample variant link: https://payments.wikimedia.org/index.php?title=Special:IngenicoGateway&appeal=JimmyQuote&ffname=cc-vmad&payment_method=cc&recurring=0&uselang=en&language=en&currency=USD&amount=1&country=US&utm_campaign=internal_test&variant=employer

Background context from IRC discussion:
22:07 <jgleeson> fr-tech, done some digging on the matching gifts stuff and it looks like the last time we updated matching gifts employers from the SSB/Hep Data API was July 2020. We have a process-control job called matching_gifts_sync that's currently turned off which will pull in updates every six-hours. As a first step, we should run this to update this data and instate that scheduled sync job. This will mean acoustic is also getting out of date matching gifts data atm.

22:18 <jgleeson> the next piece on this is the drush command to generate the latest matching gifts employers csv. this is done by calling drush civicrm-matching-gifts-employers-check which calls the sync, checks the output against any existing CSV if present and if the output is newer it overwrites the data. the output path for this file is currently set to /srv/matching_gifts/employers.csv on civi1001 and managed here https://civicrm.wikimedia.org/admin/config/wmf_civicrm/matching_gifts

22:27 <jgleeson> so there is currently an employers.csv file at frpm1001:/localsettings/payments-wiki/employers.csv
22:27 <jgleeson> I wonder if we're deploying that with payments
22:27 <jgleeson> already
22:28 <Jeff_Green> the project name is payments-wiki, and we have this in the postinstall steps:
22:28 <Jeff_Green> - install employers.csv
22:28 <Jeff_Green> so yes! I think?
22:28 <jgleeson> I found this Jeff_Green dwisehaupt https://phabricator.wikimedia.org/T259662

Next Steps:
22:42 <jgleeson> ok so there are six things to do, 1) manually run the cvapi MatchingGiftPolicies.Sync job on live civi1001 to pull in the last 6 months worth of HEP employer data bringing it up to date. 2) switch on the process-control job which calls that same sync every 6 hours. 3) add a new process-control job to call the drush civicrm-matching-gifts-employers-check command presumably on a similar frequency but with some head room for the first command. the check command will also email fr-tech when an update is detected and include the path on civi1001 of the latest file. 4) add $wgDonationInterfaceEmployersListDataFileLocation to frpm1001:/localsettings/payments-wiki/LocalSettings.php with the actual location on the server that the file will be deployed to on live. 5) try out the end-to-end process to confirm it works, again 6) update https://www.mediawiki.org/wiki/Fundraising_tech/Chores to explain the process for deploying the latest matching gifts data as outlined here

22:48 <dwisehaupt> that looks correct to me. and the manual steps would be for the chores person to review the diff, commit that to localsettings, and deploy?
22:48 <dwisehaupt> everything else being automated at this point.
22:50 <jgleeson> yep yep

Event Timeline

$wgDonationInterfaceEmployersListDataFileLocation needs to be set to '/srv/www/org/wikimedia/payments/employers.csv' in prod

It looks like when the data file is updated via the drush civicrm-matching-gifts-employers-check cmd, new items aren't being sorted correctly.

Ideally, the full list of companies should be re-sorted when new items are added before being output to csv.

We tested the end-to-end process live tonight manually and the autocomplete field form on the employers variant worked as expected.