Repository navigation
refactor: slash-and-burn Poll BuiltIn XBlock - #38744
irfanuddinahmad wants to merge 6 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. |
f3724d8 to
83ca0c7
Compare
dd15236 to
155ae51
Compare
155ae51 to
ec54976
Compare
|
Found two real blockers to merging this while testing
This PR shouldn't merge until both are resolved in xblocks-core. Updated the test plan checkboxes above with a note on what the LMS/CMS checks actually cover (rendering, via an OLX-import workaround, since the normal editor is broken) and why CMS V2 Library stays unchecked — it's not a matter of testing harder, that flow is broken for any Poll created directly in a library. |
1221a7c to
b6cebd6
Compare
Removes the built-in Poll XBlock implementation and all associated assets now that the extracted `xblocks_contrib.poll.PollBlock` is the default (USE_EXTRACTED_POLL_QUESTION_BLOCK has been True since extraction). - Remove USE_EXTRACTED_POLL_QUESTION_BLOCK toggle from common.py - Remove poll_question entrypoint from pyproject.toml - Delete xmodule/poll_block.py (built-in class + shim) - Delete xmodule/js/src/poll/ (JS assets) - Delete lms/templates/poll.html - Delete xmodule/static/css-builtin-blocks/PollBlockDisplay.css - Remove PollBlockDisplay/PollBlockEditor webpack entries - Delete xmodule/tests/test_poll.py (covered by xblocks-contrib) Closes openedx/public-engineering#533 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
These tests already exercised the extracted block (via USE_EXTRACTED_POLL_QUESTION_BLOCK=True) and have no equivalent in xblocks-core, so keep them instead of deleting them. Only the BuiltIn variant and the toggle override are dropped; test names and logic are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.poll -> xblock_poll_question). Co-Authored-By: Claude Opus 5.5 <[email protected]>
6ecad1d to
d6cc318
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Removes the built-in Poll XBlock.
xblock_poll_question.PollBlockhas been the default sinceUSE_EXTRACTED_POLL_QUESTION_BLOCK = True, so the built-in code no longer runs.Step 1 of 8 of the Slash-n-Burn Built-In XBlocks epic. Closes openedx/public-engineering#533
Changes
Deleted:
xmodule/poll_block.py(built-in class + shim),xmodule/js/src/poll/,lms/templates/poll.html,PollBlockDisplay.css, thePollBlockDisplay/PollBlockEditorwebpack entries, the built-inpoll_questionentrypoint, and theUSE_EXTRACTED_POLL_QUESTION_BLOCKtoggle.Tests:
xmodule/tests/test_poll.pynow runs againstxblock_poll_question.PollBlock. Only the BuiltIn twin class and the toggle override were dropped; xblocks-core has no equivalent of these tests.Epic Step 1: Post-extraction commit review
Toggle flipped 2025-12-16 (
24cb3cf9f5). All 3 later commits topoll_block.pyare cosmetic (deprecation markers #38174, import sorting, 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.pytest xmodule/tests/(734 passed locally),npm run buildLMS and CMS content was authored through an OLX import, because Poll has no editor.
V2 Library checklist: 2/12 pass, the rest blocked by xblocks-core#274
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)
Poll-specific (see the openedx/xblocks-core#274 note below):
<answer>/<p>children, not only empty ones (parse_xml_new_runtimefalls back toXBlock.parse_xml). The built-inXmlMixinis identical, so this is pre-existing. Details: Poll XBlock: no Studio editing view, and empty Poll blocks are permanently unloadable in Content Libraries v2 xblocks-core#274 (comment of 2026-11-11). The earlier "paste a Poll with answers" workaround doesn't work.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.
Why xblocks-core#274 isn't a merge blocker
Re-checking the built-in code on master (
547da6f6a5) shows it has the same two gaps:_BuiltInPollBlockinheritsstudio_viewfromMakoTemplateBlockBase(xmodule/mako_block.py), which rendersself.mako_template. Nothing in Poll's class chain setsmako_template, so opening Edit on the built-in block raisesAttributeError. ThePollBlockEditorwebpack entry only bundlesxmodule.js, so there's no editor JS either.definition_from_xmlraisesValueError("Poll_question definition must include at least one 'answer' tag")for an empty Poll, exactly like the extracted block, and the V2 library runtime falls back toXBlock.parse_xmlfor Polls with answers in both.Setting
USE_EXTRACTED_POLL_QUESTION_BLOCK = Falsewould therefore not restore editing or library loading. This conclusion comes from reading the code; a runtime check against the built-in block can be done on a sandbox once sandbox deployments work again.Screenshots
7 screenshots (LMS, Studio unit, V2 Library)
Earlier sandbox deployment
CMS

LMS

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/38744.
🤖 Generated with Claude Code
Settings