Skip to content

Improve pointer tag OLX parsing architecture for extracted XBlocks #477

@ttqureshi

Description

@ttqureshi

Rationale

To improve the pointer tag implementation of the extracted XBlocks.

Summary

As part of the ongoing effort to extract core (built-in) XBlocks from edx-platform into the xblocks-contrib repository, we encountered an incompatibility related to the pointer tag OLX format during course import and export.

This issue stems from differences in how XML parsing is implemented between the XBlock base class and the XmlMixin class in the edx-platform. Specifically, pointer tags are handled by XmlMixin, whereas XBlock itself does not natively support this behavior. When core XBlocks are extracted and no longer rely on edx-platform’s XML parsing logic, pointer tags fail to be parsed/resolved correctly.

Explored Approaches

We attempted to address this issue by:

  1. Adding pointer-tag parsing logic directly to the parse_xml method of the XBlock class. PR
  2. Implementing pointer loading in edx-platform runtime (parent containers). PR, (revert PR)

Decision

Instead of proceeding with either approach, we agreed on a temporary compatibility solution:
retain edx-platform’s XmlMixin in xblocks-contrib as LegacyXmlMixin, and have the extracted core XBlocks inherit from it. This allows pointer tags to continue working correctly during import/export while unblocking the XBlocks extraction work. (decision)

Direction

We aim to come up with an architecturally better way of addressing this issue. Detailed analysis of the problem, attempted solutions, and alternative approaches for the future are documented in this ADR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions