feat: fetch and filter out restricted course runs#939
Closed
iloveagent57 wants to merge 1 commit into
Closed
Conversation
369b97b to
8043576
Compare
pwnage101
reviewed
Sep 11, 2024
Contributor
|
The rest LGTM! |
Contributor
|
Hm, in the process of drafting an approach for ENT-9405 (draft PR: #947) it occurs to me that this current PR likely does not actually store restricted runs into the database as "orphan" ContentMetadata records because it only updates the call to /courses to get the full metadata, but an update to the /search/all call is missing. We definitely need both to be updated, so the changes in this PR are still necessary, but just FYI my PR introduces new API calls to fetch the restricted runs from /search/all and stores them as ContentMetadata records. Just so you know so we don't step over toes! |
b90bf77 to
c98b372
Compare
* When enabled, fetches restricted b2b runs during syncing of full course metadata from discovery. * Subsequently prevents restricted runs from being written to ContentMetadata.json_metadata before saving. * In a future PR, we'll make use of the pruned restricted runs on a per-customer-catalog fashion. ENT-9404
c98b372 to
35ebabf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local Testing
Set up a restricted course run locally
It'll be associated with DemoX: https://2u-internal.atlassian.net/wiki/spaces/SOL/pages/1317306375/Setting+up+restricted+runs+locally
Enable the setting
In your
private.pysettings file, setSHOULD_FETCH_RESTRICTED_COURSE_RUNS = TrueSync full course metadata
make worker-restart worker-logsmake app-shelland then./manage.py update_full_content_metadata --force[restricted runs] Course edX+DemoX has restricted runs {'course-v1:edX+DemoX+restricted_run'} that will be removed.Verify non-presence of restricted run in API
Fetch content metadata for the DemoX course in enterprise-catalog, i.e.
Observe that the restricted run is not included in the payload.
ENT-9404
Post-review