-
Notifications
You must be signed in to change notification settings - Fork 12
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: xblock deleted and duplicated event handlers #127
feat: xblock deleted and duplicated event handlers #127
Conversation
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:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera I have some design questions and suggested some changes. Kindly see the inline comments.
taxonomy/signals/signals.py
Outdated
@@ -8,3 +8,5 @@ | |||
UPDATE_COURSE_SKILLS = Signal() | |||
UPDATE_PROGRAM_SKILLS = Signal() | |||
UPDATE_XBLOCK_SKILLS = Signal() | |||
XBLOCK_DELETED = Signal() | |||
XBLOCK_DUPLICATED = Signal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure about these signals for the reason I mentioned in the course discovery PR and also because, these signals cannot be actually emitted by the taxonomy connector for other apps to listen.
What the taxonomy connector could possibly emit are DELETE_XBLOCK_SKILLS
, DUPLICATE_XBLOCK_SKILLS
at the start of the processing or XBLOCK_SKILLS_DELETED
, XBLOCK_SKILLS_DUPLICATED
at the end of the processing depending on the kind of signal that's emitted.
Again, it seems the only reason for these signals to be defined here, is to allow for them to be handled in handlers.py
. I would suggest we think if this is actually necessary. Wouldn't it be better to not define them at all and do the following in handlers.py?
from .signals import (
UPDATE_COURSE_SKILLS,
UPDATE_PROGRAM_SKILLS,
UPDATE_XBLOCK_SKILLS,
- XBLOCK_DELETED,
- XBLOCK_DUPLICATED,
)
+ from openedx_events.content_authoring.signals import XBLOCK_DELETED, XBLOCK_DUPLICATED, XBLOCK_PUBLISHED
I guess the answer again is in the question, why can't we add openedx-events as a dependency to the taxonomy-connector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tecoholic I don't have a strong reason to not include openedx-events as a dependency to taxonomy-connector. openedx-events
is already added as a dependency in course-discovery through event-bus-kafka so I did not include it here. This also keeps taxonomy-connector independent of openedx-events
if that matters at all. I think we can ask @sameenfatima78 for her advice here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this with @saleem-latif and while we both agree with using standardized signals as suggested by @tecoholic, we are still unsure about how taxonomy-connector
would listen these events if these signals are not being fired from course-discovery
? But other than that, installing this new dependency in taxonomy-connector
won't be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are still unsure about how taxonomy-connector would listen these events if these signals are not being fired from course-discovery
In the current design, they are fired from course-discovery
as implemented in openedx/course-discovery#3710. But if we directly include openedx-events
as dependency in taxonomy
, it is not required. The events fired in openedx/edx-platform#31350 can be directly handled here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tecoholic @sameenfatima78 Updated to include openedx-events
directly as dependency and handle xblock signals. Please review.
Please re-run the failed CI job, the test has nothing to do with this MR (it is using random values for primary keys which fails sometimes due to not being unique).
a65e300
to
a4a07f0
Compare
63824f3
to
67b4d64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navinkarkera 👍 I found one place where the docstring needs a correction. Other than that this looks great.
- I tested this: relying on the unit tests here as there aren't any testing instructions
- I read through the code
- I checked for accessibility issues - NA
- Includes documentation
PS: You have mentioned that the CI Error, I ran the unit tests locally and everything seems to pass. My guess is the Faker.rand_int
might have generated the same ID in the failing test.
596e3b2
to
ef1223c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some feedback, also the coverage seems to be failing.
ef1223c
to
72ba366
Compare
|
Implements handlers for openedx-events XBLOCK_PUBLISHED, XBLOCK_DELETED, and XBLOCK_DUPLICATED. chore: bump version and update changelog Update taxonomy/signals/handlers.py Co-authored-by: Arunmozhi <tecoholic@users.noreply.github.com>
72ba366
to
cc1889b
Compare
@sameenfatima78 Updated MR. Also implemented tests for missing lines but the check is still failing here. |
@navinkarkera Hmm, I remember there was a known issue where coverage only gets calculated for the first commit, the rest of the commits are ignored by CI. This seems to be the case here I guess. You can merge the PR for now and I'll file a ticket in our backlog to look into this issue. |
@sameenfatima78 I don't have appropriate rights to merge. 🚫 |
I'll merge it for you. Just wanted to confirm if all changes are finalized. |
@sameenfatima78 Confirmed. 👍 |
@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. |
@navinkarkera
|
@HammadAhmadWaqas Apologies for the confusion. I missed to update the dependency in base.in, instead updated dev.txt and test.txt directly to point to the version of openedx-events. This issue should be fixed by #129 as it updates init.py as well as the requirements properly. cc: @sameenfatima78 |
Description
Implement signals and handlers for xblock delete and duplicated events.
Related MRs:
Merge checklist:
requirements/*.txt
files)make upgrade && make requirements
have been run to regenerate requirements./manage.py makemigrations
has been runPost merge:
(so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
make upgrade
in course-discovery will look for the latest version in PyPi.