-
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
Tag in Collections [FC-0062] #35383
Tag in Collections [FC-0062] #35383
Conversation
Thanks for the pull request, @ChrisChV! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
requirements/edx/kernel.in
Outdated
@@ -76,7 +76,7 @@ edx-event-bus-kafka>=5.6.0 # Kafka implementation of event bus | |||
edx-event-bus-redis | |||
edx-milestones | |||
edx-name-affirmation | |||
edx-opaque-keys | |||
git+https://github.com/open-craft/opaque-keys.git@chris/FAL-3785-collections-key#egg=edx-opaque-keys |
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.
TODO: Bump opaque-keys version
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
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.
Thank you for your work @ChrisChV ! 👍
Could you add some tests for the view to check the permissions?
From the code, I think they will just work but I think it is worth the extra tests.
try: | ||
return LibCollectionKey.from_string(key_str) | ||
except InvalidKeyError as usage_key_error: | ||
raise ValueError("object_id must be a CourseKey, LibraryLocatorV2 or a UsageKey") from usage_key_error |
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:
raise ValueError("object_id must be a CourseKey, LibraryLocatorV2 or a UsageKey") from usage_key_error | |
raise ValueError("object_id must be one of the following keys: CourseKey, LibraryLocatorV2, UsageKey or LibCollectionKey") from usage_key_error |
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.
Updated here: 2849d4b
@rpenido Thanks for the review.
I'm unsure how to test that at the Python API level, as that has not been checked there. As far as I understand that permission is checked in |
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 thank you @ChrisChV !
- I tested this by tagging some collections from the command line.
- I read through the code
-
I checked for accessibility issuesN/A - Includes documentation
- User-facing strings are extracted for translation
@@ -135,7 +135,7 @@ def _get_library_block_tagged_object( | |||
|
|||
|
|||
def build_object_tree_with_objecttags( | |||
content_key: LibraryLocatorV2 | CourseKey, | |||
content_key: LibraryLocatorV2 | CourseKey | LibraryCollectionKey, |
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 it ok to use content_tagging.types.ContentKey
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.
Updated: 4bc07a0
It is a bit of back-and-forth. The permission is checked in You updated this file, so I think the permission was updated. Here we test tagging a course, a block and a library. I think we should also test tagging a collection. |
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.
LGTM 👍
Thank you @ChrisChV!
- I tested this using the instructions from the PR
- I read through the code
-
I checked for accessibility issues - Includes documentation
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. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
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. |
Description
Updates tagging_api to enable tags objects with
LibCollectionKey
as key.Supporting information
Testing instructions
Other information
edx-opaque-keys