Skip to content

feat: remove built-in Video XBlock implementation (slash-n-burn #37819)#38750

Open
irfanuddinahmad wants to merge 7 commits into
masterfrom
irfanuddinahmad/slash-and-burn-video-block
Open

feat: remove built-in Video XBlock implementation (slash-n-burn #37819)#38750
irfanuddinahmad wants to merge 7 commits into
masterfrom
irfanuddinahmad/slash-and-burn-video-block

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the built-in Video XBlock from xmodule/ as part of the Slash-n-Burn Built-In XBlocks epic (#37819). The extracted version in xblocks-contrib has been the active implementation since USE_EXTRACTED_VIDEO_BLOCK was set to True.

Deleted:

  • xmodule/video_block/ (entire directory: video_block.py, video_utils.py, video_xfields.py, init.py)
  • xmodule/tests/test_video.py — built-in unit tests
  • lms/djangoapps/courseware/tests/test_video_handlers.py — tests patching built-in edxval_api internals
  • lms/djangoapps/courseware/tests/test_video_mongo.py — tests patching built-in edxval_api internals
  • xmodule/static/css-builtin-blocks/VideoBlockDisplay.css and VideoBlockEditor.css

Modified:

  • openedx/envs/common.py — removed USE_EXTRACTED_VIDEO_BLOCK toggle
  • pyproject.toml — removed both video and videoalpha entrypoints
  • webpack.builtinblocks.config.js — removed VideoBlockDisplay and VideoBlockEditor entries
  • lms/djangoapps/course_api/blocks/transformers/video_urls.py — inlined rewrite_video_url (was the only caller of xmodule.video_block.video_utils.rewrite_video_url)
  • All test files importing VideoBlock: updated to xblocks_contrib.video.VideoBlock
  • All mock.patch paths targeting xmodule.video_block.: updated to xblocks_contrib.video.

Note on deleted tests: test_video_handlers.py (1355 lines) and test_video_mongo.py (2605 lines) patch internal methods of the built-in VideoBlock (edxval_api module paths, EXPORT_IMPORT_* constants) that no longer exist. These tests cannot be straightforwardly migrated without knowledge of xblocks-contrib's internal structure.

Test plan

  • Run pytest lms/djangoapps/course_api/blocks/transformers/tests/test_video_urls.py — all 3 CDN rewrite tests pass
  • Run pytest lms/djangoapps/courseware/tests/test_video_xml.py
  • Verify Video XBlocks in a live course still render (served by xblocks-contrib)
  • Verify webpack build succeeds (VideoBlockDisplay/VideoBlockEditor entries removed)

🤖 Generated with Claude Code

Closes openedx/public-engineering#539

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 11, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @irfanuddinahmad!

This repository is currently maintained by @openedx/wg-maintenance-openedx-platform.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jun 11, 2026
@irfanuddinahmad irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-video-block branch from bd94b9b to d841d89 Compare June 11, 2026 12:53
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 11, 2026
@irfanuddinahmad irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-video-block branch from d227bd7 to b52f988 Compare June 12, 2026 11:53
Irfan Ahmad and others added 5 commits June 12, 2026 21:55
Removes xmodule/video_block/, CSS assets, the USE_EXTRACTED_VIDEO_BLOCK
toggle, and both 'video'/'videoalpha' entrypoints in pyproject.toml now
that the extracted version in xblocks-contrib is the only implementation.
Inlines rewrite_video_url into video_urls.py (sole production caller).
Updates all test file imports and mock.patch paths from xmodule.video_block
to xblocks_contrib.video. Deletes test_video_handlers.py and
test_video_mongo.py which patch edxval_api internal paths that no longer
exist in xmodule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
xblocks_contrib.video.video uses get_edxval_api() from video_utils,
not a module-level edxval_api attribute. Patching the non-existent
attribute raised AttributeError in mock.patch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@irfanuddinahmad irfanuddinahmad force-pushed the irfanuddinahmad/slash-and-burn-video-block branch from d02bd44 to f18930d Compare June 12, 2026 16:55
Irfan Ahmad and others added 2 commits June 12, 2026 23:47
… (PT008)

Ruff PT008 requires using return_value= instead of lambda when patching.
Using new=MagicMock(return_value=None) avoids injecting a mock arg into
the test function signatures while satisfying the lint rule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fixture

The USE_EXTRACTED_VIDEO_BLOCK toggle was removed; test_api.py now asserts
xblocks_contrib directly. VideoBlockEditor.css was deleted with the video
block; tests updated to use HtmlBlockEditor.css which still exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

[Refactor] Slash-n-Burn Video BuiltIn XBlock

3 participants