From b33b31f3075fb697bf15c4c3cb4655ba9cc5e7cb Mon Sep 17 00:00:00 2001 From: attiasas Date: Mon, 30 Sep 2024 16:48:39 +0300 Subject: [PATCH] cr review finish --- utils/results/output/securityJobSummary.go | 6 +----- utils/xsc/analyticsmetrics_test.go | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/utils/results/output/securityJobSummary.go b/utils/results/output/securityJobSummary.go index d29b0bd8..f7fa973e 100644 --- a/utils/results/output/securityJobSummary.go +++ b/utils/results/output/securityJobSummary.go @@ -190,12 +190,8 @@ func RecordSarifOutput(cmdResults *results.SecurityCommandResults, includeVulner if err != nil || manager == nil { return } - if !cmdResults.EntitledForJas { + if !cmdResults.EntitledForJas || !commandsummary.StaticMarkdownConfig.IsExtendedSummary() { // If no JAS no GHAS - return - } - extended := true - if !extended && !commandsummary.StaticMarkdownConfig.IsExtendedSummary() { log.Info("Results can be uploaded to Github security tab automatically by upgrading your JFrog subscription.") return } diff --git a/utils/xsc/analyticsmetrics_test.go b/utils/xsc/analyticsmetrics_test.go index 1af8a864..eb723a4a 100644 --- a/utils/xsc/analyticsmetrics_test.go +++ b/utils/xsc/analyticsmetrics_test.go @@ -106,6 +106,9 @@ func TestAnalyticsMetricsService_createAuditResultsFromXscAnalyticsBasicGeneralE } } +// Create a dummy content for general event. 1 SCA scan with 1 vulnerability +// withJas - Add 2 JAS results for each scan type. +// withErr - Add an error to the results. func getDummyContentForGeneralEvent(withJas, withErr bool) *results.SecurityCommandResults { vulnerabilities := []services.Vulnerability{{IssueId: "XRAY-ID", Severity: "medium", Cves: []services.Cve{{Id: "CVE-123"}}, Components: map[string]services.Component{"issueId_2_direct_dependency": {}}}}