openedx / openedx/openedx-core

Consider refactoring/removing the Container REMOVE API

Open
#502 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.