Contract work for edX Enterprise.
This PR adds the ability for the reporting scripts to take into account reporting configurations with arbitrary data and report types, e.g. Catalog CSV reports, Progress CSV reports, and so on.
In particular it's meant to fulfill the use case of direct integration customers who cannot actually use the API directly, to obtain their catalog data instead through CSV format by re-using the existing reporting configuration code infrastructure.
1. Use the Docker Devstack here. Bring up all containers.
2. Make sure you have the Enterprise feature enabled.
3. Create an Enterprise Customer. No special configuration is required.
4. Create an Enterprise Customer Catalog. The default fillings for fields should do – just link it to the customer from before.
5. Create an Enterprise Customer Reporting Configuration. Link it to the customer, and fill in whatever fields make sense, even with fake data if needed. The data type should be 'Catalog' though, and the config should be active.
6. Get this repository, and change the `enterprise_reporting.send_enterprise_reports.should_deliver_report` function to always return `True` temporarily (so you don't have to deal with schedule issues).
7. According to the delivery method you chose in the reporting config, put a `from pdb import set_trace;set_trace()` line after `data_report_zipped = super().send(files)` is called in the appropriate `send` method (or use whatever debugging technique you know). This is because you likely don't have a proper FTP server setup for SFTP nor proper SMTP settings in your devstack to send email, so it will just crash. You want to stop abruptly here to investigate the CSV and ZIP files produced by the script before they get deleted.
8. Run this monster:
LMS_OAUTH_KEY=discovery-key LMS_OAUTH_SECRET=discovery-secret LMS_ROOT_URL=http://localhost:18000 LMS_OAUTH_HOST=http://localhost:18000 LMS_FERNET_KEY='DUMMY KEY CHANGE BEFORE GOING TO PRODUCTION' SEND_EMAIL_FROMemail@example.com' python enterprise_reporting/send_enterprise_reports.py
9. If all goes well, and your configuration was OK, you'll reach the debugger's stop point. Go to your system's `/tmp` folder to find the appropriate ZIP file produced by the script.
10. Investigate the contents of the zip file, and ensure they make sense. This will also depend upon what you have configured in your course discovery.