Skip to content
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

feat: new enterprise transaction data/signals #347

Merged

Conversation

iloveagent57
Copy link
Contributor

@iloveagent57 iloveagent57 commented May 14, 2024

  • Added new enterprise signals LEDGER_TRANSACTION_CREATED, LEDGER_TRANSACTION_COMMITTED, LEDGER_TRANSACTION_FAILED, and LEDGER_TRANSACTION_REVERSED.
  • Added a UuidAvroSerializer to serialize uuid fields.
  • Added isort make target.

Context

The best doc to start with is probably this: https://github.com/openedx/enterprise-access/blob/main/docs/decisions/0004-add-access-policy-functionality.rst#context

A Ledger is a model defined in the openedx-ledger repo, it's a core model used in the context of edX Enterprise. https://github.com/openedx/openedx-ledger/blob/main/docs/decisions/0002-ledger-balance-enforcement.rst

It's installed only into enterprise-subsidy AFAIK: https://github.com/openedx/enterprise-subsidy/tree/main/docs/decisions

I don't believe ledgers (or enterprise-subsidy,access) to be used widely by the community - my guess is that 2u is the only entity currently using it.
These new events will be used to relay state transitions from enterprise-subsidy back to enterprise-access so that a related record, LearnerContentAssignment, can update its state based on the new state of its related transaction.
https://github.com/openedx/enterprise-access/blob/main/docs/decisions/0012-assignment-based-policies.rst
https://github.com/openedx/enterprise-access/blob/430d768ee4c6355b353e22f5b0f7902d169850bc/enterprise_access/apps/content_assignments/models.py#L234

Reviewers:

  • tag reviewer
  • tag reviewer

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.

@iloveagent57 iloveagent57 requested a review from a team as a code owner May 14, 2024 19:18
@iloveagent57 iloveagent57 marked this pull request as draft May 14, 2024 19:19
@iloveagent57
Copy link
Contributor Author

Sorry, meant to open as a draft. Still not ready for review.

@iloveagent57 iloveagent57 force-pushed the aed/subsidy-transaction-events branch 6 times, most recently from b144b20 to 283e1f3 Compare May 15, 2024 13:33
@iloveagent57 iloveagent57 marked this pull request as ready for review May 15, 2024 13:34
@iloveagent57
Copy link
Contributor Author

@openedx/hooks-extension-framework this PR is now ready for review, thanks in advance!

Copy link

@macdiesel macdiesel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool. I assume there are some changes that will need to go in to the current consumers/produces as well for this release due to the deprecated field?

@iloveagent57
Copy link
Contributor Author

There are some unmerged PRs that use those deprecated fields. My plan is to write new PRs to use these new signals and close the unmerged PRs.
openedx/enterprise-subsidy#227
openedx/enterprise-access#434

@mariajgrimaldi
Copy link
Member

I don't have much time to get this done this week, so I'll take a look early next week. Thank you!

@iloveagent57 iloveagent57 force-pushed the aed/subsidy-transaction-events branch 3 times, most recently from ac2dc83 to 67d7bc3 Compare May 20, 2024 20:01
@iloveagent57
Copy link
Contributor Author

@mariajgrimaldi gentle reminder about this open PR.

@mariajgrimaldi
Copy link
Member

@iloveagent57, thanks for the patience! Reviewing now.

openedx_events/enterprise/signals.py Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
openedx_events/enterprise/signals.py Show resolved Hide resolved
openedx_events/enterprise/signals.py Outdated Show resolved Hide resolved
openedx_events/enterprise/data.py Show resolved Hide resolved
@iloveagent57 iloveagent57 force-pushed the aed/subsidy-transaction-events branch 2 times, most recently from a22af15 to e93cb2b Compare June 7, 2024 14:02
@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Jun 12, 2024

I appreciate your patience! I have one last comment for you to address, then we can merge. Please feel free to ping me (on here or on slack) once this is ready to be reviewed again.

@iloveagent57 iloveagent57 force-pushed the aed/subsidy-transaction-events branch 2 times, most recently from a7a582f to 13fd321 Compare June 18, 2024 19:26
@iloveagent57 iloveagent57 force-pushed the aed/subsidy-transaction-events branch from 13fd321 to 20a45f9 Compare June 18, 2024 19:26
* Added new enterprise signals `LEDGER_TRANSACTION_CREATED`, `LEDGER_TRANSACTION_COMMITTED`,
  `LEDGER_TRANSACTION_FAILED`, and `LEDGER_TRANSACTION_REVERSED`.
* Added a `UuidAvroSerializer` to serialize uuid fields.
* Added `isort` make target.
Copy link
Member

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing all of my comments. This looks great!

@mariajgrimaldi mariajgrimaldi merged commit c8fe32e into openedx:main Jun 20, 2024
11 checks passed
@mariajgrimaldi
Copy link
Member

The new tag is out: https://github.com/openedx/openedx-events/releases/tag/v9.11.0

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.

3 participants