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

[GH-507,699] Add Support for DM subscriptions for watchers and reporter #872

Closed
wants to merge 11 commits into from

Conversation

Kshitij-Katiyar
Copy link
Contributor

@Kshitij-Katiyar Kshitij-Katiyar commented Sep 22, 2022

Summary

  • In order to get a DM notification from the Jira plugin, the user has to meet certain criteria like being assigned or mentioned. But now even if a user is a reporter or watching that issue will also get a DM notification.
  • This PR contains all the changes from Pr #840 So this PR alone is enough to fix this issue so we can close Pr #840 afterward.

Issue

…#1)

* [MI-2088]:Add Support for DM subscriptions for watchers and reporters

* [MI-2088]: Review Fixes
1. Improved the name of certain variable
2. Improved spacing

* [MI-2088]:Revieww fixes
1.Changes the names of few variables
2.Improved code complexity

* [MI-2088]: Review fixes done
1.Changed the name of few variables

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

Co-authored-by: Kshitij Katiyar <kshitij.katiyar@brightscout.com>
@mattermod
Copy link
Contributor

Hello @Kshitij-Katiyar,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Copy link
Contributor

@javaguirre javaguirre left a comment

Choose a reason for hiding this comment

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

Hi! I'm Javi, from Mattermost (first week), I have a couple of comments, let me know what you think!

Thank you for the hard work! This is a tricky one! :-)

server/settings.go Outdated Show resolved Hide resolved
server/settings.go Outdated Show resolved Hide resolved
server/webhook.go Outdated Show resolved Hide resolved
@javaguirre
Copy link
Contributor

@Kshitij-Katiyar @Nityanand13 This is what I mean, I think changing the way we store the data in the struct would make us do much less code and this code would be easier to test.

https://replit.com/@javaguirre/GH-507699#main.go

Let me know what you think!

@javaguirre javaguirre self-requested a review September 27, 2022 08:02
Copy link
Contributor

@javaguirre javaguirre left a comment

Choose a reason for hiding this comment

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

Let me know when you have an opinion on my approach! Thank you! :-)

@Nityanand13
Copy link
Contributor

@javaguirre Sorry for the late reply. Your approach seems good and now I am implementing the same.

@javaguirre
Copy link
Contributor

Thank you @Nityanand13 ! Let me know if you need anything! 👍

…struct so that the code can be easily tested (#6)

* [MI-2088]:Add Support for DM subscriptions for watchers and reporters

* [MI-2088]: Review Fixes
1. Improved the name of certain variable
2. Improved spacing

* [MI-2088]:Revieww fixes
1.Changes the names of few variables
2.Improved code complexity

* [MI-2088]: Review fixes done
1.Changed the name of few variables

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:Review fixes done
1.Changed the way to store assignee, mention, reporter and watching in struct so that the code can be easily tested

* [MI-2088]: Review fixes done
1. Changed the name of various variables
2. Used constants everywhere

Co-authored-by: Kshitij Katiyar <kshitij.katiyar@brightscout.com>
@Kshitij-Katiyar Kshitij-Katiyar requested review from javaguirre and removed request for mickmister September 30, 2022 10:18
Copy link
Contributor

@javaguirre javaguirre left a comment

Choose a reason for hiding this comment

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

Thank you! I really like the changes, I think it's much cleaner now.

I have some details to finish, let me know what you think!

server/user.go Outdated Show resolved Hide resolved
server/issue.go Outdated Show resolved Hide resolved
server/issue.go Outdated Show resolved Hide resolved
@javaguirre
Copy link
Contributor

Could you post a video on how to use this new change? Something like this so it's easier to QA.

#863 (comment)

Thank you!

@Nityanand13
Copy link
Contributor

Could you post a video on how to use this new change? Something like this so it's easier to QA.

#863 (comment)

Thank you!

Vedio link for this PR:

  1. https://drive.google.com/file/d/1lSTDElqTwI1_XTwunTtaSCepWroMyb7Z/view?usp=sharing
  2. https://drive.google.com/file/d/1Xpi9jdftdPk0NBLZ8yROJmjMLhKRuK82/view?usp=sharing

@javaguirre
Copy link
Contributor

Thank you very much @Nityanand13 ! Let me know when testing is done @Kshitij-Katiyar . 👍

@javaguirre
Copy link
Contributor

@Nityanand13 Can't open the videos in any of the PRs, can you check the extension of the files and tell me what kind of video is so I can open it? Also If I could already open it online would be nice, with something like loom or whatever video Drive supports.

Thank you very much!

@Nityanand13
Copy link
Contributor

@Nityanand13 Can't open the videos in any of the PRs, can you check the extension of the files and tell me what kind of video is so I can open it? Also If I could already open it online would be nice, with something like loom or whatever video Drive supports.

Thank you very much!

Vedio link for this PR:

  1. Add_Support_for_DM_subscriptions_for_watchers.webm
  2. Add_Support_for_DM_subscriptions_for_reporter.webm

@javaguirre
Copy link
Contributor

The CI is failing @Nityanand13 , let me know if you can check it out! Thank you!

@javaguirre
Copy link
Contributor

I see the changes are in the other PR

* [MI-2088]:Add Support for DM subscriptions for watchers and reporters

* [MI-2088]: Review Fixes
1. Improved the name of certain variable
2. Improved spacing

* [MI-2088]:Revieww fixes
1.Changes the names of few variables
2.Improved code complexity

* [MI-2088]: Review fixes done
1.Changed the name of few variables

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:Review fixes done
1.Changed the way to store assignee, mention, reporter and watching in struct so that the code can be easily tested

* [MI-2088]: Review fixes done
1. Changed the name of various variables
2. Used constants everywhere

* [MI-2088]: Review fixes done
1. Added Test cases
2. Used booleans instead of pointer in RolesForDMNotification

* [MI-2088]: Review fixes done
1. Modified test cases

* [MI-2088]: Review fixes done
1. Self reviewed

* [MI-2088]: Review fixes done
1. Changed the formatting
2. Changed the name of few variables
3. Improved code quality

* [MI-2088]: Fixes CI errors

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Review fixes done
1. Improved code quality

Co-authored-by: Kshitij Katiyar <kshitij.katiyar@brightscout.com>
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.

Great work on this @Kshitij-Katiyar! have a just a few questions here, and a request to remove changes unrelated to the purpose of the PR. Please let me know what you think 👍

server/issue.go Outdated
Value: issue.ID,
Label: issue.Name,
})
issueTypes[index] = option{
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes relevant to the purpose of this PR? Also it seems we may introduce a bug here, since the continue statement above will result in a null pointer on the frontend, since we are "skipping" over that index.

server/settings.go Outdated Show resolved Hide resolved
server/settings.go Outdated Show resolved Hide resolved
server/subscribe_test.go Show resolved Hide resolved
server/webhook_worker.go Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2022

Codecov Report

Patch coverage: 38.84% and project coverage change: +0.44 🎉

Comparison is base (7a5c616) 30.14% compared to head (d769010) 30.59%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #872      +/-   ##
==========================================
+ Coverage   30.14%   30.59%   +0.44%     
==========================================
  Files          49       49              
  Lines        7467     7629     +162     
==========================================
+ Hits         2251     2334      +83     
- Misses       5027     5094      +67     
- Partials      189      201      +12     
Impacted Files Coverage Δ
server/client.go 7.46% <0.00%> (-0.58%) ⬇️
server/client_cloud.go 0.00% <ø> (ø)
server/client_server.go 0.00% <ø> (ø)
server/command.go 15.72% <0.00%> (-0.35%) ⬇️
server/http.go 43.67% <ø> (-0.65%) ⬇️
server/plugin.go 9.50% <0.00%> (+0.02%) ⬆️
server/user_cloud.go 0.00% <0.00%> (ø)
server/user_server.go 6.50% <0.00%> (-0.40%) ⬇️
server/webhook.go 29.13% <0.00%> (-1.96%) ⬇️
server/webhook_worker.go 0.00% <0.00%> (ø)
... and 4 more

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

* [MI-2088]:Add Support for DM subscriptions for watchers and reporters

* [MI-2088]: Review Fixes
1. Improved the name of certain variable
2. Improved spacing

* [MI-2088]:Revieww fixes
1.Changes the names of few variables
2.Improved code complexity

* [MI-2088]: Review fixes done
1.Changed the name of few variables

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:fixed review fixes

* [MI-2088]:Review fixes done
1.Changed the way to store assignee, mention, reporter and watching in struct so that the code can be easily tested

* [MI-2088]: Review fixes done
1. Changed the name of various variables
2. Used constants everywhere

* [MI-2088]: Review fixes done
1. Added Test cases
2. Used booleans instead of pointer in RolesForDMNotification

* [MI-2088]: Review fixes done
1. Modified test cases

* [MI-2088]: Review fixes done
1. Self reviewed

* [MI-2088]: Review fixes done
1. Changed the formatting
2. Changed the name of few variables
3. Improved code quality

* [MI-2088]: Fixes CI errors

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Fixed CI errors

* [MI-2088]: Review fixes done
1. Solved a bug of getting null pointer on frontend.
2. Improved code quality

* [MI-2088]: Fixed CI errors

* [MI-2088]: Review fixes done
1. Improved code quality

* [MI-2088]: Reivew fixes done
1. Improved code quality

Co-authored-by: Kshitij Katiyar <kshitij.katiyar@brightscout.com>
@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@tomcat78
Copy link

Hey, is there still something blocking this issue? I'd love to have the option to get notifications on tickets, that I watch.

@mickmister mickmister removed Lifecycle/1:stale 2: Dev Review Requires review by a core committer labels Mar 28, 2023
@mickmister
Copy link
Contributor

@Kshitij-Katiyar Can you please resolve the merge conflicts here? Thank you 👍

@hanzei hanzei added the Awaiting Submitter Action Blocked on the author label Mar 30, 2023
@mattermost-build
Copy link
Contributor

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

@Kshitij-Katiyar
Copy link
Contributor Author

@Kshitij-Katiyar Can you please resolve the merge conflicts here? Thank you 👍

@mickmister sure resolving them.

@mickmister
Copy link
Contributor

@DHaussermann This PR is ready for QA review

@hanzei hanzei removed the Awaiting Submitter Action Blocked on the author label Aug 8, 2023
@mickmister
Copy link
Contributor

@Kshitij-Katiyar I think we should tell the user why they received a notification. e.g. "because you are watching x" or "because you reported x"

@hanzei
Copy link
Collaborator

hanzei commented Sep 1, 2023

@AayushChaudhary0001 Would you be open to reviewing this PR?

@hanzei hanzei requested review from AayushChaudhary0001 and removed request for DHaussermann October 16, 2023 20:21
@hanzei hanzei added the Awaiting Submitter Action Blocked on the author label Oct 16, 2023
@hanzei
Copy link
Collaborator

hanzei commented Oct 16, 2023

@Kshitij-Katiyar Heads up that there is a conflict to resolve.

@mickmister
Copy link
Contributor

@Kshitij-Katiyar I think we should tell the user why they received a notification. e.g. "because you are watching x" or "because you reported x"

I'd like to reiterate this point. I think this would be a big help when using this feature

@Kshitij-Katiyar
Copy link
Contributor Author

This PR was very outdated, which is why we had to create a new one. All the changes from this PR are included in #1097, so we are closing this one.

@mattermost-build mattermost-build removed the Awaiting Submitter Action Blocked on the author label Jul 5, 2024
@raghavaggarwal2308 raghavaggarwal2308 deleted the mm-507 branch July 8, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester
Projects
None yet