Skip to content

Commit

Permalink
remove icon when no issues found
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Aug 28, 2024
1 parent b5300e4 commit acc7450
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<pre>24 Security Issues:&Tab;24 SCA<br><br><div style="display: flex; align-items: center; text-align: center">🔴 3 High</div><br><div style="display: flex; align-items: center; text-align: center">🟠 1 Medium</div><br><div style="display: flex; align-items: center; text-align: center">⚪️ 20 Unknown</div><br><a href="https://test-platform-url/ui/scans-list/builds-scans">See the results of the scan in JFrog</a></pre>
<pre>24 Security Issues:&Tab;24 SCA<br><br><div style="display: flex; align-items: center; text-align: center">🔴 3 High</div><br><div style="display: flex; align-items: center; text-align: center">🟠 1 Medium</div><br><div style="display: flex; align-items: center; text-align: center">⚪️ 20 Unknown</div><br><a href="https://test-url">See the results of the scan in JFrog</a></pre>
2 changes: 1 addition & 1 deletion tests/testdata/other/jobSummary/no_violations.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<pre><div style="display: flex; align-items: center; text-align: center"><img alt="passed.svg" src=https://raw.githubusercontent.com/attiasas/jfrog-cli-security/improve_job_summary/resources/statusIcons/passed.svg> No violations found</div></pre>
<pre>No violations found</pre>
2 changes: 1 addition & 1 deletion tests/testdata/other/jobSummary/no_vulnerabilities.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<pre><div style="display: flex; align-items: center; text-align: center"><img alt="passed.svg" src=https://raw.githubusercontent.com/attiasas/jfrog-cli-security/improve_job_summary/resources/statusIcons/passed.svg> No security issues found</div></pre>
<pre>No security issues found</pre>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<pre>watches: watch1, watch2</pre><br><pre>23 Policy Violations:&Tab;17 Security&Tab;2 Operational&Tab;1 License&Tab;3 Secrets<br><br><div style="display: flex; align-items: center; text-align: center">❗️ 8 Critical (2 Not Applicable)</div><br><div style="display: flex; align-items: center; text-align: center">🔴 6 High</div><br><div style="display: flex; align-items: center; text-align: center">🟠 3 Medium</div><br><div style="display: flex; align-items: center; text-align: center">🟡 5 Low (3 Not Applicable)</div><br><div style="display: flex; align-items: center; text-align: center">⚪️ 1 Unknown</div></pre>
<pre>watch: watch1</pre><br><pre>23 Policy Violations:&Tab;17 Security&Tab;2 Operational&Tab;1 License&Tab;3 Secrets<br><br><div style="display: flex; align-items: center; text-align: center">❗️ 8 Critical (2 Not Applicable)</div><br><div style="display: flex; align-items: center; text-align: center">🔴 6 High</div><br><div style="display: flex; align-items: center; text-align: center">🟠 3 Medium</div><br><div style="display: flex; align-items: center; text-align: center">🟡 5 Low (3 Not Applicable)</div><br><div style="display: flex; align-items: center; text-align: center">⚪️ 1 Unknown</div></pre>
2 changes: 1 addition & 1 deletion utils/securityJobSummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func getNoIssuesMarkdown(violations bool) (markdown string) {
if violations {
noIssuesStr = "No violations found"
}
return getCenteredSvgWithText(getStatusIcon(false), noIssuesStr)
return noIssuesStr
}

func getCenteredSvgWithText(svg, text string) (markdown string) {
Expand Down
5 changes: 2 additions & 3 deletions utils/securityJobSummary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ func TestGenerateJobSummaryMarkdown(t *testing.T) {
Target: filepath.Join(wd, "image.tar"),
Vulnerabilities: &formats.ScanResultSummary{
ScaResults: &formats.ScaScanResultSummary{
ScanIds: []string{TestScaScanId},
MoreInfoUrls: []string{"https://test-url"},
ScanIds: []string{TestScaScanId},
Security: formats.ResultSummary{
"Critical": map[string]int{jasutils.Applicable.String(): 2, jasutils.NotApplicable.String(): 2, jasutils.NotCovered.String(): 3, jasutils.ApplicabilityUndetermined.String(): 1},
"High": map[string]int{jasutils.Applicable.String(): 2, jasutils.ApplicabilityUndetermined.String(): 3},
Expand All @@ -183,7 +182,7 @@ func TestGenerateJobSummaryMarkdown(t *testing.T) {
Scans: []formats.ScanSummary{{
Target: filepath.Join(wd, "image.tar"),
Violations: &formats.ScanViolationsSummary{
Watches: []string{"watch1", "watch2"},
Watches: []string{"watch1"},
ScanResultSummary: formats.ScanResultSummary{
ScaResults: &formats.ScaScanResultSummary{
ScanIds: []string{TestScaScanId},
Expand Down

0 comments on commit acc7450

Please sign in to comment.