Enforce limit on number of tags per object#81
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. |
|
ToDo: bump version |
yusuf-musleh
left a comment
There was a problem hiding this comment.
@rpenido Great work! I just had a few comments on a test case we are missing if you could take a look.
|
|
||
| if current_count >= 100: | ||
| raise ValueError( | ||
| _(f"Object ({object_id}) already have 100 or more tags.") |
There was a problem hiding this comment.
nit: just a small spelling fix, "already have" -> "already has"
There was a problem hiding this comment.
We are talking about the future state, not the current.
| _(f"Object ({object_id}) already have 100 or more tags.") | ||
| ) | ||
|
|
||
| _check_current_tag_count() |
There was a problem hiding this comment.
Shouldn't this check also include the count of the new tags that will will be potentially be added, since this check is happening at the beginning of the function call? Eg: What happens when the current_count is say 99 but there are 2 new tags in the tags list leading to 101, would this check catch it?
There was a problem hiding this comment.
You're right @yusuf-musleh! I totally missed the allow_multiple cases.
Thank you for pointing out!
| assert response.status_code == expected_status | ||
| assert not status.is_success(expected_status) # No success cases here | ||
|
|
||
| def test_tag_object_count_limit(self): |
There was a problem hiding this comment.
Would super helpful if we could also add a test case that covers the scenario described above.
yusuf-musleh
left a comment
There was a problem hiding this comment.
👍 Thanks for making the changes! Looks good to me, I believe @bradenmacdonald would need to do the final approval/merge for it.
- I tested this: I read through the tests to make sure it covers the cases
- 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'sconfiguration-securerepository.
bradenmacdonald
left a comment
There was a problem hiding this comment.
Nice work! And I love the simplification of not needing pagination due to the new rule.
|
@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. |
Description
This PR enforces a 100 hardcoded limit on the number of ObjectTags applied on any object. It also removes the pagination of the tagging REST API for listing and updating object tags.
Supporting Information
Testing instructions
After merge
v0.1.7Private-ref: FAL-3501