openedx / openedx/openedx-core
Emit comprehensive events for tagging/taxonomy changes
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:
-
When a taxonomy is created, a
TAXONOMY_CHANGEDevent is emitted. -
When a taxonomy is created via import, a
TAXONOMY_CHANGEDevent is emitted. The
event specifies that its tags have changed, but doesn't need to include the full
list of tags. -
When a taxonomy is renamed, a
TAXONOMY_CHANGEDevent is emitted,
andCONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted (asynchronously) for
every object tagged using that taxonomy's tags. -
When a taxonomy's export_id is changed, the cached ObjectTag._export_id value is
updated for all associated ObjectTags, aTAXONOMY_CHANGEDevent is emitted, and
CONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted (asynchronously) for
every object tagged using that taxonomy's tags. -
When a taxonomy's description is changed, a
TAXONOMY_CHANGEDevent is emitted. -
When a taxonomy is deleted, a
TAXONOMY_CHANGEDevent is emitted, specifying that
the taxonomy has been deleted and that its tags have changed. A
CONTENT_OBJECT_ASSOCIATIONS_CHANGEDevent is emitted (asynchronously) for every
object that had been tagged using that taxonomy. -
When a taxonomy is enabled/disabled, a
TAXONOMY_CHANGEDevent is emitted,
specifying that the taxonomy has been enabled/disabled and that its tags have
changed. ACONTENT_OBJECT_ASSOCIATIONS_CHANGEDevent is emitted
(asynchronously) for every object that had been tagged using that taxonomy. -
When a tag is renamed, the cached ObjectTag.value is updated for all associated
ObjectTags, aTAXONOMY_CHANGEDevent is emitted (specifying that tags have
changed), andCONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted
(asynchronously) for every object tagged using that particular tag or any of its
children. -
When a tag is re-parented (moved), the cached ObjectTag.value is updated for all
associated ObjectTags, aTAXONOMY_CHANGEDevent is emitted (specifying that tags
have changed), andCONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted
(asynchronously) for every object tagged using that particular tag or any of its
children. -
When a tag is created, a
TAXONOMY_CHANGEDevent is emitted. The
event specifies that its tags have changed. -
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_CHANGEDevents are emitted (asynchronously) for
every object tagged using that particular tag. PR 571 -
When a taxonomy is updated (via re-import) a single
TAXONOMY_CHANGEDevent is
emitted (specifying that tags have changed), and
CONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted (asynchronously) for
every object tagged using tags that were moved/renamed/deleted. -
When
copy_tags()is used to copy tags from one object to another,
CONTENT_OBJECT_ASSOCIATIONS_CHANGEDevents are emitted (asynchonrously) for the
destination object. -
When tags (
ObjectTag) are added/removed to an object (like a Component or a Container), aCONTENT_OBJECT_ASSOCIATIONS_CHANGEDevent 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
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
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