Skip to content

Commit

Permalink
temporarily remove scan start time from jira consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Oct 11, 2024
1 parent fcdf7cb commit 53a55f1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/jira/jira/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var (
Type: jira.IssueType{
Name: "Vulnerability",
},
Description: "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan started at: 2024-10-10T20:06:33Z with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before, first found on 2024-10-10T20:06:33Z\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n",
Description: "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n",
Summary: "bar1:baz2 Unit Test Title",
Components: []*jira.Component{
{Name: "c1"},
Expand Down
2 changes: 0 additions & 2 deletions pkg/jira/jira/apiutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ func makeDescription(draconResult document.Document, template string) string {
},
},
templating.EnrichedIssueWithToolName(draconResult.ToolName),
templating.EnrichedIssueWithScanStartTime(draconResult.ScanStartTime),
templating.EnrichedIssueWithScanID(draconResult.ScanID),
templating.EnrichedIssueWithConfidenceText(draconResult.ConfidenceText),
templating.EnrichedIssueWithCount(uint(count)),
templating.EnrichedIssueWithFirstFound(draconResult.FirstFound),
templating.EnrichedIssueWithSeverityText(draconResult.SeverityText),
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/jira/jira/apiutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestMakeCustomField(t *testing.T) {

func TestMakeDescription(t *testing.T) {
res := makeDescription(sampleResult, "")
exp := "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan started at: 2024-10-10T20:06:33Z with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before, first found on 2024-10-10T20:06:33Z\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n"
exp := "spotbugs detected 'Unit Test Title' at //foo1/bar1:baz2 during scan with id babbb83-4627-41c6-8ba0-70ee866290e9.\nConfidence: Info\nThis issue has been detected 2 times before\nOriginal Description is: 'this is a test description'\nspotbugs reported severity as Info\nSmithy enrichers added the following annotations:\nfoo:bar\nfoobar:baz\n\n"
require.Equal(t, res, exp)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/jira/jira/issueTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{.ToolName}} detected '{{.RawIssue.Title}}' at {{.RawIssue.Target}} during scan started at: {{.ScanStartTime}} with id {{.ScanID}}.
{{.ToolName}} detected '{{.RawIssue.Title}}' at {{.RawIssue.Target}} during scan with id {{.ScanID}}.
Confidence: {{.ConfidenceText}}
{{ if gt .Count 0 }}This issue has been detected {{.Count}} times before, first found on {{.FirstFound}}{{ end }}
{{ if gt .Count 0 }}This issue has been detected {{.Count}} times before{{ end }}
Original Description is: '{{.RawIssue.Description}}'
{{.ToolName}} reported severity as {{.SeverityText}}
Smithy enrichers added the following annotations:
Expand Down

0 comments on commit 53a55f1

Please sign in to comment.