Repository navigation
refactor: remove built-in Video XBlock implementation (slash-n-burn #37819) - #38750
irfanuddinahmad wants to merge 10 commits into
Conversation
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
bd94b9b to
d841d89
Compare
d02bd44 to
f18930d
Compare
27a1012 to
395855b
Compare
395855b to
ae23d30
Compare
…37819) 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 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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 <[email protected]>
… (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 <[email protected]>
…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 <[email protected]>
This test file was added on master after the branch was cut and still imported the removed xmodule.video_block package. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…trib VideoBlock test_video_handlers.py (41 tests) and test_video_mongo.py (50 tests) load the block through the xblock entrypoint (BaseTestXmodule, CATEGORY='video'), so they were already exercising the extracted VideoBlock. They are LMS integration tests that cannot move to xblocks-core as-is, so keep them here instead of deleting them (supersedes openedx/xblocks-core#264/#265). - Drop the USE_EXTRACTED_VIDEO_BLOCK branch (keep the extracted path). - Patch edxval.api.* directly. The old 'xmodule.video_block.video_block. edxval_api.X' targets resolved to the edxval.api module object anyway. - Patch xblocks_contrib.video.VideoBlock.* instead of the removed shim. - Move instantiate_block/VideoBlockTestBase out of the deleted xmodule/tests/test_video.py; xblocks-core does not ship its tests in the wheel, so they cannot be imported from there. VideoBlockTest now builds the extracted block (previously it built _BuiltInVideoBlock). Test names and assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
xblocks-core 2.0.0 (#38473) removed the xblocks_contrib package. Point the platform entrypoint, imports and mock.patch targets at the new per-block packages (e.g. xblocks_contrib.video.video -> xblock_video.block). Co-Authored-By: Claude Opus 5.5 <[email protected]>
ae23d30 to
06a193a
Compare
Summary
Removes the built-in Video XBlock.
xblock_video.VideoBlockhas been the default sinceUSE_EXTRACTED_VIDEO_BLOCK = True, so the built-in code no longer runs.Part of the Slash-n-Burn Built-In XBlocks epic. Closes openedx/public-engineering#539
Changes
Deleted:
xmodule/video_block/(video_block.py,video_utils.py,video_xfields.py,__init__.py),VideoBlockDisplay.cssandVideoBlockEditor.css, theVideoBlockDisplay/VideoBlockEditorwebpack entries, the built-invideoandvideoalphaentrypoints, and theUSE_EXTRACTED_VIDEO_BLOCKtoggle.Modified:
lms/djangoapps/course_api/blocks/transformers/video_urls.py:rewrite_video_urlis inlined here, its only caller.VideoBlockand everymock.patchtarget underxmodule.video_block.*now points atxblock_video, including the newercms/.../test_youtube_transcripts.py.Tests:
xmodule/tests/test_video.py(37 tests, imported_BuiltInVideoBlock)src/xblock_video/tests/: same names; 35 near-identical, 2 adapted to the extracted block's service and patch targetsKept in the platform (they use
BaseTestXmodule, so they already ran against the extracted block; supersedes openedx/xblocks-core#264 and #265):lms/djangoapps/courseware/tests/test_video_handlers.pyandtest_video_mongo.py, with test names and assertions unchanged. Changes: the toggle branch collapsed to the extracted path;xmodule.video_block.video_block.edxval_api.<fn>patches now targetedxval.api.<fn>(the old target was that module anyway);xmodule.video_block.VideoBlock.<method>patches now targetxblock_video.VideoBlock.<method>;instantiate_block/VideoBlockTestBasecopied in from the deletedtest_video.py, since the xblocks-core wheel doesn't ship tests.Epic Step 1: Post-extraction commit review
Toggle flipped 2026-03-16 (
59d152d210). All 5 later commits toxmodule/video_block/are cosmetic (deprecation markers #38174, ruff suppression, import sorting ×2, lint-amnesty). Nothing to port.Test plan
Tested on a local Tutor nightly (master
6f85d63c7f+ xblocks-core 2.0.0) through the REST APIs and a headless browser, because PR sandboxes aren't deploying (open-craft/pr-sandbox-automation#28). A box is ticked only if that flow actually ran.rewrite_video_urlwas inlined): covered bytest_video_urls.py(3 passed); not exercised with a real CDN configtest_video_handlers.pyandtest_video_mongo.py,test_video_urls.py,test_video_xml.py,test_youtube_transcripts.py,test_transcripts.py;npm run buildV2 Library checklist: 9/15 pass (L8, V4, V5 hit the pre-existing gaps above; V1, V3 playback and L10 export diff not checked)
Content Libraries V2: smoke tests (historically the most fragile area for extracted blocks: openedx/xblocks-core#123, openedx/xblocks-core#132, openedx/xblocks-core#243, openedx/xblocks-core#274)
editor_savedare identical and don't recorddownstream_customized(Video: course-side title override of a library-synced Video is lost on sync (editor_saved doesn't call super) xblocks-core#326)Video-specific (from ULMO TC-00323/00324/00325, the Video test report and #37829 notes):
.srttranscript, save, then reopen the editor (regression check for Video Block - Content Library Video Editor producing crash logs xblocks-core#243); the transcript is still listedstatic/and read asstatic/static/…, Library V2 video transcripts: path stored as static/… and read as static/static/… (download 404, LMS 404, orphan asset on delete) #39367)static/transcript-en.srtasset (same bug as V4, Library V2 video transcripts: path stored as static/… and read as static/static/… (download 404, LMS 404, orphan asset on delete) #39367)Library checklist compiled from the Aximprovements manual test doc (Extracted Block Tests tab) and the Ulmo test sheet's library cases. Generated using Claude Code.
Screenshots
5 screenshots (LMS, Studio unit, V2 Library)
Local Tutor nightly, 2026-11-12
Captured automatically during the local smoke tests (the sandbox isn't reachable yet, see open-craft/pr-sandbox-automation#28). All images: irfanuddinahmad/edx-platform@snb-smoke-screenshots/38750.
🤖 Generated with Claude Code
Settings