-
Notifications
You must be signed in to change notification settings - Fork 365
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
Add no-users option to DumpImporter and DumpExporter #1165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1165 +/- ##
==========================================
+ Coverage 63.68% 63.82% +0.13%
==========================================
Files 233 233
Lines 17113 17131 +18
==========================================
+ Hits 10899 10934 +35
+ Misses 6214 6197 -17
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thanks. Observe that this feature is conceptually very similar to a contest loader: there is some task data and one wants to import it. Just for clarification, do you use it for a similar purpose, e.g., prepare a contest on a staging server and import it on a testing/production server? |
Yes, this is for the purpose you mentioned. The 'staging' server as well as the testing/production server are both CMS. At the moment, this is done by exporting the contest (using Would you recommend looking into implementing a |
Thanks for the explanation. I think the "recommended" and more robust solution would be to prepare the contest using one of the loader formats in the first place, and import it both on the staging and production servers. But I suppose a complementary solution like this one can be added as well, if it is useful. In this case, you should also add the same option to |
4bb28c4
to
d273682
Compare
@andreyv Requested changes have been made, do review when you have the time. Thanks once again :) |
9376f74
to
f41a5d8
Compare
Thanks, it looks good now. I see that you added tests and also fixed a bug that could cause I added some minor changes in f41a5d8:
I'll merge this MR in a few days if you have no further comments. |
Merged! |
* feat: Allow DumpExporter to only export tasks * fix: Dump exporter tests * fix: Add DumpExporterTest for skip_users, fix bug * feat: Add no-users option to DumpImporter * fixup Co-authored-by: Andrey Vihrov <andrey.vihrov@gmail.com>
* feat: Allow DumpExporter to only export tasks * fix: Dump exporter tests * fix: Add DumpExporterTest for skip_users, fix bug * feat: Add no-users option to DumpImporter * fixup Co-authored-by: Andrey Vihrov <andrey.vihrov@gmail.com>
* feat: Allow DumpExporter to only export tasks * fix: Dump exporter tests * fix: Add DumpExporterTest for skip_users, fix bug * feat: Add no-users option to DumpImporter * fixup Co-authored-by: Andrey Vihrov <andrey.vihrov@gmail.com>
At the moment, when exporting a contest using
cmsDumpExporter
, there is no option to omit information related to users during the export.Thus, any user which is related to the contest (participants, admin, etc..) will also be included in the dump file. When importing this dump file into another CMS instance,
cmsDumpImporter
will attempt to create these users. If existing users with the same username exists, this will result in databaseIntegrityError
, causing the import to fail.This PR introduces the option to export a contest without any user information via
cmsDumpExporter
. (i.e. Just the tasks itself).This change is