openedx / openedx/openedx-core

Emit comprehensive events for tagging/taxonomy changes

Open
#557 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

Some tagging-related events were introduced in https://github.com/openedx/openedx-core/pull/530 and https://github.com/openedx/openedx-core/pull/571 , but I think we need to make the events more comprehensive. Here is a proposed spec.

Proposed specification:

  1. When a taxonomy is created, a TAXONOMY_CHANGED event is emitted.

  2. When a taxonomy is created via import, a TAXONOMY_CHANGED event is emitted. The
    event specifies that its tags have changed, but doesn't need to include the full
    list of tags.

  3. When a taxonomy is renamed, a TAXONOMY_CHANGED event is emitted,
    and CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted (asynchronously) for
    every object tagged using that taxonomy's tags.

  4. When a taxonomy's export_id is changed, the cached ObjectTag._export_id value is
    updated for all associated ObjectTags, a TAXONOMY_CHANGED event is emitted, and
    CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted (asynchronously) for
    every object tagged using that taxonomy's tags.

  5. When a taxonomy's description is changed, a TAXONOMY_CHANGED event is emitted.

  6. When a taxonomy is deleted, a TAXONOMY_CHANGED event is emitted, specifying that
    the taxonomy has been deleted and that its tags have changed. A
    CONTENT_OBJECT_ASSOCIATIONS_CHANGED event is emitted (asynchronously) for every
    object that had been tagged using that taxonomy.

  7. When a taxonomy is enabled/disabled, a TAXONOMY_CHANGED event is emitted,
    specifying that the taxonomy has been enabled/disabled and that its tags have
    changed. A CONTENT_OBJECT_ASSOCIATIONS_CHANGED event is emitted
    (asynchronously) for every object that had been tagged using that taxonomy.

  8. When a tag is renamed, the cached ObjectTag.value is updated for all associated
    ObjectTags, a TAXONOMY_CHANGED event is emitted (specifying that tags have
    changed), and CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted
    (asynchronously) for every object tagged using that particular tag or any of its
    children.

  9. When a tag is re-parented (moved), the cached ObjectTag.value is updated for all
    associated ObjectTags, a TAXONOMY_CHANGED event is emitted (specifying that tags
    have changed), and CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted
    (asynchronously) for every object tagged using that particular tag or any of its
    children.

  10. When a tag is created, a TAXONOMY_CHANGED event is emitted. The
    event specifies that its tags have changed.

  11. When a tag is deleted, the associated ObjectTags are deleted, a TAXONOMY_CHANGED
    event is emitted (specifying that tags have changed), and
    CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted (asynchronously) for
    every object tagged using that particular tag. PR 571

  12. When a taxonomy is updated (via re-import) a single TAXONOMY_CHANGED event is
    emitted (specifying that tags have changed), and
    CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted (asynchronously) for
    every object tagged using tags that were moved/renamed/deleted.

  13. When copy_tags() is used to copy tags from one object to another,
    CONTENT_OBJECT_ASSOCIATIONS_CHANGED events are emitted (asynchonrously) for the
    destination object.

  14. When tags (ObjectTag) are added/removed to an object (like a Component or a Container), a CONTENT_OBJECT_ASSOCIATIONS_CHANGED event is emitted. (This is currently implemented in the platform but should be moved into openedx-core so it works regardless of which API is used.)

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

Start by reviewing the linked PRs 530 and 571, then inspect openedx-platform's content_tagging/api.py around lines 413-421 to understand the existing association events. Trace the corresponding taxonomy, tag, ObjectTag, import, and copy_tags entry points in openedx-core. Done means implementing and testing the fourteen specified event and cache-update cases, including asynchronous association events.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.