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-733] Updated the "issue_creations" subscription to post notification when an issue is labeled/reopened #736

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

raghavaggarwal2308
Copy link
Contributor

Summary

  • Updated the "issue_creations" subscription to post a notification when an issue is labeled/reopened

Screenshots

image

image

What to test:

  • Notification is getting posted when an existing issue is labeled in a channel with a subscription for issue_creations,label:"label-name"
  • Notification is posted when an issue is reopened in a channel with a subscription for issue_creations
Steps to test:
  1. Connect your GitHub account
  2. Create a subscription for issue_creations,label:"label-name" is a channel.
  3. Add a label (same as present in the subscription) to an existing issue.

Ticket Link

Fixes #733

Copy link
Member

@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.

Thanks for this @raghavaggarwal2308 👍

Wondering if you would be up for also changing the string of the "person opened an issue", to include the string "with label x" when it has a label that matches a subscription in the channel

@mickmister
Copy link
Member

Wondering if you would be up for also changing the string of the "person opened an issue", to include the string "with label x" when it has a label that matches a subscription in the channel

I think that "with label x" may need to be applied in multiple other places as well

Copy link
Contributor

@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 👍

One nit pick below

if sub.IssueCreations() && action != actionOpened {
if sub.IssueCreations() && action == actionClosed {
Copy link
Contributor

Choose a reason for hiding this comment

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

2/5 I like the previous code as it ensures that even when new actions are added, the code is only expected for the action open.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hanzei Updated

@hanzei hanzei added the 3: QA Review Requires review by a QA tester label Feb 7, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (2608197) 15.78% compared to head (7a5fc82) 15.78%.

Files Patch % Lines
server/plugin/command.go 50.00% 1 Missing ⚠️
server/plugin/webhook.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #736   +/-   ##
=======================================
  Coverage   15.78%   15.78%           
=======================================
  Files          15       15           
  Lines        5770     5770           
=======================================
  Hits          911      911           
  Misses       4817     4817           
  Partials       42       42           

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

@raghavaggarwal2308
Copy link
Contributor Author

Wondering if you would be up for also changing the string of the "person opened an issue", to include the string "with label x" when it has a label that matches a subscription in the channel

@mickmister Sure, I will make the change

@mickmister
Copy link
Member

@raghavaggarwal2308 We can do the above change in a separate PR. Created an issue for this here #742

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.

This PR has been tested for the following scenarios:-

  • Notification sent to the user in the subscribed channel for desired label added on an issue.
  • Notification sent to the user in the subscribed channel when an issue is opened for "issue_creation" subscription.

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

@avas27JTG avas27JTG merged commit 73c5db9 into mattermost:master Mar 8, 2024
9 checks passed
@avas27JTG avas27JTG deleted the MM-733 branch March 8, 2024 13:26
@hanzei hanzei added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Mar 11, 2024
@ayusht2810 ayusht2810 added this to the v2.3.0 milestone Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue_creations subscription with labels should support labeling an existing issue
7 participants