|
|
|
@ -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)...),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|