Repository navigation
refactor: remove built-in Discussion XBlock implementation (slash-n-burn #37819) - #38749
irfanuddinahmad wants to merge 5 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. |
291afe6 to
7649131
Compare
12185a2 to
ab31c37
Compare
ab31c37 to
89e5060
Compare
89e5060 to
7b1e644
Compare
…urn #37819) Removes xmodule/discussion_block.py, its JS assets, built-in unit tests, the USE_EXTRACTED_DISCUSSION_BLOCK toggle, and the conflicting 'discussion' entrypoint in pyproject.toml now that the extracted version in xblocks-contrib is the only implementation. Updates production imports in dump_course_structure and discussions/utils to import DiscussionXBlock from xblocks_contrib.discussion. Note: lms/djangoapps/discussion/ Django app is NOT in scope for this removal. 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-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 <noreply@anthropic.com>
7b1e644 to
ff56d3a
Compare
Same nits as reviewed on #38745: - Drop the extra blank line left in openedx/envs/common.py after the toggle removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Removes the built-in Discussion XBlock.
xblock_discussion.DiscussionXBlockhas been the default sinceUSE_EXTRACTED_DISCUSSION_BLOCK = True, so the built-in code no longer runs.Part of the Slash-n-Burn Built-In XBlocks epic. Closes openedx/public-engineering#538
Changes
Deleted:
xmodule/discussion_block.py(built-in class + shim),xmodule/js/src/discussion/display.js, and theUSE_EXTRACTED_DISCUSSION_BLOCKtoggle.Changed: the
discussionentrypoint inpyproject.tomlis re-pointed fromxmodule.discussion_block:DiscussionXBlocktoxblock_discussion:DiscussionXBlock. It isn't removed, because xblocks-core only registers_discussion_extracted(for testing), so existingdiscussioncontent needs this name.Release notes: one Willow dev/op entry covers all 8 blocks: openedx/docs.openedx.org#1554 (draft until the platform PRs land).
Modified:
lms/djangoapps/courseware/management/commands/dump_course_structure.pyandopenedx/core/djangoapps/discussions/utils.pyimportDiscussionXBlockfromxblock_discussion.Tests:
xmodule/tests/test_discussion.py(4 tests)src/xblock_discussion/tests/: same names; 2 near-identical, 2 differ only in.format()vs f-stringKept in the platform:
lms/djangoapps/courseware/tests/test_discussion_xblock.py, which importsDiscussionXBlockfromxblock_discussion.Epic Step 1: Post-extraction commit review
Toggle flipped 2026-04-15 (
c534f5754f). The 1 later commit is cosmetic (lint-amnesty). A legacy-attribute fix (d71f81312d) landed the day before the toggle; xblocks-core already has an equivalent fix (0dd64cd, 2026-04-02). 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.discussionisn't an allowed V2 library block typedump_course_structureruns on a course with 3 Discussion blocks (exit 0, all listed)pytest lms/djangoapps/courseware/tests/test_discussion_xblock.py(18 passed locally),npm run buildTesting notes and edge cases (local Tutor nightly, 2026-11-12):
XBlock.add_xml_to_nodefirst in the method resolution order (checked in the code, and confirmed by the export run below).discussionisn't an allowed V2 library block type, so the library UI can't create it. A block forced in through the REST API returns 500; that wasn't compared with the built-in block.dump_course_structureruns on a course with 3 Discussion blocks (exit 0). The kepttest_discussion_xblock.py(18 tests) passes.USE_EXTRACTED_*_BLOCK = False(built-in) and on this branch; thediscussionfiles and its unit are identical. Discussion exports inline in both. Checked 2026-11-19.V2 Library checklist: N/A (Discussion isn't offered in libraries); L10 export identical to the built-in block
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)
USE_EXTRACTED_*_BLOCK = False(built-in) and on this branch; thediscussionfiles and its unit are identical. Discussion exports inline in both.Discussion-specific:
discussionisn't in/api/libraries/v2/<lib>/block_types/)dump_course_structurestill runs on a course containing a reused Discussion block — not ticked: a reused block isn't possible (D1);dump_course_structurepasses on a course with 3 Discussion blocksLibrary 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/38749.
🤖 Generated with Claude Code
Settings