Skip to content

Commit 4ca32dc

Browse files
authored
chore: mark the enabled built-in blocks deprecated (#38174)
1 parent 6e50d3b commit 4ca32dc

7 files changed

Lines changed: 117 additions & 21 deletions

File tree

openedx/envs/common.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,53 +2039,48 @@ def add_optional_apps(optional_apps, installed_apps):
20392039
# Ticket: https://github.com/openedx/edx-platform/issues/35308
20402040

20412041
# .. toggle_name: USE_EXTRACTED_WORD_CLOUD_BLOCK
2042-
# .. toggle_default: False
2042+
# .. toggle_default: True
20432043
# .. toggle_implementation: DjangoSetting
20442044
# .. toggle_description: Enables the use of the extracted Word Cloud XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
20452045
# .. toggle_use_cases: temporary
2046-
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34840 is done.
20472046
# .. toggle_creation_date: 2024-11-10
2048-
# .. toggle_target_removal_date: 2025-06-01
2047+
# .. toggle_target_removal_date: 2026-04-10
20492048
USE_EXTRACTED_WORD_CLOUD_BLOCK = True
20502049

20512050
# .. toggle_name: USE_EXTRACTED_ANNOTATABLE_BLOCK
2052-
# .. toggle_default: False
2051+
# .. toggle_default: True
20532052
# .. toggle_implementation: DjangoSetting
20542053
# .. toggle_description: Enables the use of the extracted annotatable XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
20552054
# .. toggle_use_cases: temporary
2056-
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34841 is done.
20572055
# .. toggle_creation_date: 2024-11-10
2058-
# .. toggle_target_removal_date: 2025-06-01
2056+
# .. toggle_target_removal_date: 2026-04-10
20592057
USE_EXTRACTED_ANNOTATABLE_BLOCK = True
20602058

20612059
# .. toggle_name: USE_EXTRACTED_POLL_QUESTION_BLOCK
2062-
# .. toggle_default: False
2060+
# .. toggle_default: True
20632061
# .. toggle_implementation: DjangoSetting
20642062
# .. toggle_description: Enables the use of the extracted poll question XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
20652063
# .. toggle_use_cases: temporary
2066-
# .. toggle_warning: Not production-ready until https://github.com/openedx/edx-platform/issues/34839 is done.
20672064
# .. toggle_creation_date: 2024-11-10
2068-
# .. toggle_target_removal_date: 2025-06-01
2065+
# .. toggle_target_removal_date: 2026-04-10
20692066
USE_EXTRACTED_POLL_QUESTION_BLOCK = True
20702067

20712068
# .. toggle_name: USE_EXTRACTED_LTI_BLOCK
2072-
# .. toggle_default: False
2069+
# .. toggle_default: True
20732070
# .. toggle_implementation: DjangoSetting
20742071
# .. toggle_description: Enables the use of the extracted LTI XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
20752072
# .. toggle_use_cases: temporary
2076-
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
20772073
# .. toggle_creation_date: 2024-11-10
2078-
# .. toggle_target_removal_date: 2025-06-01
2074+
# .. toggle_target_removal_date: 2026-04-10
20792075
USE_EXTRACTED_LTI_BLOCK = True
20802076

20812077
# .. toggle_name: USE_EXTRACTED_HTML_BLOCK
2082-
# .. toggle_default: False
2078+
# .. toggle_default: True
20832079
# .. toggle_implementation: DjangoSetting
20842080
# .. toggle_description: Enables the use of the extracted HTML XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
20852081
# .. toggle_use_cases: temporary
2086-
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
20872082
# .. toggle_creation_date: 2024-11-10
2088-
# .. toggle_target_removal_date: 2025-06-01
2083+
# .. toggle_target_removal_date: 2026-04-10
20892084
USE_EXTRACTED_HTML_BLOCK = True
20902085

20912086
# .. toggle_name: USE_EXTRACTED_DISCUSSION_BLOCK
@@ -2095,7 +2090,7 @@ def add_optional_apps(optional_apps, installed_apps):
20952090
# .. toggle_use_cases: temporary
20962091
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
20972092
# .. toggle_creation_date: 2024-11-10
2098-
# .. toggle_target_removal_date: 2025-06-01
2093+
# .. toggle_target_removal_date: 2026-04-10
20992094
USE_EXTRACTED_DISCUSSION_BLOCK = False
21002095

21012096
# .. toggle_name: USE_EXTRACTED_PROBLEM_BLOCK
@@ -2105,17 +2100,16 @@ def add_optional_apps(optional_apps, installed_apps):
21052100
# .. toggle_use_cases: temporary
21062101
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
21072102
# .. toggle_creation_date: 2024-11-10
2108-
# .. toggle_target_removal_date: 2025-06-01
2103+
# .. toggle_target_removal_date: 2026-04-10
21092104
USE_EXTRACTED_PROBLEM_BLOCK = False
21102105

21112106
# .. toggle_name: USE_EXTRACTED_VIDEO_BLOCK
2112-
# .. toggle_default: False
2107+
# .. toggle_default: True
21132108
# .. toggle_implementation: DjangoSetting
21142109
# .. toggle_description: Enables the use of the extracted Video XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo.
21152110
# .. toggle_use_cases: temporary
2116-
# .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done.
21172111
# .. toggle_creation_date: 2024-11-10
2118-
# .. toggle_target_removal_date: 2025-06-01
2112+
# .. toggle_target_removal_date: 2026-04-10
21192113
USE_EXTRACTED_VIDEO_BLOCK = True
21202114

21212115
############################## Marketing Site ##############################

xmodule/annotatable_block.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import logging
44
import textwrap
5+
import warnings
56

67
from django.conf import settings
78
from lxml import etree
@@ -40,6 +41,10 @@ class _BuiltInAnnotatableBlock(
4041
):
4142
"""
4243
Annotatable XBlock.
44+
45+
.. deprecated:: 2026-03
46+
This built-in annotatable block is deprecated. Please use the extracted ``AnnotatableBlock``
47+
from ``xblocks_contrib.annotatable`` instead.
4348
"""
4449

4550
is_extracted = False
@@ -216,3 +221,14 @@ def reset_class():
216221

217222
reset_class()
218223
AnnotatableBlock.__name__ = "AnnotatableBlock"
224+
225+
if not settings.USE_EXTRACTED_ANNOTATABLE_BLOCK:
226+
warnings.warn(
227+
"The built-in `xmodule.annotatable_block` AnnotatableBlock implementation is deprecated. "
228+
"To fix this warning, enable `USE_EXTRACTED_ANNOTATABLE_BLOCK` (set it to True) to use "
229+
"`xblocks_contrib.annotatable.AnnotatableBlock` instead. "
230+
"Support for the built-in implementation, and the `USE_EXTRACTED_ANNOTATABLE_BLOCK` setting, "
231+
"will be removed in Willow.",
232+
DeprecationWarning,
233+
stacklevel=2,
234+
)

xmodule/html_block.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import re
77
import sys
88
import textwrap
9+
import warnings
910
from datetime import datetime
1011

1112
from django.conf import settings
@@ -51,6 +52,10 @@ class _BuiltinHtmlBlockMixin( # lint-amnesty, pylint: disable=abstract-method
5152
"""
5253
The HTML XBlock mixin.
5354
This provides the base class for all Html-ish blocks (including the HTML XBlock).
55+
56+
.. deprecated:: 2026-03
57+
This built-in HTML block mixin is deprecated. Please use the extracted ``HtmlBlockMixin``
58+
from ``xblocks_contrib.html`` instead.
5459
"""
5560

5661
display_name = String(
@@ -375,6 +380,10 @@ class _BuiltInHtmlBlock(_BuiltinHtmlBlockMixin): # lint-amnesty, pylint: disabl
375380
"""
376381
This is the actual HTML XBlock.
377382
Nothing extra is required; this is just a wrapper to include edxnotes support.
383+
384+
.. deprecated:: 2026-03
385+
This built-in HTML block is deprecated. Please use the extracted ``HtmlBlock``
386+
from ``xblocks_contrib.html`` instead.
378387
"""
379388
is_extracted = False
380389

@@ -542,3 +551,14 @@ def reset_class():
542551

543552
reset_class()
544553
HtmlBlock.__name__ = "HtmlBlock"
554+
555+
if not settings.USE_EXTRACTED_HTML_BLOCK:
556+
warnings.warn(
557+
"The built-in `xmodule.html_block` HtmlBlock implementation is deprecated. "
558+
"To fix this warning, enable `USE_EXTRACTED_HTML_BLOCK` (set it to True) to use "
559+
"`xblocks_contrib.html.HtmlBlock` instead. "
560+
"Support for the built-in implementation, and the `USE_EXTRACTED_HTML_BLOCK` setting, "
561+
"will be removed in Willow.",
562+
DeprecationWarning,
563+
stacklevel=2,
564+
)

xmodule/lti_block.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import hashlib
6060
import logging
6161
import textwrap
62+
import warnings
6263
from unittest import mock
6364
from urllib import parse
6465
from xml.sax.saxutils import escape
@@ -290,6 +291,10 @@ class _BuiltInLTIBlock(
290291
291292
Module provides LTI integration to course.
292293
294+
.. deprecated:: 2026-03
295+
This built-in LTI block is deprecated. Please use the extracted ``LTIBlock``
296+
from ``xblocks_contrib.lti`` instead.
297+
293298
Except usual Xmodule structure it proceeds with OAuth signing.
294299
How it works::
295300
@@ -1006,3 +1011,14 @@ def reset_class():
10061011

10071012
reset_class()
10081013
LTIBlock.__name__ = "LTIBlock"
1014+
1015+
if not settings.USE_EXTRACTED_LTI_BLOCK:
1016+
warnings.warn(
1017+
"The built-in `xmodule.lti_block` LTIBlock implementation is deprecated. "
1018+
"To fix this warning, enable `USE_EXTRACTED_LTI_BLOCK` (set it to True) to use "
1019+
"`xblocks_contrib.lti.LTIBlock` instead. "
1020+
"Support for the built-in implementation, and the `USE_EXTRACTED_LTI_BLOCK` setting, "
1021+
"will be removed in Willow.",
1022+
DeprecationWarning,
1023+
stacklevel=2,
1024+
)

xmodule/poll_block.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import html
1010
import json
1111
import logging
12+
import warnings
1213
from copy import deepcopy
1314

1415
from collections import OrderedDict
@@ -43,7 +44,13 @@ class _BuiltInPollBlock(
4344
ResourceTemplates,
4445
XModuleMixin,
4546
): # pylint: disable=abstract-method
46-
"""Poll Block"""
47+
"""
48+
Poll Block.
49+
50+
.. deprecated:: 2026-03
51+
This built-in poll block is deprecated. Please use the extracted ``PollBlock``
52+
from ``xblocks_contrib.poll`` instead.
53+
"""
4754

4855
is_extracted = False
4956

@@ -263,3 +270,14 @@ def reset_class():
263270

264271
reset_class()
265272
PollBlock.__name__ = "PollBlock"
273+
274+
if not settings.USE_EXTRACTED_POLL_QUESTION_BLOCK:
275+
warnings.warn(
276+
"The built-in `xmodule.poll_block` PollBlock implementation is deprecated. "
277+
"To fix this warning, enable `USE_EXTRACTED_POLL_QUESTION_BLOCK` (set it to True) to use "
278+
"`xblocks_contrib.poll.PollBlock` instead. "
279+
"Support for the built-in implementation, and the `USE_EXTRACTED_POLL_QUESTION_BLOCK` setting, "
280+
"will be removed in Willow.",
281+
DeprecationWarning,
282+
stacklevel=2,
283+
)

xmodule/video_block/video_block.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import copy
1717
import json
1818
import logging
19+
import warnings
1920
from collections import OrderedDict, defaultdict
2021
from operator import itemgetter
2122

@@ -121,6 +122,10 @@ class _BuiltInVideoBlock(
121122
<source src=".../mit-3091x/M-3091X-FA12-L21-3_100.webm"/>
122123
<source src=".../mit-3091x/M-3091X-FA12-L21-3_100.ogv"/>
123124
</video>
125+
126+
.. deprecated:: 2026-03
127+
This built-in video block is deprecated. Please use the extracted ``VideoBlock``
128+
from ``xblocks_contrib.video`` instead.
124129
"""
125130
is_extracted = False
126131
has_custom_completion = True
@@ -1196,3 +1201,14 @@ def _poster(self):
11961201
else _BuiltInVideoBlock
11971202
)
11981203
VideoBlock.__name__ = "VideoBlock"
1204+
1205+
if not settings.USE_EXTRACTED_VIDEO_BLOCK:
1206+
warnings.warn(
1207+
"The built-in `xmodule.video_block` VideoBlock implementation is deprecated. "
1208+
"To fix this warning, enable `USE_EXTRACTED_VIDEO_BLOCK` (set it to True) to use "
1209+
"`xblocks_contrib.video.VideoBlock` instead. "
1210+
"Support for the built-in implementation, and the `USE_EXTRACTED_VIDEO_BLOCK` setting, "
1211+
"will be removed in Willow.",
1212+
DeprecationWarning,
1213+
stacklevel=2,
1214+
)

xmodule/word_cloud_block.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import json
1212
import logging
13+
import warnings
1314

1415
from django.conf import settings
1516
from web_fragments.fragment import Fragment
@@ -55,6 +56,10 @@ class _BuiltInWordCloudBlock( # pylint: disable=abstract-method
5556
):
5657
"""
5758
Word Cloud XBlock.
59+
60+
.. deprecated:: 2026-03
61+
This built-in word cloud block is deprecated. Please use the extracted ``WordCloudBlock``
62+
from ``xblocks_contrib.word_cloud`` instead.
5863
"""
5964

6065
is_extracted = False
@@ -330,3 +335,14 @@ def reset_class():
330335

331336
reset_class()
332337
WordCloudBlock.__name__ = "WordCloudBlock"
338+
339+
if not settings.USE_EXTRACTED_WORD_CLOUD_BLOCK:
340+
warnings.warn(
341+
"The built-in `xmodule.word_cloud_block` WordCloudBlock implementation is deprecated. "
342+
"To fix this warning, enable `USE_EXTRACTED_WORD_CLOUD_BLOCK` (set it to True) to use "
343+
"`xblocks_contrib.word_cloud.WordCloudBlock` instead. "
344+
"Support for the built-in implementation, and the `USE_EXTRACTED_WORD_CLOUD_BLOCK` setting, "
345+
"will be removed in Willow.",
346+
DeprecationWarning,
347+
stacklevel=2,
348+
)

0 commit comments

Comments
 (0)