-
Notifications
You must be signed in to change notification settings - Fork 21
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: preliminary signal definition #18
Conversation
90893b4
to
df5d105
Compare
f6f2800
to
c0387c2
Compare
a42d710
to
c065b58
Compare
6b4a1cd
to
ca605d7
Compare
c065b58
to
68225f4
Compare
# is completed. | ||
# ..event_data: UserData | ||
# ..event_creation_date: 2020-22-07 | ||
STUDENT_REGISTRATION_COMPLETED = OpenEdxPublicSignal( |
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.
Hey @robrap! I hope you're doing great!
You mentioned inline code annotations here. And we followed your suggestion in this PR (is the same one as in the comment, but I deleted #9 by accident)
This is our take on it. We also thought about taking this to the edx code-annotations repo. What do you think?
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.
Hello @mariajgrimaldi. Great start. Thanks. Some quick initial thoughts:
- See this how-to on code annotations and more: https://code-annotations.readthedocs.io/en/latest/contrib/how_to/add_new_annotations_and_extracted_docs.html
- I'd err on dropping annotations that aren't high value. Others may be in a better position to help make these decisions, but some food for thought:
a.event_version
: if this is built into the type, do you need the redundant data that could get out of sync?
b.event_implementation
: How many are there? If just one, do we need this yet? Or, do we want to detail what the implementation types would be? (Note: for toggles, it is a statically defined list.) Defining the annotation configuration file in a separate PR might help hammer out that discussion. If we need to keep this annotation, I'd recommendOpenEdxPublicSignal
(orDjangoSignal
), but probably not both. Ultimately, there will be a how-to for writing these annotations that will explain more details.
c.event_creation_date
: We had this for toggles (not settings) to help with deprecation/removal of temporary toggles? Do you see a similar important need to have the date for this, or can this be dropped?
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.
Hello @robrap, thanks for your quick response.
2a. You're right. I removed it! Thanks.
2b. For now, it's just one, so I'll follow your suggestion. We can review this later if necessary.
2c. I thought it could be useful for events versioning -eg. when moving from v1 to v2-. Don't you think?
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.
Thanks for the updates.
For 2c, I do not know yet. I am unclear on how versioning will evolve and how this metadata will be used. For now, since I think it is 100% redundant with the suffix of the event_type
, and you'd probably need linting to ensure that the redundant data matches, I think it could be left off for now. I imagine the Sphinx plugin (if you go that route) could also pull the version off the event_type
if you want it to be reported separately.
Also, feel free to let me know if there are known cases where these will not match.
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.
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.
@robrap, we are picking this up after our summer break, but we are thinking now with @mariajgrimaldi that this discussion requires its own PR since the the feedback about the definition itself seems to be taken in and it is resolved.
We would like to merge this very soon and focus on the PR that brings this into the platform. At the same time we will open a new PR about the status field in the inline documentation
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.
@felipemontoya: I'm not clear on your proposal for handling this PR. I'd recommend that you land the docs as written, since it helps document the events, and then iterate and improve if you want to update/solidify the annotations in a separate PR (or PRs). Is that what you are thinking?
@mariajgrimaldi: .. event_status
seems reasonable, assuming the ADR is accepted. I imagine that "removed" and "replaced" wouldn't be needed in the code annotations definitions, because these events and their docs simply wouldn't exist any more? This question doesn't need to be resolved on this PR.
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.
Great. Looks like we are leaving in these initial docs. Thanks!
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.
Hey @robrap. Yeah, the plan is to leave the docs as they were after your first round of reviews and manage only the lines with "event_status" and the ADR acceptance in the new PR.
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.
Hey @robrap! Thanks again for the review. As @felipemontoya said, we decided to move on with this initial proposal and review event_status in the new PR (here it is by the way) as we thought it could use more discussion.
Again, thank you for the help with the docs!
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.
Thanks for getting the docs started!
# is completed. | ||
# ..event_data: UserData | ||
# ..event_creation_date: 2020-22-07 | ||
STUDENT_REGISTRATION_COMPLETED = OpenEdxPublicSignal( |
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.
Hello @mariajgrimaldi. Great start. Thanks. Some quick initial thoughts:
- See this how-to on code annotations and more: https://code-annotations.readthedocs.io/en/latest/contrib/how_to/add_new_annotations_and_extracted_docs.html
- I'd err on dropping annotations that aren't high value. Others may be in a better position to help make these decisions, but some food for thought:
a.event_version
: if this is built into the type, do you need the redundant data that could get out of sync?
b.event_implementation
: How many are there? If just one, do we need this yet? Or, do we want to detail what the implementation types would be? (Note: for toggles, it is a statically defined list.) Defining the annotation configuration file in a separate PR might help hammer out that discussion. If we need to keep this annotation, I'd recommendOpenEdxPublicSignal
(orDjangoSignal
), but probably not both. Ultimately, there will be a how-to for writing these annotations that will explain more details.
c.event_creation_date
: We had this for toggles (not settings) to help with deprecation/removal of temporary toggles? Do you see a similar important need to have the date for this, or can this be dropped?
openedx_events/learning/signals.py
Outdated
from openedx_events.learning.data import CertificateData, CohortData, CourseEnrollmentData, UserData | ||
from openedx_events.tooling import OpenEdxPublicSignal | ||
|
||
# ..event_type: org.openedx.learning.student.registration.completed.v1 |
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.
Missing spaces between ..
and annotation names.
openedx_events/learning/signals.py
Outdated
# ..event_description: emitted when the user registration process in the LMS | ||
# is completed. |
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.
Since we allow for 120 chars, my preference would be to make this more readable by not wrapping unless we get into long descriptions.
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'll update the repo tox configurations, so we also support 120 chars
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.
Hey! I was about to change max-doc-length = 79
for max-doc-length = 120
but then I found this: https://edx.readthedocs.io/projects/edx-developer-guide/en/latest/style_guides/python-guidelines.html#syntax-and-organization
Do you think it is worth it?
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'll leave it to you if you don't want to make that change, but note that they mention keeping it to 79 to make it more readable, and in this case, I think it makes it less readable.
If you end up keeping the wrapping, please add additional spaces to the wrapped line. For example:
# .. event_description: emitted when the user registration process in the LMS
# is completed.
Thank you.
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.
Hello @robrap, we moved forward with your recommendation! Thank you so much. Also, we started working on the steps described here: https://code-annotations.readthedocs.io/en/latest/contrib/how_to/add_new_annotations_and_extracted_docs.html
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.
Great. Thank you. I hope you find it useful. One warning, that maybe we should add to the doc, is that we don't yet have a solution for pulling these annotations from dependencies. I'm not sure when and if this would apply to these annotations in particular, but something to keep in mind. It is a future enhancement that could be added later.
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.
Thanks for the heads up 👍 we'll look into it!
10a9ced
to
d7a0b3a
Compare
ca605d7
to
d3dcca8
Compare
d7a0b3a
to
7fa3c47
Compare
d3dcca8
to
5a9cf69
Compare
7fa3c47
to
a0c9571
Compare
871f98c
to
8707785
Compare
c1d9e63
to
c2cf184
Compare
0daedf3
to
ed2c6c0
Compare
c2cf184
to
7a1e31a
Compare
ed2c6c0
to
1a193c2
Compare
7a1e31a
to
0e301f6
Compare
1a193c2
to
e1de0c2
Compare
0e301f6
to
0078205
Compare
This PR was opened because #9 was a PR to an intermediate branch. Please refer to that PR for more discussion. |
e1de0c2
to
5c1fbca
Compare
0078205
to
85d5b55
Compare
5c1fbca
to
3f54c48
Compare
0946ee2
to
cffd321
Compare
3f54c48
to
1f6585a
Compare
cffd321
to
514d2f2
Compare
514d2f2
to
b512e12
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.
On the definion of the signals front, I think we are done and ready to merge.
Great work @mariajgrimaldi.
The event_status field definition will be dealt with in a different PR so as to not block the progress of the first examples of usage.
9e3173f
to
0d28ec1
Compare
0d28ec1
to
2fba7ae
Compare
Description:
This PR adds the first 8 definitions of the Open edX events, they will be used in the Open edX platform.
JIRA: Link to JIRA ticket
Dependencies:
Depends on #8 (merged)
Testing instructions:
With the event
STUDENT_REGISTRATION_COMPLETED
:In your Open edX devstack
make lms-shell
pip install git+https://github.com/eduNEXT/openedx-events.git@MJG/events_definition#egg=events_definition
We'll add soon an example using our plugin openedx-basic-hooks!
Reviewers:
Merge checklist:
Post merge:
finished.
Author concerns:
None for now