openedx / openedx/openedx-core
Prune unused content
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10
- Forks
- 32
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 12
Description
The PublishLog and having LearningPackage-local Content entries makes it easier for us to do pruning in small cycles, like as a post-publish task.
Proposed Solution
Step 1: As a post-publish async task for any given PublishableEntity, delete all PublishableEntityVersions that are older than a certain period (1 week?), but preserve the following:
- The current Draft version
- Any
PublishableEntityVersionthat has ever been published (appears in aPublishLogRecord)
Rely on cascading deletion behavior to delete Component/ComponentVersion.
Step 2: After the deletions in Step 1, find any unreferenced Content entries and delete those.
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 the PublishableEntity, PublishableEntityVersion, PublishLogRecord, Component, and Content models and their deletion behavior. Trace how post-publish tasks are defined, then verify that pruning preserves the current Draft and historically published versions, cascades component deletion, and removes only unreferenced Content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100