Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporarily remove scan start time from jira consumer #417

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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