openedx / openedx/openedx-core
Consider refactoring/removing the Container REMOVE API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10
- Forks
- 32
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 12
Description
The API for using create_next_container_version with ChildrenEntitiesAction.REMOVE to remove entities from a container is not great. It essentially removes entities "by value", which means that if there are two identical units in a subsection, removing one will unexpectedly remove both. It needs all lot of tests cases to handle the various combinations of duplicate entries, and pinned vs. unpinned, and we don't even use "pinning" in Open edX yet.
A "remove at index N" API would be much better, although we don't technically need it as the "REPLACE all children with this new list" API (default behavior of create_next_container_version) can do that pretty easily.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate create_next_container_version and ChildrenEntitiesAction.REMOVE in the Python API and its tests. Read the existing coverage for duplicate, pinned, and unpinned entities, then evaluate whether the REMOVE API should be refactored or removed in favor of replacing the full child list. Done means the API direction is decided and the relevant behavior and tests reflect it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100