Skip to content

Commit a8f955f

Browse files
authored
✨ Update Issue Description (#773)
Issue Description field might be too short to provide enough information about fixing the issue, appending incident Message to it to make it more useful. This is more a workaround/quickfix, long-term solution is explained in ticket below and at konveyor/analyzer-lsp#452 Related to: https://issues.redhat.com/browse/MTA-4421 and Hub version of konveyor/kantra#341 Signed-off-by: Marek Aufart <[email protected]>
1 parent 88d11f8 commit a8f955f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

api/analysis.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,8 @@ func (h AnalysisHandler) AppIssueReports(ctx *gin.Context) {
11091109
resources := []*IssueReport{}
11101110
type M struct {
11111111
model.Issue
1112-
Files int
1112+
Files int
1113+
Message string
11131114
}
11141115
id := h.pk(ctx)
11151116
err := h.DB(ctx).First(&model.Application{}, id).Error
@@ -1164,6 +1165,7 @@ func (h AnalysisHandler) AppIssueReports(ctx *gin.Context) {
11641165
"i.Effort",
11651166
"i.Labels",
11661167
"i.Links",
1168+
"n.Message",
11671169
"COUNT(distinct n.File) Files")
11681170
q = q.Table("Issue i,")
11691171
q = q.Joins("Incident n")
@@ -1201,8 +1203,10 @@ func (h AnalysisHandler) AppIssueReports(ctx *gin.Context) {
12011203
for i := range list {
12021204
m := list[i]
12031205
r := &IssueReport{
1204-
Files: m.Files,
1205-
Description: m.Description,
1206+
Files: m.Files,
1207+
// Append Incident Message to Description to provide more information on Issue detail
1208+
// (workaround until Analyzer output Violation struct gets updated to provide better structured data)
1209+
Description: fmt.Sprintf("%s\n\n%s", m.Description, m.Message),
12061210
Category: m.Category,
12071211
RuleSet: m.RuleSet,
12081212
Rule: m.Rule,

0 commit comments

Comments
 (0)