Export and archive internship feedback
Background
The Outreachy website database is currently storing internship feedback dating back to the December 2018 cohort. That information is not needed once an intern cohort is fully finished, so it should be exported and removed from the website.
We do want to use the internship feedback data to correlate against future longitudinal studies. For example, it would be good to know if mentors who connect their interns to other community members for informal career chats corresponds to alums who contribute to open source as part of their current job.
Data to export
- fields from from various classes: Initial{Mentor,Intern}Feedback, Midpoint{Mentor,Intern}Feedback, Final{Mentor,Intern}Feedback, Feedback{1-4}From{Intern,Mentor}
- export information about intern name, project title, community name, mentor name(s), feedback model name, and name of mentor that filled out the feedback
Export format:
- CSV export is probably the easiest format for human readability
- JSON export might be nice for preserving data types for data science
- explore the Django management dumpdata command - this might be useful for JSON export, but doesn't currently support CSV export
Issues
The FinalMentorFeedback object is currently used in various places in the Outreachy website to determine if an internship is "active". An active internship is one where either a) the intern's final internship stipend has not been paid, or b) the internship is not finished yet (and note that some internships may be extended for up to two weeks). The website checks if the intern's final internship stipend as been paid by looking for the FinalMentorFeedback object, and checking if the organizer_payment_approved flag is set.
This usage of the FinalMentorFeedback object is problematic if we want to remove those class objects from the database. If we don't do anything, the FinalMentorFeedback objects will be deleted, and the Outreachy website will think that all internships are active.
Add a new BooleanField to class InternSelection. Use that field to record whether the internship is active. The rules for this are very complicated, and I'm not sure if they're correct. Work with @sagesharp to make sure the list below is correct before you start implementing the migration code.
Create a custom migration that sets the new internship active field in various ways:
- False - for interns that successfully completed their internship and were paid. Look for a FinalMentorFeedback object for that intern with the organizer_payment_approved set.
- False - for interns that have a terminated internship. Look for InternSelection.in_good_standing set to False
- False - for interns in the May 2018 cohort where we didn't collect any feedback at all. InitialMentorFeedback, MidpointMentorFeedback, and FinalMentorFeedback objects will be missing completely, and their internship end date will be more than five weeks past. InternSelection.in_good_standing may be set to either True or False.
- True - interns in the current cohort. Their internship end date will not be after today's date. The FinalMentorFeedback object may be present or missing, depending on when we run the migration.
- True - for interns where their internship is ended, but the FinalMentorFeedback has organizer_payment_approved set to None. This means the Outreachy organizers are still processing the intern's feedback for some reason.
Revise the active internship contacts page to use the new flag. You'll need to edit the ActiveInternshipContactsView function for that page. You probably also need to edit the ActiveTrustedVolunteersListView.
There might be other templates or views that use the organizer_payment_approved flag. Some of them won't matter (like templates to view feedback that will no longer exist). Other templates may matter. You'll need to do a manual check of each instance of using FinalMentorFeedback.
Todo
- [ ] Write an export function that exports all prior feedback collected
- [ ] Add a new flag to the InternSelection model to indicate an internship is active
- [ ] Write a migration that sets that new internship active flag to True or False for all InternSelection objects
- [ ] (Sage) will export feedback from all cohorts that are not currently active
- [ ] Write code to stop relying on the final payment authorization data to determine if an internship is inactive. (See detailed plan above)
- [ ] (Sage) will delete all feedback objects associated with inactive internships from the website production database