Skip to content

Commit e87b514

Browse files
Fix issue with failing pipelines because of ignored alerts (#4518)
* Temporary commented adition of ignored alerts to the all alerts * Removed adding from other places
1 parent 0ba4c22 commit e87b514

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cmd/whitesourceExecuteScan.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,12 @@ func checkPolicyViolations(ctx context.Context, config *ScanOptions, scan *ws.Sc
513513
return piperutils.Path{}, fmt.Errorf("failed to retrieve project policy alerts from WhiteSource: %w", err)
514514
}
515515

516-
ignoredAlerts, err := sys.GetProjectIgnoredAlertsByType(project.Token, "REJECTED_BY_POLICY_RESOURCE")
516+
// TODO add ignored alerts to list of all alerts
517+
_, err = sys.GetProjectIgnoredAlertsByType(project.Token, "REJECTED_BY_POLICY_RESOURCE")
517518
if err != nil {
518519
return piperutils.Path{}, fmt.Errorf("failed to retrieve project policy ignored alerts from WhiteSource: %w", err)
519520
}
520-
521-
alerts = append(alerts, ignoredAlerts...)
521+
// alerts = append(alerts, ignoredAlerts...)
522522

523523
policyViolationCount += len(alerts)
524524
allAlerts = append(allAlerts, alerts...)
@@ -811,12 +811,12 @@ func checkProjectSecurityViolations(config *ScanOptions, cvssSeverityLimit float
811811
return 0, alerts, assessedAlerts, fmt.Errorf("failed to retrieve project alerts from WhiteSource: %w", err)
812812
}
813813

814-
ignoredAlerts, err := sys.GetProjectIgnoredAlertsByType(project.Token, "SECURITY_VULNERABILITY")
814+
// TODO add ignored alerts to list of all alerts
815+
_, err = sys.GetProjectIgnoredAlertsByType(project.Token, "SECURITY_VULNERABILITY")
815816
if err != nil {
816817
return 0, alerts, assessedAlerts, fmt.Errorf("failed to retrieve project ignored alerts from WhiteSource: %w", err)
817818
}
818-
819-
alerts = append(alerts, ignoredAlerts...)
819+
// alerts = append(alerts, ignoredAlerts...)
820820

821821
// filter alerts related to existing assessments
822822
filteredAlerts := []ws.Alert{}
@@ -904,12 +904,12 @@ func aggregateVersionWideVulnerabilities(config *ScanOptions, utils whitesourceU
904904
return errors.Wrapf(err, "failed to get project alerts by type")
905905
}
906906

907-
ignoredAlerts, err := sys.GetProjectIgnoredAlertsByType(project.Token, "SECURITY_VULNERABILITY")
907+
// TODO add ignored alerts to list of all alerts
908+
_, err = sys.GetProjectIgnoredAlertsByType(project.Token, "SECURITY_VULNERABILITY")
908909
if err != nil {
909910
return errors.Wrapf(err, "failed to get project ignored alerts by type")
910911
}
911-
912-
alerts = append(alerts, ignoredAlerts...)
912+
// alerts = append(alerts, ignoredAlerts...)
913913

914914
log.Entry().Infof("Found project: %s with %v vulnerabilities.", project.Name, len(alerts))
915915
versionWideAlerts = append(versionWideAlerts, alerts...)

0 commit comments

Comments
 (0)