openedx / openedx/openedx-core

Prune unused content

Open
#154 1 comment 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 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 PublishableEntityVersion that has ever been published (appears in a PublishLogRecord)

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.