Compare commits
2 commits
master
...
neilalexan
Author | SHA1 | Date | |
---|---|---|---|
1f497d857f | |||
3b47a279ca |
1
changelog.d/55.feature
Normal file
1
changelog.d/55.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add Dendrite and Conduit labels when detected in the `server_version` field of the rageshake payload
|
24
submit.go
24
submit.go
|
@ -695,14 +695,30 @@ func buildGenericIssueRequest(p payload, listingURL string) (title, body string)
|
|||
return
|
||||
}
|
||||
|
||||
func getAdditionalLabels(p payload) []string {
|
||||
labels := []string{}
|
||||
if serverVersion, ok := p.Data["server_version"]; ok {
|
||||
// TODO: It seems only Element Android sends server_version right now and
|
||||
// that Element iOS doesn't, so we should do something about that.
|
||||
switch {
|
||||
case strings.Contains(serverVersion, "Dendrite"):
|
||||
labels = append(labels, "Dendrite")
|
||||
case strings.Contains(serverVersion, "Conduit"):
|
||||
labels = append(labels, "Conduit")
|
||||
}
|
||||
}
|
||||
return labels
|
||||
}
|
||||
|
||||
func buildGithubIssueRequest(p payload, listingURL string) github.IssueRequest {
|
||||
title, body := buildGenericIssueRequest(p, listingURL)
|
||||
|
||||
labels := p.Labels
|
||||
labels := append(p.Labels, getAdditionalLabels(p)...)
|
||||
// go-github doesn't like nils
|
||||
if labels == nil {
|
||||
labels = []string{}
|
||||
}
|
||||
|
||||
return github.IssueRequest{
|
||||
Title: &title,
|
||||
Body: &body,
|
||||
|
@ -713,15 +729,11 @@ func buildGithubIssueRequest(p payload, listingURL string) github.IssueRequest {
|
|||
func buildGitlabIssueRequest(p payload, listingURL string, labels []string, confidential bool) *gitlab.CreateIssueOptions {
|
||||
title, body := buildGenericIssueRequest(p, listingURL)
|
||||
|
||||
if p.Labels != nil {
|
||||
labels = append(labels, p.Labels...)
|
||||
}
|
||||
|
||||
return &gitlab.CreateIssueOptions{
|
||||
Title: &title,
|
||||
Description: &body,
|
||||
Confidential: &confidential,
|
||||
Labels: labels,
|
||||
Labels: append(p.Labels, getAdditionalLabels(p)...),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue