diff --git a/pkg/reporting/pullRequestReport.go b/pkg/reporting/pullRequestReport.go index d40f0e783a..1b643d94ff 100644 --- a/pkg/reporting/pullRequestReport.go +++ b/pkg/reporting/pullRequestReport.go @@ -94,12 +94,12 @@ type OtherViolation struct { } const rapidReportMdTemplate = ` -## {{if .Success}}:heavy_check_mark: OSS related checks passed successfully - ### :clipboard: OSS related checks executed by Black Duck - rapid scan passed successfully. -

RAPID SCAN

+ {{if .Success}}:heavy_check_mark: **OSS related checks passed successfully** + :clipboard: OSS related checks executed by Black Duck - rapid scan passed successfully. +

RAPID SCAN

-{{else}} :x: OSS related checks failed - ### :clipboard: Policies violated by added OSS components +{{else}} :x: **OSS related checks failed** + :clipboard: Policies violated by added OSS components {{range $s := .MainTableHeaders -}}{{- end}} {{range $s := .MainTableValues -}}{{range $s1 := $s }}{{- end}} @@ -109,8 +109,8 @@ const rapidReportMdTemplate = ` {{range $index := .VulnerabilitiesTable -}}
{{$len := len $index.Values}} -{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

-{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}} +{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

+{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}}
{{$s}}
{{$s1}}
@@ -125,8 +125,8 @@ const rapidReportMdTemplate = ` {{range $index := .LicensesTable -}}
{{$len := len $index.Values}} -{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

-{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}} +{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

+{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}}
Vulnerability IDVulnerability ScoreComponent Name
@@ -139,8 +139,8 @@ const rapidReportMdTemplate = ` {{range $index := .OtherViolationsTable -}}
{{$len := len $index.Values}} -{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

-{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}} +{{if le $len 1}}

{{$len}} Policy Violation of {{$index.PolicyViolationName}}

+{{else}}

{{$len}} Policy Violations of {{$index.PolicyViolationName}}

{{end}}
License NameComponent Name
diff --git a/pkg/reporting/pullRequestReport_test.go b/pkg/reporting/pullRequestReport_test.go index 6195444e27..02cf7e7cd4 100644 --- a/pkg/reporting/pullRequestReport_test.go +++ b/pkg/reporting/pullRequestReport_test.go @@ -113,34 +113,34 @@ func TestCreateMarkdownReport(t *testing.T) { ErrorMessage: "", }, }, - expectedReport: "\n## :x: OSS related checks failed\n ### :clipboard: Policies violated by added OSS components\n " + + expectedReport: "\n :x: **OSS related checks failed**\n :clipboard: Policies violated by added OSS components\n " + "
Component Name
\n \n \n
Component nameHigh Vulnerability Security IssueOutdatedFOSSLibraries" + "Test High Severity Vuln Filter
Chalk 1.1.3 (npmjs:chalk/1.1.3)010
Lodash " + "4.17.10 (npmjs:lodash/4.17.10)313
qs - QS Querystring 5.2.1 " + - "(npmjs:qs/5.2.1)100
\n\n
\n\n

4 Policy " + - "Violations of High Vulnerability Security Issue

\n
\n\t\n\t\t\n
Vulnerability IDVulnerability" + + "(npmjs:qs/5.2.1)100
\n\n
\n\n

4 Policy " + + "Violations of High Vulnerability Security Issue

\n
\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t
Vulnerability IDVulnerability" + " ScoreComponent Name
CVE-2019-10744 9.1 CRITICALLodash 4.17.10 " + "(npmjs:lodash/4.17.10)
" + "CVE-2017-1000048 7.5 HIGHqs - QS Querystring 5.2.1 (npmjs:qs/5.2.1)
" + " CVE-2020-8203 7.4 HIGHLodash " + "4.17.10 (npmjs:lodash/4.17.10)
" + - "BDSA-2019-3842 7.1 HIGHLodash 4.17.10 (npmjs:lodash/4.17.10)
\n
\n
\n\n

" + - "3 Policy Violations of Test High Severity Vuln Filter

\n
\n\t\n\t\t\n\t\t\t\n\t\t
Vulnerability IDVulnerability " + + "BDSA-2019-3842 7.1 HIGHLodash 4.17.10 (npmjs:lodash/4.17.10)
\n
\n
\n\n

" + + "3 Policy Violations of Test High Severity Vuln Filter

\n
\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t
Vulnerability IDVulnerability " + "ScoreComponent Name
" + "CVE-2019-10744 9.1 CRITICALLodash 4.17.10 (npmjs:lodash/4.17.10)
" + " CVE-2020-8203 7.4 " + "HIGHLodash 4.17.10 (npmjs:lodash/4.17.10)
" + - "BDSA-2019-3842 7.1 HIGHLodash 4.17.10 (npmjs:lodash/4.17.10)
\n
\n
\n\n

" + - "2 Policy Violations of OutdatedFOSSLibraries

\n
\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t
Component Name
Chalk 1.1.3 " + + "BDSA-2019-3842 7.1 HIGHLodash 4.17.10 (npmjs:lodash/4.17.10)
\n
\n
\n\n

" + + "2 Policy Violations of OutdatedFOSSLibraries

\n
\n\t\n\t\t\n\t\t\n\t\t\n\t\t
Component Name
Chalk 1.1.3 " + "(npmjs:chalk/1.1.3)
Lodash 4.17.10 (npmjs:lodash/4.17.10)
\n
\n\n", }, { testName: "No vulnerabilities && successful build", components: &Components{}, - expectedReport: "\n## :heavy_check_mark: OSS related checks passed successfully\n ### :clipboard: OSS related checks executed by Black Duck " + + expectedReport: "\n :heavy_check_mark: **OSS related checks passed successfully**\n :clipboard: OSS related checks executed by Black Duck " + "- rapid scan passed successfully.\n" + - " " + - "

RAPID SCAN

\n\n\n", + "

" + + "RAPID SCAN

\n\n\n", }, }