Skip to content

Mark the built-in blocks deprecated#38174

Open
farhan wants to merge 5 commits intomasterfrom
farhan/toggle-defaults
Open

Mark the built-in blocks deprecated#38174
farhan wants to merge 5 commits intomasterfrom
farhan/toggle-defaults

Conversation

@farhan
Copy link
Contributor

@farhan farhan commented Mar 16, 2026

  • Update enabled extracted block feature flag docs
  • Add deprecated warning to the enabled built-in blocks

@farhan farhan requested a review from kdmccormick March 16, 2026 12:02
@farhan farhan marked this pull request as ready for review March 16, 2026 12:02
Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for opening this!

Comment on lines +136 to +139
"_BuiltInVideoBlock is deprecated. Please use the extracted VideoBlock "
"from xblocks_contrib.video instead.",
DeprecationWarning,
stacklevel=2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be very noisy--we'd get a log entry every time the block was constructed, which could be multiple times per request. How about putting it at the top-level of the module, within if not settings.USE_EXTRACTED_VIDEO_BLOCK: ? That way it'll show once at startup.

I would also recommend mentioning the setting name and that it will be removed in Verawood. When an operator sees warnings in their logs, the questions they will have are "how can I fix this?" and "how long do I have to fix it?"

@farhan farhan moved this to 🏗 In progress in Aximprovements Team Mar 17, 2026
@farhan farhan changed the title Update extracted block feature flag docs Mark the built-in block deprecated Mar 17, 2026
@farhan farhan changed the title Mark the built-in block deprecated Mark the built-in blocks deprecated Mar 17, 2026
@farhan farhan requested a review from kdmccormick March 17, 2026 11:51
Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 💯

I tested the warnings with built-in LTI and extracted HTML:

In [1]: from xblock.core import XBlock ; XBlock.load_class("lti")
2026-03-17 14:36:48,443 WARNING 39 [py.warnings] [user None] [ip None] warnings.py:112 - /opt/pyenv/versions/3.12.12/lib/python3.12/importlib/__init__.py:90: DeprecationWarning: The built-in `xmodule.lti_block` LTIBlock implementation is deprecated. To fix this warning, enable `USE_EXTRACTED_LTI_BLOCK` (set it to True) to use `xblocks_contrib.lti.LTIBlock` instead. Support for the built-in implementation, and the `USE_EXTRACTED_LTI_BLOCK` setting, will be removed in Willow.
  return _bootstrap._gcd_import(name[level:], package, level)
Out[1]: xmodule.lti_block._BuiltInLTIBlock

In [2]: from xblock.core import XBlock ; XBlock.load_class("html")
Out[2]: xblocks_contrib.html.html.HtmlBlock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants