From 276844e6a29f51a908834efa50421f6efce6344b Mon Sep 17 00:00:00 2001 From: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com> Date: Wed, 30 Mar 2022 12:20:51 +0200 Subject: [PATCH] fix(optimization): expose parameters to general section (#3680) --- cmd/checkmarxExecuteScan_generated.go | 4 ++-- cmd/detectExecuteScan_generated.go | 8 ++++---- cmd/fortifyExecuteScan_generated.go | 4 ++-- cmd/whitesourceExecuteScan_generated.go | 6 +++--- resources/metadata/checkmarxExecuteScan.yaml | 7 +++++-- resources/metadata/detectExecuteScan.yaml | 9 +++++++-- resources/metadata/fortifyExecuteScan.yaml | 7 +++++-- resources/metadata/whitesourceExecuteScan.yaml | 3 +++ 8 files changed, 31 insertions(+), 17 deletions(-) diff --git a/cmd/checkmarxExecuteScan_generated.go b/cmd/checkmarxExecuteScan_generated.go index cdc5db59b..f4da3da4d 100644 --- a/cmd/checkmarxExecuteScan_generated.go +++ b/cmd/checkmarxExecuteScan_generated.go @@ -355,7 +355,7 @@ func addCheckmarxExecuteScanFlags(cmd *cobra.Command, stepConfig *checkmarxExecu cmd.Flags().StringVar(&stepConfig.VulnerabilityThresholdResult, "vulnerabilityThresholdResult", `FAILURE`, "The result of the build in case thresholds are enabled and exceeded") cmd.Flags().StringVar(&stepConfig.VulnerabilityThresholdUnit, "vulnerabilityThresholdUnit", `percentage`, "The unit for the threshold to apply.") cmd.Flags().BoolVar(&stepConfig.IsOptimizedAndScheduled, "isOptimizedAndScheduled", false, "Whether the pipeline runs in optimized mode and the current execution is a scheduled one") - cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Whether the step creates a GitHub issue containing the scan results in the originating repo. Since optimized pipelines are headless the creation is implicitly activated for schedules runs.") + cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Activate creation of a result issue in GitHub.") cmd.MarkFlagRequired("password") cmd.MarkFlagRequired("projectName") @@ -699,7 +699,7 @@ func checkmarxExecuteScanMetadata() config.StepData { Param: "custom/optimizedAndScheduled", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "bool", Mandatory: false, Aliases: []config.Alias{}, diff --git a/cmd/detectExecuteScan_generated.go b/cmd/detectExecuteScan_generated.go index 5233d16b1..840a1fcd4 100644 --- a/cmd/detectExecuteScan_generated.go +++ b/cmd/detectExecuteScan_generated.go @@ -268,7 +268,7 @@ func addDetectExecuteScanFlags(cmd *cobra.Command, stepConfig *detectExecuteScan cmd.Flags().BoolVar(&stepConfig.ScanOnChanges, "scanOnChanges", false, "This flag determines if the scan is submitted to the server. If set to true, then the scan request is submitted to the server only when changes are detected in the Open Source Bill of Materials If the flag is set to false, then the scan request is submitted to server regardless of any changes. For more details please refer to the [documentation](https://github.com/blackducksoftware/detect_rescan/blob/master/README.md)") cmd.Flags().StringSliceVar(&stepConfig.CustomEnvironmentVariables, "customEnvironmentVariables", []string{}, "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 Synopsys. The full list can be found [here](https://synopsys.atlassian.net/wiki/spaces/IA/pages/1562214619/Shell+Script+Reference+6.9.0) This list affects the detect script downloaded while running the scan. By default detect7.sh will be used. To continue using detect6, please use DETECT_LATEST_RELEASE_VERSION and set it to a valid value defined [here](https://community.synopsys.com/s/document-item?bundleId=integrations-detect&topicId=releasenotes.html&_LANG=enus)") cmd.Flags().StringVar(&stepConfig.GithubToken, "githubToken", os.Getenv("PIPER_githubToken"), "GitHub personal access token as per https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line") - cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Whether the step creates a GitHub issue containing the scan results in the originating repo. Since optimized pipelines are headless the creation is implicitly activated for scheduled runs.") + cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Activate creation of a result issue in GitHub.") cmd.Flags().StringVar(&stepConfig.GithubAPIURL, "githubApiUrl", `https://api.github.com`, "Set the GitHub API URL.") cmd.Flags().StringVar(&stepConfig.Owner, "owner", os.Getenv("PIPER_owner"), "Set the GitHub organization.") cmd.Flags().StringVar(&stepConfig.Repository, "repository", os.Getenv("PIPER_repository"), "Set the GitHub repository.") @@ -558,7 +558,7 @@ func detectExecuteScanMetadata() config.StepData { Param: "custom/optimizedAndScheduled", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "bool", Mandatory: false, Aliases: []config.Alias{}, @@ -581,7 +581,7 @@ func detectExecuteScanMetadata() config.StepData { Param: "github/owner", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "string", Mandatory: false, Aliases: []config.Alias{{Name: "githubOrg"}}, @@ -595,7 +595,7 @@ func detectExecuteScanMetadata() config.StepData { Param: "github/repository", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "string", Mandatory: false, Aliases: []config.Alias{{Name: "githubRepo"}}, diff --git a/cmd/fortifyExecuteScan_generated.go b/cmd/fortifyExecuteScan_generated.go index 56db958b2..24aabb4d7 100644 --- a/cmd/fortifyExecuteScan_generated.go +++ b/cmd/fortifyExecuteScan_generated.go @@ -351,7 +351,7 @@ func addFortifyExecuteScanFlags(cmd *cobra.Command, stepConfig *fortifyExecuteSc cmd.Flags().StringVar(&stepConfig.M2Path, "m2Path", os.Getenv("PIPER_m2Path"), "Path to the location of the local repository that should be used.") cmd.Flags().BoolVar(&stepConfig.VerifyOnly, "verifyOnly", false, "Whether the step shall only apply verification checks or whether it does a full scan and check cycle") cmd.Flags().BoolVar(&stepConfig.InstallArtifacts, "installArtifacts", false, "If enabled, it will install all artifacts to the local maven repository to make them available before running Fortify. This is required if any maven module has dependencies to other modules in the repository and they were not installed before.") - cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Whether the step creates a GitHub issue containing the scan results in the originating repo. Since optimized pipelines are headless the creation is implicitly activated for schedules runs.") + cmd.Flags().BoolVar(&stepConfig.CreateResultIssue, "createResultIssue", false, "Activate creation of a result issue in GitHub.") cmd.MarkFlagRequired("authToken") cmd.Flags().MarkDeprecated("pythonAdditionalPath", "this is deprecated") @@ -961,7 +961,7 @@ func fortifyExecuteScanMetadata() config.StepData { Param: "custom/optimizedAndScheduled", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "bool", Mandatory: false, Aliases: []config.Alias{}, diff --git a/cmd/whitesourceExecuteScan_generated.go b/cmd/whitesourceExecuteScan_generated.go index b8ac4981e..759044488 100644 --- a/cmd/whitesourceExecuteScan_generated.go +++ b/cmd/whitesourceExecuteScan_generated.go @@ -871,7 +871,7 @@ func whitesourceExecuteScanMetadata() config.StepData { Param: "custom/optimizedAndScheduled", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "bool", Mandatory: false, Aliases: []config.Alias{}, @@ -894,7 +894,7 @@ func whitesourceExecuteScanMetadata() config.StepData { Param: "github/owner", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "string", Mandatory: false, Aliases: []config.Alias{{Name: "githubOrg"}}, @@ -908,7 +908,7 @@ func whitesourceExecuteScanMetadata() config.StepData { Param: "github/repository", }, }, - Scope: []string{"PARAMETERS", "STAGES", "STEPS"}, + Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"}, Type: "string", Mandatory: false, Aliases: []config.Alias{{Name: "githubRepo"}}, diff --git a/resources/metadata/checkmarxExecuteScan.yaml b/resources/metadata/checkmarxExecuteScan.yaml index eea079d89..980a0d799 100644 --- a/resources/metadata/checkmarxExecuteScan.yaml +++ b/resources/metadata/checkmarxExecuteScan.yaml @@ -306,12 +306,15 @@ spec: - PARAMETERS - name: createResultIssue type: bool - description: "Whether the step creates a GitHub issue containing the scan results in the originating repo. - Since optimized pipelines are headless the creation is implicitly activated for schedules runs." + description: Activate creation of a result issue in GitHub. + longDescription: | + Whether the step creates a GitHub issue containing the scan results in the originating repo. + Since optimized pipelines are headless the creation is implicitly activated for scheduled runs. resourceRef: - name: commonPipelineEnvironment param: custom/optimizedAndScheduled scope: + - GENERAL - PARAMETERS - STAGES - STEPS diff --git a/resources/metadata/detectExecuteScan.yaml b/resources/metadata/detectExecuteScan.yaml index 0b2e2beb1..6c682dc9a 100644 --- a/resources/metadata/detectExecuteScan.yaml +++ b/resources/metadata/detectExecuteScan.yaml @@ -324,12 +324,15 @@ spec: name: githubVaultSecretName - name: createResultIssue type: bool - description: "Whether the step creates a GitHub issue containing the scan results in the originating repo. - Since optimized pipelines are headless the creation is implicitly activated for scheduled runs." + description: Activate creation of a result issue in GitHub. + longDescription: | + Whether the step creates a GitHub issue containing the scan results in the originating repo. + Since optimized pipelines are headless the creation is implicitly activated for scheduled runs. resourceRef: - name: commonPipelineEnvironment param: custom/optimizedAndScheduled scope: + - GENERAL - PARAMETERS - STAGES - STEPS @@ -351,6 +354,7 @@ spec: - name: commonPipelineEnvironment param: github/owner scope: + - GENERAL - PARAMETERS - STAGES - STEPS @@ -363,6 +367,7 @@ spec: - name: commonPipelineEnvironment param: github/repository scope: + - GENERAL - PARAMETERS - STAGES - STEPS diff --git a/resources/metadata/fortifyExecuteScan.yaml b/resources/metadata/fortifyExecuteScan.yaml index 04380a68f..dc0f054e0 100644 --- a/resources/metadata/fortifyExecuteScan.yaml +++ b/resources/metadata/fortifyExecuteScan.yaml @@ -630,12 +630,15 @@ spec: - PARAMETERS - name: createResultIssue type: bool - description: "Whether the step creates a GitHub issue containing the scan results in the originating repo. - Since optimized pipelines are headless the creation is implicitly activated for schedules runs." + description: Activate creation of a result issue in GitHub. + longDescription: | + Whether the step creates a GitHub issue containing the scan results in the originating repo. + Since optimized pipelines are headless the creation is implicitly activated for scheduled runs. resourceRef: - name: commonPipelineEnvironment param: custom/optimizedAndScheduled scope: + - GENERAL - PARAMETERS - STAGES - STEPS diff --git a/resources/metadata/whitesourceExecuteScan.yaml b/resources/metadata/whitesourceExecuteScan.yaml index ac7bf7eac..7b9c4f973 100644 --- a/resources/metadata/whitesourceExecuteScan.yaml +++ b/resources/metadata/whitesourceExecuteScan.yaml @@ -518,6 +518,7 @@ spec: - name: commonPipelineEnvironment param: custom/optimizedAndScheduled scope: + - GENERAL - PARAMETERS - STAGES - STEPS @@ -539,6 +540,7 @@ spec: - name: commonPipelineEnvironment param: github/owner scope: + - GENERAL - PARAMETERS - STAGES - STEPS @@ -551,6 +553,7 @@ spec: - name: commonPipelineEnvironment param: github/repository scope: + - GENERAL - PARAMETERS - STAGES - STEPS