-
Notifications
You must be signed in to change notification settings - Fork 510
Export all user data #5757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export all user data #5757
Conversation
27d2819 to
555878e
Compare
d7f558b to
81acae5
Compare
db4759d to
b62ba43
Compare
indico/migrations/versions/20230905_1200_e2b69fe5155d_add_user_data_export_table.py
Outdated
Show resolved
Hide resolved
indico/modules/users/schemas_test.py
Outdated
|
|
||
|
|
||
| def test_contribution_export_schema(snapshot, db, dummy_user, dummy_contribution, dummy_event_person): | ||
| from indico.modules.users.schemas import ContributionExportSchema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
importing this on the top level doesn't work? i wouldn't expect circular import issues in here :o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope :/ I'll try to dig into why later (it's the standard sqlalchemy error)
indico/migrations/versions/20230905_1200_e2b69fe5155d_add_user_data_export_table.py
Outdated
Show resolved
Hide resolved
17583e8 to
6d53b02
Compare
804ef0a to
b8204fd
Compare
More human- readable
Also add some logging
55e887f to
a02277f
Compare
Allows users to export all their user data stored in Indico. The export is a single zip file containing a yaml file
data.ymlwith all the data.Additionally, if the user has uploaded any files to Indico (attachments, abstracts, papers, registration file fields, etc..) these will also be included in the zip file in different subfolders.
Overview of the added functionality
A new tab is added in the user profile (
/user/data-export)You can select what categories you want to export. Once submitted, you will be notified via email when the
export is finished (successfully or not). You can also see the progress on the
Data exporttab.You can download the data using the link provided in the email or by going back to your user profile and downloading it from there:
To simplify things, only one request can exist at a time. When you request a new export, the old one is deleted (if finished, if it's still running you can't request it again).
When the export is processing:

When it has failed (hopefully should not happen, but at least we log failures)

When the export expires (by default the exports are cleaned after 1 month):

When the export exceeds maximum (configurable) size:

Technical overview
New DB model
DataExportRequestwas added. This object describes the export request - state, requested_dt, selected options, etc..It's in 1-to-1 relation with
User. You can get the current export request viauser.data_export_requestThere are two new endpoints, one to render the
Data exporttab (RHUserDataExport) and one for the API (RHUserDataExportAPI) which is used to create new requests and check the state.The data that ends up in
data.ymlis serialized usingUserDataExportSchema. Files written to the zip archive haveunique names.
The export itself is a celery task since it is expected to run for a long time (= lots of queries to do)
I added lots of new DB fixtures which I needed to test this PR. The schema tests use snapshots from
modules/users/tests.TODO:
Technically we still have the data for them..Yes