1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-02-21 19:48:53 +02:00

feat(detectExecuteScan): deprecating parameter scanOnChanges (#4473)

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
This commit is contained in:
Akramdzhon Azamov 2023-07-19 14:55:17 +05:00 committed by GitHub
parent 994e87479d
commit b703995917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View File

@ -287,8 +287,7 @@ func exitCodeMapping(exitCodeKey int) string {
func getDetectScript(config detectExecuteScanOptions, utils detectUtils) error {
if config.ScanOnChanges {
log.Entry().Infof("Using Detect Rescan script")
return utils.DownloadFile("https://raw.githubusercontent.com/blackducksoftware/detect_rescan/master/detect_rescan.sh", "detect.sh", nil, nil)
log.Entry().Infof("The scanOnChanges option is deprecated")
}
log.Entry().Infof("Downloading Detect7")
@ -317,11 +316,6 @@ func addDetectArgs(args []string, config detectExecuteScanOptions, utils detectU
args = append(args, fmt.Sprintf("--detect.excluded.directories=%s", strings.Join(config.ExcludedDirectories, ",")))
}
if config.ScanOnChanges {
args = append(args, "--report")
config.Unmap = false
}
if config.MinScanInterval > 0 {
//Unmap doesnt work well with min-scan-interval and should be removed
config.Unmap = false

View File

@ -555,11 +555,10 @@ func TestAddDetectArgs(t *testing.T) {
ExcludedPackageManagers: []string{"npm", "NUGET"},
MavenExcludedScopes: []string{"TEST", "compile"},
DetectTools: []string{"DETECTOR"},
ScanOnChanges: true,
},
expected: []string{
"--testProp1=1",
"--report",
"--detect.project.codelocation.unmap=true",
"--blackduck.url=https://server.url",
"--blackduck.api.token=apiToken",
"\"--detect.project.name='testName'\"",
@ -594,11 +593,10 @@ func TestAddDetectArgs(t *testing.T) {
ExcludedPackageManagers: []string{"npm", "NUGET"},
MavenExcludedScopes: []string{"TEST", "compile"},
DetectTools: []string{"DETECTOR"},
ScanOnChanges: true,
},
expected: []string{
"--testProp1=1",
"--report",
"--detect.project.codelocation.unmap=true",
"--blackduck.url=https://server.url",
"--blackduck.api.token=apiToken",
"\"--detect.project.name='testName'\"",
@ -634,12 +632,11 @@ func TestAddDetectArgs(t *testing.T) {
ExcludedPackageManagers: []string{"npm", "NUGET"},
MavenExcludedScopes: []string{"TEST", "compile"},
DetectTools: []string{"DETECTOR"},
ScanOnChanges: true,
},
expected: []string{
"--testProp1=1",
"--report",
"--scan=1",
"--detect.project.codelocation.unmap=true",
"--blackduck.url=https://server.url",
"--blackduck.api.token=apiToken",
"\"--detect.project.name='testName'\"",

View File

@ -296,6 +296,7 @@ spec:
- PARAMETERS
- STAGES
- STEPS
deprecated: true
- name: customEnvironmentVariables
description:
"A list of environment variables which can be set to prepare the environment to run a BlackDuck scan. This includes a list of environment variables defined by