Skip to content

support ali nail(ding talk) , issue:2458#2594

Merged
davidzollo merged 36 commits intoapache:devfrom
stanfen:dev
May 14, 2020
Merged

support ali nail(ding talk) , issue:2458#2594
davidzollo merged 36 commits intoapache:devfrom
stanfen:dev

Conversation

@stanfen
Copy link
Copy Markdown
Contributor

@stanfen stanfen commented May 4, 2020

What is the purpose of the pull request

develop issue #2458 : support send msg to ali nail(ding talk) based on ding talk advanced extension: ding talk bots.

  • Group bots can aggregate information from third-party services (like ds) into a group chat, enabling automated information synchronization.
  • enable the function require Webhook configuration. the offical link: enable ding talk

Brief change log

  • modify alert module
  • add ding talk msg convert class DingTalkMsgFormatter
  • add DingTalkUtils to execute message sending
  • modify alert.properties for config proxy, keyword and webhook etc

Verify this pull request

(Please pick either of the following options)

This change added tests and can be verified as follows:

  • Added test case: executing mesage sending but ingore because of lack of configration
  • Added DingTalkMsgFormatter tested
  • Manually verified the change by testing locally.

@codecov-io
Copy link
Copy Markdown

codecov-io commented May 4, 2020

Codecov Report

Merging #2594 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##                dev    #2594   +/-   ##
=========================================
  Coverage     37.20%   37.20%           
  Complexity     2546     2546           
=========================================
  Files           433      433           
  Lines         19921    19921           
  Branches       2421     2421           
=========================================
  Hits           7412     7412           
  Misses        11844    11844           
  Partials        665      665           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8460f9c...8460f9c. Read the comment docs.

@stanfen stanfen changed the title support ali nail(ding talk), issue:2458 support ali nail(ding talk) , issue:2458 May 4, 2020
@davidzollo
Copy link
Copy Markdown
Contributor

please add DingTalkUtilsTest to project root pom.xml, like this:
image

@davidzollo davidzollo marked this pull request as ready for review May 6, 2020 11:46
@stanfen
Copy link
Copy Markdown
Contributor Author

stanfen commented May 8, 2020

anyone can review the pr.
the offical link tell us how to use.
https://ding-doc.dingtalk.com/doc#/serverapi3/iydd5h

@davidzollo
Copy link
Copy Markdown
Contributor

good job,
I want to know how to make "the dingtalk plugin", if there is a simple doc will be better, how do you think?

@stanfen
Copy link
Copy Markdown
Contributor Author

stanfen commented May 10, 2020

good job,
I want to know how to make "the dingtalk plugin", if there is a simple doc will be better, how do you think?

PR using ding talk chat bots to send messages, implement notifications and alerts.To enable the plugin what we need is to complete two steps.

  • first, set ding talk chat bots
    It easy to do that in ding talk PC client. [Group] -> [Settings] ->[Group Assistant] -> [Add bots],and then following the guidelines to set up. Please do remember webhook and keyword, can be set in the DS alert.properties.
  • second, para setting in alert.properties
    it includes two kinds of parameters: required and optional parameters
  1. required parameters
    dingtalk.isEnable//the switch to enable feature or not
    dingtalk.webhook //URL to send message, getting in first step
    dingtalk.keyword // keyword for filtering message, getting in first step
  2. optional parameters
    if requiring a proxy server to access the network, please setting the following:
    dingtalk.proxy=
    dingtalk.port=
    dingtalk.user=
    dingtalk.password=
    dingtalk.isEnableProxy=true

中文描述:
PR利用钉钉群组接收自定义机器人消息机制进行开发。激活功能需要进行2步骤操作:

  • 设置钉钉群自定义机器人
    官方提供说明 官方设置机器人方法
    设置完成后,保存钉钉提供webhook 和关键字等信息。ds需要这2个参数。
  • ds中配置的参数在文件alert.properties
    1.必须参数:
    dingtalk.isEnable//是否开启钉钉消息推送
    dingtalk.webhook //钉钉群接收消息。需要通过PC客户端设置,获取。
    dingtalk.keyword//钉钉群支持消息过滤包括:关键字过滤,即只接收包含关键字消息。
    2.非必须参数:需要代理才能访问网络时,可定义代理参数
    dingtalk.proxy=
    dingtalk.port=
    dingtalk.user=
    dingtalk.password=
    dingtalk.isEnableProxy=true

@hgaol
Copy link
Copy Markdown
Member

hgaol commented May 10, 2020

Hmm.. just answer lidong's question. This is not a plugin, it was coded in Alert service. But currently, there is no entry for DS to choose alert way in the frontend portal, I think this may be enough. Maybe when plugin way is approved and implemented, someone or me can refactor some code to plugin.

For alert plugin doc, I created a PR, which hasn't been merged, you can refer to that PR(hello-world plugin demo), it has a simple README for that.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

40.6% 40.6% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

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

+1

@BackFire
Copy link
Copy Markdown

BackFire commented Aug 6, 2020

good job,
I want to know how to make "the dingtalk plugin", if there is a simple doc will be better, how do you think?

PR using ding talk chat bots to send messages, implement notifications and alerts.To enable the plugin what we need is to complete two steps.

  • first, set ding talk chat bots
    It easy to do that in ding talk PC client. [Group] -> [Settings] ->[Group Assistant] -> [Add bots],and then following the guidelines to set up. Please do remember webhook and keyword, can be set in the DS alert.properties.
  • second, para setting in alert.properties
    it includes two kinds of parameters: required and optional parameters
  1. required parameters
    dingtalk.isEnable//the switch to enable feature or not
    dingtalk.webhook //URL to send message, getting in first step
    dingtalk.keyword // keyword for filtering message, getting in first step
  2. optional parameters
    if requiring a proxy server to access the network, please setting the following:
    dingtalk.proxy=
    dingtalk.port=
    dingtalk.user=
    dingtalk.password=
    dingtalk.isEnableProxy=true

中文描述:
PR利用钉钉群组接收自定义机器人消息机制进行开发。激活功能需要进行2步骤操作:

  • 设置钉钉群自定义机器人
    官方提供说明 官方设置机器人方法
    设置完成后,保存钉钉提供webhook 和关键字等信息。ds需要这2个参数。
  • ds中配置的参数在文件alert.properties
    1.必须参数:
    dingtalk.isEnable//是否开启钉钉消息推送
    dingtalk.webhook //钉钉群接收消息。需要通过PC客户端设置,获取。
    dingtalk.keyword//钉钉群支持消息过滤包括:关键字过滤,即只接收包含关键字消息。
    2.非必须参数:需要代理才能访问网络时,可定义代理参数
    dingtalk.proxy=
    dingtalk.port=
    dingtalk.user=
    dingtalk.password=
    dingtalk.isEnableProxy=true

按照这个配置完成之后,如何在工作流中使用钉钉告警?我用的版本是dev分支编译的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants