Skip to content

feat: add drf for studio video page - #33528

Merged
KristinAoki merged 12 commits into
masterfrom
KristinAoki/video-page-api-drf
Oct 27, 2023
Merged

feat: add drf for studio video page#33528
KristinAoki merged 12 commits into
masterfrom
KristinAoki/video-page-api-drf

Conversation

@KristinAoki

@KristinAoki KristinAoki commented Oct 17, 2023

Copy link
Copy Markdown
Contributor

Description

This PR adds a couple DRFs for the Course Authoring video page. No functionality to the Studio video page has been changed. This change impacts "Developers".

Testing instructions

  1. Test all the functionality on the Studio video page.
  2. Confirm that all clicks execute as expected.
  3. Navigate to the Course Authoring video page.
  4. Check that page loads as expected.

Deadline

None

Other information

course-authoring PR #640 is dependent on this PR. course-authoring PR #640 should be used used for testing step 3 and 4.

@jesperhodge jesperhodge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks great. I mainly left comments discussing the need for tests, as well as one small desired code structure change. However, I have been only able to test this by making requests via the swagger-ui to the new endpoints. Testing with your course-authoring branch I got TypeError undefined is not iterable (cannot read property Symbol(Symbol.iterator)) Call Stack  _iterableToArray   node_modules/react-dropzone/dist/es/utils/index.js:34:76.

This may very well be due to my local setup, although on master this error did not occur (but the list of videos was also empty on master.) At any rate it's a frontend problem and not a backend problem.
So I think in general this works but I have not tested it successfully with the frontend branch.

I was able to ascertain that nothing broke locally. However, since the video pipeline locally can't be tested, we'll just need to test this once more on stage before we deploy to prod. But I'm not worried about it.

Please push back if you don't share my thought that we need tests here.

Comment thread cms/djangoapps/contentstore/rest_api/v1/views/videos.py Outdated
Comment thread cms/djangoapps/contentstore/rest_api/v1/views/videos.py Outdated
Comment thread cms/djangoapps/contentstore/video_storage_handlers.py Outdated
Comment thread cms/djangoapps/contentstore/rest_api/v1/views/videos.py Outdated
Comment thread cms/djangoapps/contentstore/rest_api/v1/views/videos.py

@jesperhodge jesperhodge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!! Everything code-wise looks really really good. I just left the one remark that I think would be a good improvement, otherwise it's all ready.

if not has_studio_read_access(request.user, course_key):
self.permission_denied(request)

with modulestore().bulk_operations(course_key):

@jesperhodge jesperhodge Oct 26, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe an improvement here that would make the api view very flexible is to get rid of any calls to modulestore, so that the api view here is very easy to change later, since it then doesn't care how the data is provided. I would recommend extracting line 151 to 156 to a function and put that function into video_storage_handlers.

@jesperhodge jesperhodge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add an approve here so you don't need a re-review from me when the requested change is done.

@KristinAoki
KristinAoki merged commit 8cfd04f into master Oct 27, 2023
@KristinAoki
KristinAoki deleted the KristinAoki/video-page-api-drf branch October 27, 2023 13:04
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants