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: replace signal handler with event producer config #14

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

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Jul 28, 2023

Description: Replace the hard-coded signal handler with event bus producer config. See openedx/openedx-events#249 and openedx/edx-platform#32874 for more details.

JIRA: Private-ref: BB-7666

Dependencies:

Merge deadline: List merge deadline (if any)

Testing instructions:

  • Setup master devstack
  • Run make lms-up to get lms up and running.
  • Create lms shell using make lms-shell.
  • Install this plugin by running pip install -e /edx/src/xblock-skill-tagging/ (assuming this repo is cloned in <devstack-base-dir>/src/)
  • Include EVENT_BUS_PRODUCER_CONFIG setting as per the configuration in README in lms/envs/private.py to push XBLOCK_SKILL_VERIFIED to event bus.
  • Run below snippet to send XBLOCK_SKILL_VERIFIED event.
from datetime import datetime, timezone
from openedx_events.learning.signals import XBLOCK_SKILL_VERIFIED
from openedx_events.learning.data import XBlockSkillVerificationData
XBLOCK_SKILL_VERIFIED.send_event(
    time=datetime.now(timezone.utc),
    xblock_info=XBlockSkillVerificationData(
        usage_key="block-v1:edx+DemoX+Demo_course+type@video+block@UaEBjyMjcLW65gaTXggB93WmvoxGAJa0JeHRrDThk",
        verified_skills=[1, 2],
        ignored_skills=[3, 4],
    )
)
  • It should print something like below:
2023-08-29 12:03:46,477 INFO 1502 [edx_event_bus_redis.internal.producer] [user None] [ip None] producer.py:82 - Message delivered to Redis event bus: topic=dev-learning-custom-xblock-skill-verfied, message_id=1b5934e4-4664-11ee-83e5-0242ac12000b, signal=<
OpenEdxPublicSignal: org.openedx.learning.xblock.skill.verified.v1>, redis_msg_id=b'1693310626477-0'
[(<function general_signal_handler at 0x7fcf6e0e2a60>, None)]
  • You can play with the topic name and other setting to see the changes.

Reviewers:

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.

requirements/base.txt Outdated Show resolved Hide resolved
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: Followed the testing instructions in platform PR and verified, signals are produced from the config without custom handlers.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Aug 3, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Aug 3, 2023

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.

@mphilbrick211
Copy link

Hi @navinkarkera! Would you mind resolving the branch conflicts that have popped up? Then I can get it reviewed. Thanks!

@navinkarkera navinkarkera force-pushed the navin/use-producer-config branch 3 times, most recently from 799a6de to 44721ca Compare August 29, 2023 13:08
@mphilbrick211
Copy link

Hi @sameenfatima78! Just following up on this :)

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
Copy link
Contributor Author

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

@sameenfatima78 Once openedx/openedx-events#272 is merged, I'll update this PR based on the decision in the ADR.

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
@mphilbrick211
Copy link

@navinkarkera now that #272 is merged, is this now ready-to-go?

@navinkarkera navinkarkera force-pushed the navin/use-producer-config branch from 44721ca to 0cee3b3 Compare December 8, 2023 13:28
@navinkarkera
Copy link
Contributor Author

navinkarkera commented Dec 8, 2023

@mphilbrick211 @sameenfatima78 Thanks for your patience. This is now ready to be merged.

Please wait, I'll also update the requirements.

Done. Now it is ready.

@mphilbrick211
Copy link

@navinkarkera - looks like there's still a failing test. Would you mind taking a look?

@navinkarkera navinkarkera force-pushed the navin/use-producer-config branch from c28e271 to 4f0048d Compare February 9, 2024 11:13
@navinkarkera
Copy link
Contributor Author

@mphilbrick211 @sameenfatima78 Sorry for the delay. Fixed the failing test and manually tested verification event in devstack.

@navinkarkera
Copy link
Contributor Author

@sameenfatima78 Gentle reminder.

@sameenfatima78
Copy link
Member

Tagging @irfanuddinahmad here for review.

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
Status: In Eng Review
Development

Successfully merging this pull request may close these issues.

5 participants