From b7039959174fd6c99544566674be54356bf7dd92 Mon Sep 17 00:00:00 2001 From: Akramdzhon Azamov <900658008.akram@gmail.com> Date: Wed, 19 Jul 2023 14:55:17 +0500 Subject: [PATCH] feat(detectExecuteScan): deprecating parameter scanOnChanges (#4473) Co-authored-by: sumeet patil --- cmd/detectExecuteScan.go | 8 +------- cmd/detectExecuteScan_test.go | 9 +++------ resources/metadata/detectExecuteScan.yaml | 1 + 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/cmd/detectExecuteScan.go b/cmd/detectExecuteScan.go index e80e72491..b775faf23 100644 --- a/cmd/detectExecuteScan.go +++ b/cmd/detectExecuteScan.go @@ -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 diff --git a/cmd/detectExecuteScan_test.go b/cmd/detectExecuteScan_test.go index fe24e60dd..832e6ba5d 100644 --- a/cmd/detectExecuteScan_test.go +++ b/cmd/detectExecuteScan_test.go @@ -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'\"", diff --git a/resources/metadata/detectExecuteScan.yaml b/resources/metadata/detectExecuteScan.yaml index 25cf4cf10..01163a838 100644 --- a/resources/metadata/detectExecuteScan.yaml +++ b/resources/metadata/detectExecuteScan.yaml @@ -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