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

[MM-340] Fix issue of receiving incorrect notification for various events in DM #471

Merged
merged 7 commits into from
Jul 10, 2024

Conversation

ayusht2810
Copy link
Contributor

@ayusht2810 ayusht2810 commented Apr 3, 2024

Summary

  • Fixed issue of receiving incorrect notifications for various events in the DM
  • Added logic to get notification when user is added as assignee or reviewer

Ticket Link

Checklist

  • Completed dev testing
  • make test Ran test cases and ensured they are passing
  • make check-style Ran style check and ensured both webapp and server pass the checks

What to test?

  • Check for the notification when MR is assigned to you as a reviewer or assignee

@ayusht2810 ayusht2810 self-assigned this Apr 3, 2024
@ayusht2810 ayusht2810 added the 2: Dev Review Requires review by a core committer label Apr 3, 2024
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 35.67%. Comparing base (53b10f3) to head (16bbb47).
Report is 24 commits behind head on master.

Current head 16bbb47 differs from pull request most recent head b0334c0

Please upload reports for the commit b0334c0 to get more accurate results.

Files Patch % Lines
server/webhook/merge_request.go 87.50% 12 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #471      +/-   ##
==========================================
+ Coverage   34.02%   35.67%   +1.65%     
==========================================
  Files          22       22              
  Lines        4021     4146     +125     
==========================================
+ Hits         1368     1479     +111     
- Misses       2515     2524       +9     
- Partials      138      143       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

Nice work on this @ayusht2810 👍 I have some comments for discussion

server/webhook/merge_request.go Outdated Show resolved Hide resolved
server/webhook/merge_request.go Outdated Show resolved Hide resolved
server/webhook/merge_request.go Outdated Show resolved Hide resolved
server/webhook/merge_request.go Outdated Show resolved Hide resolved
@raghavaggarwal2308 raghavaggarwal2308 added this to the v1.10.0 milestone Jul 1, 2024
@ayusht2810
Copy link
Contributor Author

@mickmister updated the function name. Other comments are pending on @hanzei and your reply.

@mickmister mickmister requested a review from hanzei July 2, 2024 15:09
server/webhook/merge_request.go Outdated Show resolved Hide resolved
func (w *webhook) checkForMultipleEvents(event *gitlab.MergeEvent) bool {
eventCount := 0
if event.Changes.Labels.Current != nil || event.Changes.Labels.Previous != nil {
eventCount++
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can the code simply return with return true in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the above function in the updated logic as there was no need for it.

@ayusht2810 ayusht2810 requested a review from hanzei July 8, 2024 08:56
@ayusht2810
Copy link
Contributor Author

@hanzei Fixed the review fixes. Please re-review.

Copy link
Collaborator

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

LGTM

server/webhook/merge_request.go Outdated Show resolved Hide resolved
@ayusht2810 ayusht2810 added the 3: QA Review Requires review by a QA tester label Jul 8, 2024
Copy link

@AayushChaudhary0001 AayushChaudhary0001 left a comment

Choose a reason for hiding this comment

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

The above PR has been tested for the following scenarios:

  • Tested the notification when MR is assigned to you as a reviewer or assignee
  • Tested the notification when MR is assigned to other user as a reviewer or assignee

The PR was working fine for both the conditions, LGTM. Approved

@raghavaggarwal2308 raghavaggarwal2308 merged commit 01b5e6c into master Jul 10, 2024
7 checks passed
@raghavaggarwal2308 raghavaggarwal2308 deleted the MM-340 branch July 10, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add feature to receive notification when user is removed as the assignee or the reviewer
5 participants