Skip to content

feat: add enterprise group deletion event #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jesperhodge
Copy link
Member

@jesperhodge jesperhodge commented Jun 5, 2025

Testing Instructions

  • Have event bus running locally. Not set up? Easiest to have me screen share.
  • If you have the event bus up, pip install -e this into a repo where it can be used and where event bus is configured correctly, and then run this: (if the repo is lms, change command to run python2 manage.py lms produce_event ... instead)
  • python3 manage.py produce_event --signal openedx_events.enterprise.signals.ENTERPRISE_GROUP_DELETED \ --topic enterprise-core --key-field enterprise_group.uuid \ --data '{"enterprise_group": { "uuid": "d509a63b-eb11-4dc8-8b84-4688c7335110" }}'
  • Verify that message in event bus is created.

Description

If a budget Group is manually deleted (e.g. through django admin), but the PolicyGroupAssociation is not, we end up in a weird state where the budget is looking for a group that doesn’t exist anymore. We should automatically trigger a delete of any PolicyGroupAssociations with the same group ID whenever a budget Group is deleted.

The plan is to

  • Utilize openedx-events with kafka to send an async event from edx-enterprise to our event broker
  • Create a consumer on enterprise-access consume this event and delete the corresponding PolicyGroupAssociation

Internal 2U ticket: https://2u-internal.atlassian.net/browse/ENT-10440
Edx-enterprise Producer PR: openedx/edx-enterprise#2413

Checklists

Check off if complete or not applicable:

Merge Checklist:

  • All reviewers approved
  • Reviewer tested the code following the testing instructions
  • CI build is green
  • Version bumped
  • Changelog record added with short description of the change and current date
  • Documentation updated (not only docstrings)
  • Integration with other services reviewed
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Post Merge:

  • Create a tag
  • Create a release on GitHub
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)
  • Upgrade the package in the Open edX platform requirements (if applicable)

@jesperhodge jesperhodge requested a review from a team as a code owner June 5, 2025 15:19
@mariajgrimaldi
Copy link
Member

Hi there! Is this ready for review? Let me know. Thanks!

@jesperhodge
Copy link
Member Author

Hi @mariajgrimaldi ! Thanks for the patience, I was out of office a lot the last weeks. The PR is ready for review, let me know if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants