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: adds events to handle changes in xblocks #143

Merged
merged 1 commit into from
Jan 3, 2023

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Nov 8, 2022

Description: Adds events and data classes to allow consumers to react on xblock events like published, deleted and duplicated.
The idea is to fire these events in delete_item, publish_item and _duplicate_item and update skills related to the xblock in taxonomy-connector (part of course-discovery).

Answer for a question asked in previous similar MRs:

Do consumers have to make separate requests to get more information?
Generally: Additional data if required related to the event needs to be fetch separately as it can be different for different use case.
Specifically for skill tagging: Yes, for skill tagging to work we need concatenated text representation of children xblocks for units and transcript for video xblocks which can be extracted using index_dictionary of the xblock. The idea is to add a new api to fetch block metadata and use this API in taxonomy-connector.

Related MRs:
These MRs are the foundation for storing skills related on xblocks level, specifically for unit and video xblocks.

ISSUE: Link to GitHub issue

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.

@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 8, 2022
@mariajgrimaldi
Copy link
Member

Hello! Thanks for your contribution! I'll review this as soon as I can.

@mariajgrimaldi mariajgrimaldi self-assigned this Nov 10, 2022
Copy link

@tecoholic tecoholic left a comment

Choose a reason for hiding this comment

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

@navinkarkera Nice work covering all the necessary parts including the avro tests. I have noted one question about the data classes introduced here and some minor typos. Can you kindly address those?

openedx_events/content_authoring/data.py Outdated Show resolved Hide resolved
openedx_events/content_authoring/data.py Outdated Show resolved Hide resolved
openedx_events/content_authoring/data.py Outdated Show resolved Hide resolved
openedx_events/content_authoring/signals.py Outdated Show resolved Hide resolved
openedx_events/event_bus/avro/custom_serializers.py Outdated Show resolved Hide resolved
@tecoholic
Copy link

@navinkarkera One thing that kind of stood out from the PR description was this question:

Do consumers have to make separate requests to get more information?

The answer is specific to skill tagging which is great. It can also be more generally answered, as the event is only passing the UsageKey to the consumer, all other metadata will need to be fetched by the consumer separately. Eg., User deleting an XBlock, diff of the content during publishing..etc.,

This is just a note, to help myself understand the scope of the change here and aid other reviewers, if needed. No action item here :)

@navinkarkera
Copy link
Contributor Author

@tecoholic Thanks for the suggestions! Updated the MR.

The answer is specific to skill tagging which is great. It can also be more generally answered, as the event is only passing the UsageKey to the consumer, all other metadata will need to be fetched by the consumer separately. Eg., User deleting an XBlock, diff of the content during publishing..etc.,

Makes absolute sense. Thanks, i'll add this to the description.

@navinkarkera navinkarkera requested review from tecoholic and removed request for mariajgrimaldi November 11, 2022 12:40
@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Sorry, when I clicked on request-a-review-again button for @tecoholic, it removed you from reviewers list and I cannot add you back.

Hello! Thanks for your contribution! I'll review this as soon as I can.

Thank you!

Copy link

@tecoholic tecoholic left a comment

Choose a reason for hiding this comment

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

@navinkarkera 👍

  • I tested this: As this only introduces the data classes and the signals, there wasn't anything specific to test. The unit tests are passing, that validates the data classes.
  • I read through the code
  • I checked for accessibility issues - NA
  • Includes documentation - It contains inline documentation as expected.

openedx_events/content_authoring/data.py Outdated Show resolved Hide resolved
openedx_events/content_authoring/data.py Outdated Show resolved Hide resolved
@navinkarkera navinkarkera force-pushed the navin/skill-tagging-events branch 2 times, most recently from 7d15816 to 7fbda3e Compare November 18, 2022 06:44
@mariajgrimaldi
Copy link
Member

do you have a working example for testing? if so, can you add instructions to the PR description? thanks!

@navinkarkera
Copy link
Contributor Author

do you have a working example for testing? if so, can you add instructions to the PR description? thanks!

@mariajgrimaldi I don't have one yet as the work on the edx-platform side is pending. I do want to add one more signal and data class to send list of verified skill ids and xblock usage_key. The idea is that users will verify the tags/skills associated to an XBlock. We want to send this data via openedx-event signals to course-discovery and update the relevant tables. I was wondering whether I should add it in the same MR or create a separate MR once this is merged. Do let me know your thoughts here.

@mariajgrimaldi
Copy link
Member

@navinkarkera: it's best to create a separate PR for those changes.

@felipemontoya: what do you think of these changes? I'd like to test a working version, for now, this looks quite good!

@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Thanks! I have created a separate MR: open-craft#1 on top of this branch. The new event requires support for array types so it is also added in the MR. Please have a look.

@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Any updates on this? Let me know if something needs to be changed.

@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Gentle reminder.

@mariajgrimaldi
Copy link
Member

mariajgrimaldi commented Dec 15, 2022

@navinkarkera: I'm out until Dec 20, I'll check on this when I'm back. Sorry for the delay.

Unless @felipemontoya can pick this up. I dismissed my review so it's not a blocker.

@mariajgrimaldi mariajgrimaldi dismissed their stale review December 15, 2022 07:44

I'm out of office and can't continue the review

@mariajgrimaldi
Copy link
Member

can you rebase with main? thank you!

@navinkarkera
Copy link
Contributor Author

can you rebase with main? thank you!

@mariajgrimaldi It is already up to date.

@mariajgrimaldi
Copy link
Member

I thought rebasing would help with the coverage issue. Can you check that so we can merge? Let me know if you need help!

@navinkarkera
Copy link
Contributor Author

I thought rebasing would help with the coverage issue. Can you check that so we can merge? Let me know if you need help!

@mariajgrimaldi Running make coverage locally shows that the coverage increased from 95% to 96%. Also visiting the codecov link also shows an increase of 0.13% as opposed to what is displayed here in github below.

image

Not sure how to proceed here. Should we implement tests for missing lines even if they are not related to any change in this MR? Please advice.

@mphilbrick211
Copy link

@mariajgrimaldi Friendly ping on @navinkarkera's comment above.

@mariajgrimaldi
Copy link
Member

I'm back on monday. I'll take a look at this then. Sorry for the delay!

@mariajgrimaldi
Copy link
Member

hello! can you rebase with main? The codecov for the project changed, so I think it'll pass this time

@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Updated! Please approve the workflow.

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.

This looks great! Just one last thing, can you update the changelog entry date? thanks!

fix: documentation typo

fix: remove unwanted comments and rename XBlockData

docs: docstrings in tests for usage key serialization

refactor: rename XBlockDuplicatedData to DuplicatedXBlockData

chore: bump version and update changelog

chore: bump version and update changelog

fix: import order

chore: bump version

docs: generalize signal docs

docs: update xblock_published signal docs
@navinkarkera
Copy link
Contributor Author

@mariajgrimaldi Thanks! Updated.

@mariajgrimaldi mariajgrimaldi merged commit 75216de into openedx:main Jan 3, 2023
@openedx-webhooks
Copy link

@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@mariajgrimaldi
Copy link
Member

navinkarkera added a commit to open-craft/taxonomy-connector that referenced this pull request Jan 3, 2023
This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
navinkarkera added a commit to open-craft/taxonomy-connector that referenced this pull request Jan 3, 2023
This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
navinkarkera added a commit to open-craft/taxonomy-connector that referenced this pull request Jan 4, 2023
This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
navinkarkera added a commit to open-craft/taxonomy-connector that referenced this pull request Jan 6, 2023
This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
sameenfatima78 pushed a commit to openedx/taxonomy-connector that referenced this pull request Jan 6, 2023
This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
navinkarkera added a commit to open-craft/taxonomy-connector that referenced this pull request Jan 25, 2023
…enedx#138)

This commit combines changes implemented in following commits:
- cc1889b
- ec2a581

The changes were reverted as part of commit
a999401 as the upstream MR in
openedx-events: openedx/openedx-events#143 was
not merged. It is now merged and the dependencies are udpated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants