Commit 60aae797 authored by can eldem's avatar can eldem

Use scan information in issue template

parent ccb66e2f
......@@ -60,3 +60,23 @@
</details>
<% end %>
<% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %>
### <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %>
<% if vulnerability&.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %>
<% if vulnerability&.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %>
<% if vulnerability&.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %>
<% if vulnerability&.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %>
<% end %>
---
title: Include additional information related from scan in issue template
merge_request: 44620
author:
type: added
......@@ -21,7 +21,7 @@ RSpec.describe Gitlab::Vulnerabilities::BaseVulnerability do
location: { file: 'main.rb', start_line: 14, blob_path: '/bar/foo/main.rb#14' },
solution: 'upgrade dependencies',
scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { external_id: 'gemnasium', name: 'Gemnasium' }
scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
}
end
......
......@@ -86,7 +86,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
url: 'https;//example.com/blog-post'
}, {
url: 'https://example.com/another-link'
}]
}],
scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
}
end
......@@ -115,6 +117,15 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
* [Awesome-security blog post](https;//example.com/blog-post)
* https://example.com/another-link
### Scanner:
* Name: Gemnasium
* Type: dependency_scanning
* Status: success
* Start Time: placeholder
* End Time: placeholder
DESC
end
......@@ -132,7 +143,9 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
line: '15',
cve: '818bf5dacb291e15d9e6dc3c5ac32178:PREDICTABLE_RANDOM',
title: 'Predictable pseudorandom number generator',
tool: 'find_sec_bugs'
tool: 'find_sec_bugs',
scanner: { external_id: 'gemnasium', name: 'Gemnasium' },
scan: { type: 'dependency_scanning', status: 'success', start_time: 'placeholder', end_time: 'placeholder' }
}
end
......@@ -150,6 +163,17 @@ RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
### Solution:
Please do something!
### Scanner:
* Name: Gemnasium
* Type: dependency_scanning
* Status: success
* Start Time: placeholder
* End Time: placeholder
DESC
end
......
......@@ -9808,6 +9808,9 @@ msgstr ""
msgid "Encountered an error while rendering: %{err}"
msgstr ""
msgid "End Time"
msgstr ""
msgid "Ends at (UTC)"
msgstr ""
......@@ -22554,6 +22557,9 @@ msgstr ""
msgid "Saving project."
msgstr ""
msgid "Scanner"
msgstr ""
msgid "Schedule a new pipeline"
msgstr ""
......@@ -24643,6 +24649,9 @@ msgstr ""
msgid "Start Date"
msgstr ""
msgid "Start Time"
msgstr ""
msgid "Start Web Terminal"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment