Skip to content

feat: Language auto tagging library blocks - #34056

Merged
bradenmacdonald merged 1 commit into
openedx:masterfrom
open-craft:yusuf-musleh/lang-auto-tag-library-blocks
Jan 23, 2024
Merged

feat: Language auto tagging library blocks#34056
bradenmacdonald merged 1 commit into
openedx:masterfrom
open-craft:yusuf-musleh/lang-auto-tag-library-blocks

Conversation

@yusuf-musleh

Copy link
Copy Markdown
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

openedx-webhooks commented Jan 15, 2024

Copy link
Copy Markdown

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
Comment thread openedx/core/djangoapps/content_tagging/tasks.py Outdated
@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
Comment thread openedx/core/djangoapps/content_tagging/handlers.py Outdated
@rpenido
rpenido self-requested a review January 17, 2024 16:30

@rpenido rpenido left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread openedx/core/djangoapps/content_tagging/handlers.py Outdated
Comment thread openedx/core/djangoapps/content_tagging/handlers.py Outdated
@bradenmacdonald

Copy link
Copy Markdown
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

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread openedx/core/djangoapps/content_tagging/handlers.py Outdated
@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
@bradenmacdonald
bradenmacdonald deleted the yusuf-musleh/lang-auto-tag-library-blocks branch January 23, 2024 18:00
@openedx-webhooks

Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Contributor

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

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
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