mattermost-community / mattermost-plugin-aws-SNS

Plugin that receives SNS notification from Alerts created by AWS CloudWatch and sent via AWS SNS
Apache License 2.0
21 stars 22 forks source link

Support for multiple channels #75

Closed limod closed 11 months ago

limod commented 1 year ago

Hi!

i added the feature to specify multiple channels. We have multiple environments and want to seperate your monitoring into different mattermost channels.

You can configure the field Channels to send notifications to include multiple channels separated by ; e.g. teamname,channelname;teamname-2,channelname-2

You can configure the target channel in the webhook URL, e.g. https://your-mattermost-url/plugins/com.mattermost.aws-sns?token=your-mattermost-token?channel=teamname,channelname

If you specify no channel query parameter, the first channel will be used. Therefore the change should be compatible with older version.

Added some tests: go test ./... -cover

Added the flag CGO_ENABLED=0in the Makefile because i hat problems running the plugin in a dev mattermost setup (Image: mattermost/mattermost-team-edition:7.4.0): Plugin could not start becasue of error GLIBC_2.34 not found, with local development in the current mattermost-server project, everything worked without the flag. Any ideas why i hit this error?

mattermost-build commented 1 year ago

Hello @limod,

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.

codecov[bot] commented 1 year ago

Codecov Report

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

Comparison is base (363b452) 0.00% compared to head (d22dc40) 17.03%. Report is 2 commits behind head on master.

:exclamation: Current head d22dc40 differs from pull request most recent head d57bf24. Consider uploading reports for the commit d57bf24 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #75 +/- ## =========================================== + Coverage 0 17.03% +17.03% =========================================== Files 0 4 +4 Lines 0 587 +587 =========================================== + Hits 0 100 +100 - Misses 0 469 +469 - Partials 0 18 +18 ``` | [Files](https://app.codecov.io/gh/mattermost/mattermost-plugin-aws-SNS/pull/75?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost) | Coverage Δ | | |---|---|---| | [server/command.go](https://app.codecov.io/gh/mattermost/mattermost-plugin-aws-SNS/pull/75?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost#diff-c2VydmVyL2NvbW1hbmQuZ28=) | `23.07% <0.00%> (ø)` | | | [server/plugin.go](https://app.codecov.io/gh/mattermost/mattermost-plugin-aws-SNS/pull/75?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost#diff-c2VydmVyL3BsdWdpbi5nbw==) | `15.22% <41.66%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/mattermost/mattermost-plugin-aws-SNS/pull/75/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mattermost)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

limod commented 1 year ago

Accidentally removed @stylianosrigas, i am not able to readd him. @mickmister

mattermost-build commented 1 year ago

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!

limod commented 1 year ago

When will the review continue?

mickmister commented 1 year ago

@mkdbns @DHaussermann @jasonblais Thoughts on handling QA review on community contributions like this?

jasonblais commented 1 year ago

@mkdbns would this be an example contribution for your team to QA review & merge once your team has the proper GitHub access?

Kshitij-Katiyar commented 11 months ago

@limod @mickmister From our QA

Tested and Passed The comment above is necessary for this PR to work and I have tested everything after making that change because without that the token will always be incorrect.

1) Tested the plugin by updating the system console values to include multiple channels and notifications are coming successfully.

2) Cases handled:- i) Invalid channelID in both the system console and in the URL. ii) URL without channelid also works fine.

mickmister commented 11 months ago

Thanks for the contribution @limod!