Content libraries settings overrides (SOL-46) - #6399
Conversation
|
Thanks for the pull request, @bradenmacdonald! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: http://openedx-webhooks.herokuapp.com/github/process_pr?repo=edx%2Fedx-platform&number=6399 |
|
@dmitchell I've now opened an "official" PR here... It's essentially the same as what I re-wrote based on your feedback at open-craft#25 . Can you please take one more look and give me the thumbs up or let me know what needs changing? |
241e68d to
7f97429
Compare
|
@chrisndodge Here is the third PR I was mentioning for review yesterday - could you have a look at it too? Thanks! |
|
@antoviaque @bradenmacdonald taking a look now. I'm juggling a few things at the same time, unfortunately... |
There was a problem hiding this comment.
I believe I understand this change, but I'm surprised that it was like this earlier. Do you have any context?
There was a problem hiding this comment.
This is part of a method that loads multiple "definition" records at once. I don't think it gets used [very much] during normal use of the split modulestore at the moment, because definitions are generally lazy-loaded one at a time as needed. In an earlier version of this PR's code, I had to sometimes disable the lazy-loading and instead load all the definition records at once, but that was causing strange errors which I eventually tracked down to this bug that has existed in the code since Sep. 23 (1a682da).
I think this bug would no longer affect this branch since I re-wrote it and changed my approach, but it may as well be fixed...
|
Looking at the scope of changes here, I don't think I'm going to be a useful initial reviewer as the changes are pretty deep in modulestore and xblocks. Alas, at this point in time, I only have a "consumer" understanding of these frameworks :-) Can I propose @dmitchell if he has availability? |
|
On a general note, I see Jenkins is reporting missing coverage on the change set. I don't know if there is an opportunity to increase the unit test coverage on the PR, but it would certainly be a recommendation. |
|
@chrisndodge Thanks for taking a look. I have pushed 9fdf62b892be895df6c08852183a3c031e84cec7 and c431d49f3c1751d1c32ec1c122a7a1eeb06774a6 which should increase the coverage a tiny bit. However, most of the other lines showing as missing coverage come from other PRs - because Jenkins is calculating coverage against a diff with master, not a diff with the libraries feature branch. |
There was a problem hiding this comment.
When does it make sense for this to be False? all of your code has it as True.
There was a problem hiding this comment.
Yeah, I will just remove that. It is always True.
|
Done w/ review. Once you're certain of the open questions 👍 |
|
Test failures are unrelated. Just waiting for further feedback/review. |
16809dd to
76d3f35
Compare
48b4591 to
05a8716
Compare
There was a problem hiding this comment.
@bradenmacdonald most likely equal to
orig_descendants = list(self.descendants(dest_structure['blocks'], block_key, depth=None, descendent_map={}))
There was a problem hiding this comment.
Ya, I'm not really sure why I put a list comprehension there. It's possible it had a use in a previous version of the code. Thanks.
|
Sandbox updated with the latest code: http://sandbox3.opencraft.com:18010/ |
|
I created https://openedx.atlassian.net/browse/TNL-1109 for the TNL review. |
There was a problem hiding this comment.
But if the author refreshes their library block to get the most recent version of the library, their changes will not be kept, correct?
Actually, looking at the bok choy test, I see that my assumption was not correct. The changes specified within the course will be preserved, even after refresh from the source content library.
There was a problem hiding this comment.
No that's not correct. When a course author refreshes their library block, any Scope.settings changes they've made (display_name, weight, due_date, etc.) will be kept - that's part of the design goal here.
Any Scope.content changes will be lost. In future, we would like to have a way of preventing course authors from even trying to edit Scope.content fields for blocks brought in from a library, but that's currently not technically feasible.
There was a problem hiding this comment.
Should you include a test for the override after refresh? That is, change the library's default and refresh the courses use of it and then do the same fetch assertEqual tests you have here?
|
It would be good to have a second code reviewer of the common modulestore code (someone who isn't me...). |
There was a problem hiding this comment.
Calling this _course confused me for a sec as I assumed it was the course root. idk if it was just me this am.
There was a problem hiding this comment.
block1_in_course perhaps?
There was a problem hiding this comment.
I've renamed it to problem_in_course in the updated tests which I'm about to push.
|
👍 |
There was a problem hiding this comment.
Using inherit here worries me, since there's a risk of conflating it with InheritanceMixin and other similar code.
There was a problem hiding this comment.
What would be better? copy_from_template?
There was a problem hiding this comment.
Yeah, that would be better.
|
Pushed some fixes that address almost all comments so far - just waiting for advice on a better name for |
There was a problem hiding this comment.
Some more details about this "intermediate" form would be nice, since you understand it so well now. :)
|
👍 From TNL perspective, once there is a resolution about "inherited" and "inherit_copy". |
c005bdb to
3e7a8ab
Compare
|
@cpennington Thanks. I renamed inherit_copy to (Edit: you may want to revisit this question?) @cahrens Thanks for the review and the thumbs up! |
3e7a8ab to
9dc86d8
Compare
|
Just found a bug so I pushed a fix and a test for it ("test_copy_from_template_publish"). While doing that I moved some of the new tests to their own file as Christina had suggested. |
61591ba to
697adb1
Compare
|
👍 |
|
Thanks everyone! Merging now. |
…s-overrides Content libraries settings overrides (SOL-46)
Background: This PR allows course authors to use blocks from a content library but override any
Scope.settingsfields such asdisplay_nameorweight.Discussions: Basic idea was presented on the wiki page for content libraries and discussed w/ a few people at edX
Dependencies: Depends on the feature branch https://github.com/edx/edx-platform/commits/content-libraries
Dependents: This is currently blocking work on analytics support ( open-craft#26 ), which depends on these changes.
Sandbox URL: http://sandbox3.opencraft.com:18010/ (LMS at http://sandbox3.opencraft.com/ but shouldn't be needed)
Internal code reviews PRs: open-craft#6 open-craft#25
Partner information: 3rd party-hosted open edX instance, for an edX solutions client.
Author notes:
Scope.settings, which throws a wrench into the works. For this PR I have added a capa-specific workaround (20d07d2).