-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Modulestore Support for Content libraries (Part of SOL-1, SOL-2, SOL-3) #6033
Conversation
Thanks for the pull request, @bradenmacdonald! I've created OSPR-224 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here. |
Thanks for the heads-up, @bradenmacdonald. I think a code review by the architecture team is sufficient for this PR (T&L does not need to review). |
@bradenmacdonald this PR needs a rebase |
def get_libraries(self, **kwargs): | ||
''' | ||
Returns a list containing the top level XModuleDescriptors of the libraries in this modulestore. | ||
''' |
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.
Stylistically prefer """ rather than '''
Looks good at a brief pass from me. Handing off to the Platform team. Braden please be sure to rebase ASAP to get review attention. |
68fe2f1
to
1cbc1a8
Compare
@bradenmacdonald please take a look at build failures. This is now sitting in the platform team's backlog (ie @cpennington 's team) |
@@ -0,0 +1,80 @@ | |||
""" | |||
'library' XBlock/XModule |
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.
Why can't this just be a pure XBlock
?
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.
- When I wrote it, pure XBlocks didn't support children, and I was just copying the similar XModule used as the root of course structures. I can try converting this to an XBlock, though - it would be nicer.
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.
@doctoryes is in the middle of testing a fix to a bug that might hit you if this is a pure XBlock, but I think it would be good to try.
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.
@cpennington Good news: I converted it to an XBlock and it seems to work well: b0662e7
Two questions for you:
- I left it in the
xmodule
folder and tweaked xmodule'ssetup.py
as you can see in the commit - is this good, or is there some other place that new core XBlocks should go? - The new XBlock has no JavaScript (never calls
initialize_js
) and is a pure XBlock, so when I view the library in studio, theinitializeBlock
coffeescript code logs an error to the JS console saying its DIVis missing data-runtime, data-runtime-version or data-init, and can't be initialized
. This doesn't cause any problems, but creates a very long trace in the console as the entire HTML of the XBlock is logged with that error. Can I remove thatconsole.log
warning, or is there something I need to change/implement in the new XBlock?
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.
Hrm. I guess leaving it in xmodule
for now is fine, until we can split all of the core xblocks out into a separate repo entirely.
It seems like we should tweak that logging so that it only logs if it has some but not all of the data that it needs, rather than logging if it has none of them.
@sarina There are no build failures - just a single TODO comment in the quality check that's causing it to say tests failed. |
3b14337
to
b0662e7
Compare
Whoops - fat fingers. Didn't mean to close this PR just now. |
@bradenmacdonald this PR needs a rebase |
assert(isinstance(library_key, LibraryLocator)) | ||
store = self._get_modulestore_for_courseid(library_key) | ||
if not hasattr(store, 'get_library'): | ||
return None # This key seems invalid since its modulestore doesn't support libraries |
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.
I don't think self._get_modulestore_for_courseid
will ever return a store which will not support libraries. I don't think it's possible.
""" XML support not yet implemented. """ | ||
raise NotImplementedError | ||
|
||
def export_to_xml(self, resource_fs): |
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.
These should be parse_xml
and add_xml_to_node
, the XBlock serialization methods (rather than the XModule serialization methods you're defining now).
mostly 👍 w/ some possible noop questions. I'm curious how you're implementing the use of library content in a course esp after talking to @brianhw. I'll go back and read your spec again, but I'm wondering about maintaining block identity across course-like boundaries esp if used > 1x in borrowing course. |
root_block['edit_info']['previous_version'] = root_block['edit_info'].get('update_version') | ||
root_block['edit_info']['update_version'] = new_id | ||
old_def = self.get_definition(locator, root_block['definition']) | ||
new_fields = old_def['fields'] |
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.
This isn't doing the deepcopy
that the old code did, is it?
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 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.
Ah, ok.
975bf82
to
48354f7
Compare
48354f7
to
0ded669
Compare
Squashed commits in order to prepare PR to merging. |
A few minor niggles, but 👍 |
Modulestore Support for Content libraries (Part of SOL-1, SOL-2, SOL-3)
@cpennington @dmitchell @doctoryes @antoviaque @explorerleslie @cahrens
Background: This is the technical foundation required for Content Libraries. It is considered part of SOL-1, SOL-2, and SOL-3, with the corresponding UI changes separated out into #6046.
Discussion: Architecture discussed extensively on the wiki and in meetings, then the revised proposal was presented to the Arch Council on Oct. 21 and given thumbs up.
Partner information: 3rd party-hosted open edX instance, for an edX solutions client.
Merge deadline: ASAP - several other PRs are ready and blocking on this.
Dependencies: Requires openedx/opaque-keys#46, which is already merged.