Skip to content

feat: Explicit mapping from container_types to OLX tags - #36580

Merged
kdmccormick merged 2 commits into
openedx:masterfrom
kdmccormick:kdmccormick/container-type-map
Apr 23, 2025
Merged

feat: Explicit mapping from container_types to OLX tags#36580
kdmccormick merged 2 commits into
openedx:masterfrom
kdmccormick:kdmccormick/container-type-map

Conversation

@kdmccormick

@kdmccormick kdmccormick commented Apr 22, 2025

Copy link
Copy Markdown
Member

This is needed by several aspects of the Teak Libraries Overhaul (Libraries Overhaul) including:

  • copy-paste of containers between courses and V2 libraries
  • syncing of containers in courses from V2 libraries
  • the import_from_modulestore API

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Self-review


These tag names are historical. We keep them around for the backwards compatibility of OLX
and for easier interation with modulestore-powered content (e.g., copy-paste between content
libraries and courses.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
libraries and courses.
libraries and courses).

Section = "section"

@property
def olx_tag(self) -> str:

@kdmccormick kdmccormick Apr 22, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm torn between calling this block_type vs olx_tag. On one hand, we generally don't want to think of Containers as pseudo-XBlocks, so I'm trying to frame this all as an OLX thing. On the other hand, container_sync will need to understand that Unit maps to the block_type vertical.

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, just one request.

raise TypeError(f"unexpected ContainerType: {self!r}")

@property
def source_olx_tags(self) -> set[str]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I get the need for this, but I'd prefer that this be a private method; I don't want the public API to involve multiple tags per container as it's confusing. i.e. lets focus on .olx_tag and .from_source_olx_tag() as the public API, and this is an implementation detail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call. Updated, ready for re-review @bradenmacdonald .

@kdmccormick kdmccormick changed the title feat: Explicit mapping from container_types to block_types feat: Explicit mapping from container_types to OLX tags Apr 22, 2025
@kdmccormick
kdmccormick force-pushed the kdmccormick/container-type-map branch from a4eb18f to 19fce2c Compare April 22, 2025 23:43
@kdmccormick
kdmccormick force-pushed the kdmccormick/container-type-map branch from 19fce2c to e48bdee Compare April 22, 2025 23:45

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't test this but the code LGTM.

@kdmccormick
kdmccormick enabled auto-merge (squash) April 22, 2025 23:56
@kdmccormick
kdmccormick disabled auto-merge April 22, 2025 23:57
@kdmccormick
kdmccormick enabled auto-merge (squash) April 22, 2025 23:57
@kdmccormick
kdmccormick merged commit 9d45f85 into openedx:master Apr 23, 2025
@kdmccormick
kdmccormick deleted the kdmccormick/container-type-map branch April 23, 2025 00:13
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

tonybusa pushed a commit to tonybusa/edx-platform that referenced this pull request Apr 23, 2025
This is needed by several aspects of the Teak Libraries Overhaul
(https://github.com/orgs/openedx/projects/66) including:
* copy-paste of containers between courses and V2 libraries
* syncing of containers in courses from V2 libraries
* the import_from_modulestore API
UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
This is needed by several aspects of the Teak Libraries Overhaul
(https://github.com/orgs/openedx/projects/66) including:
* copy-paste of containers between courses and V2 libraries
* syncing of containers in courses from V2 libraries
* the import_from_modulestore API
marlonkeating pushed a commit that referenced this pull request Jul 15, 2025
This is needed by several aspects of the Teak Libraries Overhaul
(https://github.com/orgs/openedx/projects/66) including:
* copy-paste of containers between courses and V2 libraries
* syncing of containers in courses from V2 libraries
* the import_from_modulestore API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants