-
Notifications
You must be signed in to change notification settings - Fork 447
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
feat: enhance importdemocourse ; add importdemolibraries #998
feat: enhance importdemocourse ; add importdemolibraries #998
Conversation
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.
Awesome! This is ready to merge, except that I'd rather not force the version bump just now. Quince.2 is coming tomorrow, so maybe we can bundle this feature with the new release? I don't know how to remove a commit from a PR, can you please do it yourself?
course_root=/tmp/course/{repo_dir} | ||
else | ||
course_xml_first="$(find /tmp/course -name course.xml | head -n 1)" | ||
course_xml_extra="$(find /tmp/course -name course.xml | tail -n +2)" |
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.
the force is strong with this bash developer.
echo "INFO: Will import course data at: $course_root" && echo | ||
|
||
# Import into CMS | ||
python ./manage.py cms import ../data "$course_root" |
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.
Do we want to automatically import demo libraries if we detect a library.xml file? There would remain the difficulty of defining the importing user name.
We don't have to decide this now, this would be a new feature that would land in Redwood.
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.
There would remain the difficulty of defining the importing user name.
That is indeed the difficulty :) In my previous attempt I had made it so the library is imported iff a library owner is provided. It think it was slightly counterintuitive that --library-owner
controls whether or not libraries are imported.
I do think the separate importdemolibraries
command makes it very clear what is going on, and it is not much more typing for someone to do, so personally I am OK leaving it as-is.
1d824eb
to
974134e
Compare
Quince.2 is tomorrow--perfect! Version bump removed. |
Description
This is a redo of #976, with the following differences:
importdemocourse
, we now auto-find course.xml if--repo-dir
is not provided. This simplifies the CLI and makes the command backwards-compatible 🎉--repo-library-tar
argument, the command now searches for directories with library.xml files, runtar
on them, and imports them. I've done this to:There's excitement to have the new demo course available ASAP, so in my second commit, I take the liberty of bumping the version to v17.0.2 and runningNo need to bump the version now since Quince.2 is coming out tomorrow.scriv collect
. If you'd rather do that yourself @regisb , please feel free to chop off that last commit.Testing
Happy paths
Import the old demo course
Import the new demo course and library
See #976 for more details.
Sad paths
Fail to import a demo course (no course.xml)
tutor dev do importdemocourse --version kdmccormick/zero-course-xmls
Fail to import a demo course (multiple course.xmls)
tutor dev do importdemocourse --version kdmccormick/multiple-course-xmls
Fail to import demo libraries (no library.xmls)
tutor dev do importdemolibraries admin --version open-release/quince.1
Fail to import demo libraries (library.xml outside of library/ dir)