-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 dingtalk webhook #2777
Add dingtalk webhook #2777
Conversation
024291a
to
f33e2e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests would be nice
models/webhook_dingtalk.go
Outdated
// for each commit, generate attachment text | ||
for i, commit := range p.Commits { | ||
text += fmt.Sprintf("[%s](%s) %s - %s", commit.ID[:7], commit.URL, | ||
strings.TrimRight(commit.Message, "\r\n"), commit.Author.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit.Author
may be nil (see #2771)
models/webhook_dingtalk.go
Outdated
MsgType: "actionCard", | ||
ActionCard: dingtalk.ActionCard{ | ||
Text: title, | ||
Title: text, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should title
and text
be reversed?
models/webhook.go
Outdated
case DING_TALK: | ||
payloader, err = GetDingtalkPayload(p, event, w.Meta) | ||
if err != nil { | ||
return fmt.Errorf("GetDiscordPayload: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong error message
models/webhook_dingtalk.go
Outdated
|
||
type ( | ||
|
||
// DingtalkPayload represents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: represents what?
models/webhook_dingtalk.go
Outdated
MsgType: "actionCard", | ||
ActionCard: dingtalk.ActionCard{ | ||
Text: title, | ||
Title: text, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should title
and text
be reversed?
f33e2e3
to
979991f
Compare
Codecov Report
@@ Coverage Diff @@
## master #2777 +/- ##
==========================================
- Coverage 27.23% 26.99% -0.25%
==========================================
Files 89 90 +1
Lines 17648 17806 +158
==========================================
Hits 4806 4806
- Misses 12154 12312 +158
Partials 688 688
Continue to review full report at Codecov.
|
@ethantkoenig done. |
This is ready to review for v1.4 |
LGTM |
LGTM |
As title.