-
Notifications
You must be signed in to change notification settings - Fork 11
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: model for upstream-downstream links #269
base: main
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @navinkarkera! This repository is currently maintained by @axim-engineering. Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
e06f148
to
aa3e463
Compare
aa3e463
to
87df63e
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.
👍 I left a few nits/questions about some field types and naming conventions, but this is working well :)
- I tested this using the test instructions on feat: upstream-downstream entity linking edx-platform#36111
- I read through the code
-
I checked for accessibility issues by using my keyboard to navigateN/A - Includes documentation -- code comments for modules and classes
- User-facing strings are extracted for translation -- mostly, but I've noted where the model
verbose_name
fields need marking too.
version_synced = models.IntegerField() | ||
version_declined = models.IntegerField(null=True, blank=True) | ||
created = manual_date_time_field() | ||
updated = manual_date_time_field() |
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.
nit: shouldn't the updated
date have auto_now=True
like most modified
date fields do? Without this, I can't see when the entity link gets updated.
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.
It is by design, for example: https://github.com/open-craft/openedx-learning/blob/e5cd584cd3a955b121080f8d23ae03f66e813497/openedx_learning/apps/authoring/publishing/models.py#L80
The reasoning is mentioned here: https://github.com/open-craft/openedx-learning/blob/e5cd584cd3a955b121080f8d23ae03f66e813497/openedx_learning/lib/fields.py#L159-L167
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.
Ok -- but why have this field if it's always the same as created
?
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.
No it should not be always same, it should be different when you
- accept or reject an update from upstream (
version_synced
orversion_declined
field should be updated along with updated field). - you change course name.
help_text=_("Status of links in given course."), | ||
) | ||
created = manual_date_time_field() | ||
updated = manual_date_time_field() |
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.
ditto nit: shouldn't the updated
date have auto_now=True
like most modified
date fields do? Without this, I can't see when the status gets force-updated.
" and useful to track upstream library blocks that do not exist yet" | ||
) | ||
) | ||
upstream_context_key = case_sensitive_char_field( |
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.
Why isn't this a key_field
like the downstream_context_key
and CourseLinksStatus.context_key
?
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.
Initially I was planning to keep the field nullable which is why I did not use key_field
but after giving it a bit more thought, used key_field
and made sure that field is always added.
class CourseLinksStatus(models.Model): | ||
""" | ||
This table stores current processing status of upstream-downstream links in PublishableEntityLink table for a | ||
course. |
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.
Is there ever a case where we'd want to re-process the downstream links for a given library (and therefore want to track them too)? I ask only because the naming for this model is very course-specific, but the data itself doesn't care about courses -- any learning context should work fine 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.
Dave suggested tracking these courses so that we can trigger processing when a course author visits sync page of a course, to avoid processing all of them in a migration.
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.
any learning context should work fine here.
True, we should probably rename the table.
update: Renamed.
eb07b12
to
cfb3978
Compare
cfb3978
to
d287508
Compare
Adds models and api's for Publishable entity links.
See openedx/edx-platform#36111 for more information and testing instructions.