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: Language auto tagging library blocks #34056

Conversation

yusuf-musleh
Copy link
Member

Description

This PR adds functionality of automatically tagging library blocks with a language tag when they created/update and automatically deletes them when they are deleted.

Supporting information

Related Tickets:

Testing instructions

  1. Run your devstack on this PR
  2. Set the content_tagging.auto waffle flag
  3. Make sure you have the library authoring mfe setup and running locally, so you can create library and add blocks to them
  4. Navigate to studio then click on the Libraries tab, the library mfe should open
  5. From there create a new library if you don't already have, and click on it
  6. Before creating new blocks, check the existing object tags in the cms shell (make cms-shell):
>>> from openedx_tagging.core.tagging.models import ObjectTag
>>> ObjectTag.objects.all().count()
  1. Back in the library authoring mfe, create a new block, then go back to the shell and check that a new ObjectTag was created, the count should increase and you can also inspect the .last() to see the newly created one
  2. Navigate back to the library authoring mfe, and delete the newly created block and confirm in the cms shell that the count when down and the .last() is now longer what it was in the previous step.

Private-ref: FAL-3497

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 15, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Jan 15, 2024

Thanks for the pull request, @yusuf-musleh! 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.

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lang-auto-tag-library-blocks branch from 9436b16 to c66d0bf Compare January 15, 2024 19:37
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lang-auto-tag-library-blocks branch 4 times, most recently from 42e4470 to 20e1601 Compare January 16, 2024 16:06
@yusuf-musleh yusuf-musleh marked this pull request as ready for review January 16, 2024 17:42
@rpenido rpenido self-requested a review January 17, 2024 16:30
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

Good job @yusuf-musleh! 👍

  • I tested this using the Testing Instructions and the tag was correctly applied and removed from the library
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

I just added a nit about the flag check order.

@bradenmacdonald
Copy link
Contributor

(I know that both of my comments ^ are about existing patterns that you just copied, but I'm wondering why it's like that, so I'd like to consider a simpler version rather than just copying it as-is).

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lang-auto-tag-library-blocks branch 2 times, most recently from 1f4be3b to a92a573 Compare January 21, 2024 13:11
Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Nice, thanks! I'll merge tomorrow

openedx/core/djangoapps/content_tagging/handlers.py Outdated Show resolved Hide resolved
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lang-auto-tag-library-blocks branch from a92a573 to 71eb943 Compare January 23, 2024 12:21
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lang-auto-tag-library-blocks branch from 71eb943 to be2dbb8 Compare January 23, 2024 12:33
@bradenmacdonald bradenmacdonald merged commit 2323b3b into openedx:master Jan 23, 2024
45 checks passed
@bradenmacdonald bradenmacdonald deleted the yusuf-musleh/lang-auto-tag-library-blocks branch January 23, 2024 18:00
@openedx-webhooks
Copy link

@yusuf-musleh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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
Archived in project
Development

Successfully merging this pull request may close these issues.

[Tagging] Automatically add system tags for Language (to library blocks)
5 participants