-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add language auto-tagging #32907
feat: add language auto-tagging #32907
Conversation
Thanks for the pull request, @rpenido! 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. |
7665cf2
to
d964ba3
Compare
f6693fb
to
fe32017
Compare
fe32017
to
a18182b
Compare
a18182b
to
2bc5070
Compare
Hi @ChrisChV! Could you give me a light here? After the auto-tagging, this test is failing.
When we delete an XBlock, we also delete the ObjectTag associated with it. The problem here is that this test counts the queries against the DB, and we have one more here because of the delete. edx-platform/xmodule/modulestore/tests/test_mixed_modulestore.py Lines 1195 to 1196 in 63a0808
Whats is the best approach to make this maintainable in the long term? Just update the query count? Mock the handler? |
@rpenido You can just update the query count. That's what these tests are for - making you aware that the new functionality is having a performance impact on the deletion of XBlocks in general. However, a single additional query is totally fine, especially if it's a very simple and fast query like deleting one row by ID. |
a6e08f2
to
ee179b1
Compare
Feature flag done: 5200966 |
# .. toggle_use_cases: open_edx | ||
# .. toggle_creation_date: 2023-08-30 | ||
# .. toggle_tickets: https://github.com/openedx/modular-learning/issues/79 | ||
CONTENT_TAGGING_AUTO = WaffleSwitch('content_tagging.auto', __name__) |
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.
Maybe we should use CourseWaffleFlag
so that we can turn this on on a per-course basis? 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.
Will this feature be enabled by default sometime in the future? Or do you see it always as an opt-in?
Wouldn't it be a hassle to make the user enable it every time he creates a course?
I don't know the product well enough to find the right balance between features and usability here. I'll happily follow your call!
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.
Yes, in the future we'll enable it by default and remove this setting. Making it a course waffle flag doesn't mean it's only enabled on a course-by-course basis; you can still turn it on for the whole instance, on our sandbox for example. It just means that during the testing phase you may choose to only turn it on for certain courses.
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! I will look at the documentation tomorrow and change it to a CourseWaffleFlag
if I don't see any problem.
Thank you for your input!
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.
Done 154a4ae!
Hi @bradenmacdonald! I think this is ready for another review round! |
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.
@rpenido Looks good to me 👍 Only one comment about the tests. Also, for the record, you need to update the testing instructions with "enable the waffle flag" to check the functionality.
- I tested this by:
- Checking and running the tests
- Run and revert migrations
- Following the testing instructions to check auto tagging functionality
- I read through the code.
- Includes documentation -- docstrings
LANGUAGE_TAXONOMY_ID = -1 | ||
|
||
|
||
@skip_unless_cms # Auto-tagging is only available in the CMS |
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.
And I think is happend the same with test_views. (CI action)
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.
Hm..
Do you know a way to include these tests in the CMS test group? The view is not enabled in LMS, so it will fail there.
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.
Do you know a way to include these tests in the CMS test group? The view is not enabled in LMS, so it will fail there.
Oh I understand, I haven't found an example of it, I'm not sure if it's a good practice. @bradenmacdonald could you help us with this?
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.
@ChrisChV good catch - thanks!
Unfortunately it seems like the whole openedx/features/
directory is only tested as LMS on CI. What you'll need to do is after this PR merges, open a second PR to move this whole content_tagging
app from openedx/features/
to openedx/core/djangoapps/content_tagging
. Then, you can edit unit-test-shards.json
and put it into shard openedx-3
or openedx-4
(whichever is currently running faster on the CI).
Well noted @ChrisChV ! 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.
Looks good, thanks! I can merge tomorrow.
I see you just updated this with master. I'll hit merge once the build is green. Thanks. |
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
commit taken from openedx#32907
Description
This PR adds an auto-tagging feature (language) for Courses and XBlocks.
Every time a Course/XBlock is updated, if there is no Language ObjectTag associated with this Course/XBlock, a new one is created using the Course Language as a reference.
Supporting information:
More Info
Depends on:
Testing instructions
test_taks.py
.Manual check can be done in the CMS App:
lms
andstudio
usingmake dev.up.lms+studio+frontend-app-learning
CONTENT_TAGGING_AUTO
CourseWaffleFlaghttp://localhost:18010/
and login with[email protected]
/edx
./in cms python manage.py cms shell
) and and check the created ObjectTags:Private-ref: FAL-3460