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

object: fix handling for notifications for OBC #9365

Merged
merged 1 commit into from Dec 21, 2021

Conversation

thotz
Copy link
Contributor

@thotz thotz commented Dec 9, 2021

Current approach is to delete all the existing notifcations from bucket
and re-add the notification from the labels.

Signed-off-by: Jiffin Tony Thottan thottanjiffin@gmail.com

Description of your changes:

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@yuvalif
Copy link
Contributor

yuvalif commented Dec 9, 2021

looks good!
could you please add a unit tests that covers the new code in the controller?
should be possible by mocking the GetNotifications() and DeleteNotification()call for a specific test, so that it verifies that the notifications that should be deleted are indeed deleted

@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from 5b0b754 to f1dee39 Compare December 9, 2021 10:47
Copy link
Contributor

@yuvalif yuvalif left a comment

Choose a reason for hiding this comment

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

see comment: #9365 (comment)

unit tests should cover the case where some notifications are added some deleted and some unchanged.
this could be verified by mocking the "get", "create" and "delete" functions for this specific test.
the verification can make sure that each notifications is handled correctly (and not only that the functions are invoked)

@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from f1dee39 to 4e8f783 Compare December 14, 2021 07:34
@thotz
Copy link
Contributor Author

thotz commented Dec 14, 2021

see comment: #9365 (comment)

unit tests should cover the case where some notifications are added some deleted and some unchanged. this could be verified by mocking the "get", "create" and "delete" functions for this specific test. the verification can make sure that each notifications is handled correctly (and not only that the functions are invoked)

Done

@thotz thotz requested a review from leseb December 14, 2021 07:39
@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from 4e8f783 to 58dc412 Compare December 14, 2021 07:39
@yuvalif yuvalif self-requested a review December 14, 2021 10:50
@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from 58dc412 to dbd5436 Compare December 14, 2021 12:34
Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

Looks good. I think all test cases are covered. But I do think we should be verifying correctness of the important aspects of the create/delete calls, not just that they are called.

Also, all logger.{Error,Warning,Info,Debug} messages should include namespaced names for context because a user may create the same name for a resource in multiple namespaces.

@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from dbd5436 to d26161c Compare December 16, 2021 12:33
@thotz thotz requested a review from BlaineEXE December 16, 2021 12:34
Current approach is to delete all the existing notifcations from bucket
and re-add the notification from the labels.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
@thotz thotz force-pushed the bucketnotificationadditionimprovement branch from d26161c to 9d9acc2 Compare December 17, 2021 10:59
@thotz thotz requested a review from BlaineEXE December 17, 2021 10:59
@BlaineEXE BlaineEXE merged commit cb1b063 into rook:master Dec 21, 2021
mergify bot added a commit that referenced this pull request Dec 21, 2021
object: fix handling for notifications for OBC (backport #9365)
@thotz thotz deleted the bucketnotificationadditionimprovement branch December 21, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants