Skip to content

Commit

Permalink
Fix null descriptions; classifications (#105)
Browse files Browse the repository at this point in the history
* Fix null descriptions; classifications
* Make message a string instead of an array

Signed-off-by: Juan Manuel Leflet Estrada <jleflete@redhat.com>
  • Loading branch information
jmle authored Dec 5, 2023
1 parent 392e3f4 commit def4ee9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/conversion/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ func ConvertWindupRulesetToAnalyzer(ruleset windup.Ruleset) []map[string]interfa
if perform["effort"] != nil {
rule["effort"] = perform["effort"]
}
rule["description"] = perform["description"]
if perform["description"] != nil {
rule["description"] = perform["description"]
}
} else {
continue
}
Expand Down Expand Up @@ -805,14 +807,13 @@ func convertWindupPerformToAnalyzer(perform windup.Iteration, where map[string]s
if classification.Tag != nil {
tags = append(tags, classification.Tag...)
}
description := ""
if classification.Title != "" {
tags = append(tags, classification.Title)
description = classification.Title
}

tags = append(tags, classification.Title)
// we know title will never be nil (see https://github.com/windup/windup/blob/master/config-xml/schema/windup-jboss-ruleset.xsd#L397)
ret["description"] = classification.Title

if classification.Description != nil {
// combine title + description
ret["description"] = fmt.Sprintf("%s\n%s", description, strings.Join(classification.Description, "\n"))
ret["message"] = strings.Join(classification.Description, "\n")
}
if classification.Link != nil {
for _, lnk := range classification.Link {
Expand Down

0 comments on commit def4ee9

Please sign in to comment.