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

add support Tencent SMS #470

Merged
merged 13 commits into from
Sep 21, 2021
Merged

add support Tencent SMS #470

merged 13 commits into from
Sep 21, 2021

Conversation

liuxingjun
Copy link

@liuxingjun liuxingjun commented Sep 17, 2021

Description

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

@nsano-rururu
Copy link
Collaborator

Would you like to add the following settings to schema.yaml?
https://github.com/jertel/elastalert2/blob/master/elastalert/schema.yaml

  ### Tencent SMS
  tencent_sms_secret_id: {type: string}
  tencent_sms_secret_key: {type: string}
  tencent_sms_sdk_appid: {type: string}
  tencent_sms_to_number: {type: array, items: {type: string}}
  tencent_sms_sign_name: {type: string}
  tencent_sms_region: {type: string}
  tencent_sms_template_id: {type: string}
  tencent_sms_template_parm: {type: array, items: {type: string}}

Add Tencent SMS between Telegram and The Hive.

https://github.com/jertel/elastalert2/blob/master/docs/source/elastalert.rst#overview

@nsano-rururu nsano-rururu added bug Something isn't working and removed bug Something isn't working labels Sep 17, 2021
@nsano-rururu
Copy link
Collaborator

nsano-rururu commented Sep 17, 2021

Added support for [Tencent SMS](https://intl.cloud.tencent.com/document/product/382/40606) - @liuxingjun

         ↓

Added support for Tencent SMS - [#470](https://github.com/jertel/elastalert2/pull/470) - @liuxingjun

@liuxingjun
Copy link
Author

@nsano-rururu I have finished editing

@nsano-rururu
Copy link
Collaborator

There are not enough test cases. Coverage is not 100%.

87% 121-124, 127

@nsano-rururu
Copy link
Collaborator

@liuxingjun

Is it difficult to implement the rest of the tests?

@liuxingjun
Copy link
Author

@nsano-rururu The correct tencent_sms_secret_id is required to achieve 100% coverage

@nsano-rururu
Copy link
Collaborator

@jertel

100% coverage seems difficult, but some testing has been implemented. I think it's okay to merge, but are there any other points of concern?

@jertel
Copy link
Owner

jertel commented Sep 21, 2021

100% coverage is attainable with mocks but then you're merely testing that the implementation can handle a (potentially flawed) mock response, which is of limited value.

So yes, I think it's good to approve and merge. @nsano-rururu Since you've been the primary reviewer I'll let you do that. Thank you.

Thank you for the contribution @liuxingjun.

@nsano-rururu nsano-rururu merged commit 6b32376 into jertel:master Sep 21, 2021
@liuxingjun
Copy link
Author

@nsano-rururu How soon can I use the helm version

@liuxingjun
Copy link
Author

@jertel This is my first time using python, this is my first time to participate in open source, I can try to improve test coverage later

@jertel
Copy link
Owner

jertel commented Sep 21, 2021

@liuxingjun That is fine. It would be a good exercise for you to learn how to use Python mocks. There are several examples in the existing alerter unit tests.

You can use the existing Helm release for 2.2.1 and change the image.tag param to latest to use your new Tencent SMS changes now. A new 2.2.2 release will likely be created within the next week or so.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants