1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-16 05:16:08 +02:00

Step Parameter Alias deprecate key is ignored (#3158)

* Step Parameter Alias deprecate key is ignored
This commit is contained in:
Roland Stengel 2021-11-23 15:37:28 +01:00 committed by GitHub
parent 52053fbd47
commit 6320275f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 31 additions and 26 deletions

View File

@ -421,7 +421,7 @@ func checkmarxExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "checkmarxProject"}, {Name: "checkMarxProjectName"}},
Aliases: []config.Alias{{Name: "checkmarxProject"}, {Name: "checkMarxProjectName", Deprecated: true}},
Default: os.Getenv("PIPER_projectName"),
},
{
@ -457,7 +457,7 @@ func checkmarxExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "checkmarxGroupId"}, {Name: "groupId"}},
Aliases: []config.Alias{{Name: "checkmarxGroupId"}, {Name: "groupId", Deprecated: true}},
Default: os.Getenv("PIPER_teamId"),
},
{

View File

@ -252,7 +252,7 @@ func detectExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "blackduckToken"}, {Name: "detectToken"}, {Name: "apiToken"}, {Name: "detect/apiToken"}},
Aliases: []config.Alias{{Name: "blackduckToken"}, {Name: "detectToken"}, {Name: "apiToken", Deprecated: true}, {Name: "detect/apiToken", Deprecated: true}},
Default: os.Getenv("PIPER_token"),
},
{

View File

@ -485,7 +485,7 @@ func fortifyExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "fortifyProjectVersion"}},
Aliases: []config.Alias{{Name: "fortifyProjectVersion", Deprecated: true}},
Default: os.Getenv("PIPER_version"),
},
{
@ -723,7 +723,7 @@ func fortifyExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "fortifyServerUrl"}, {Name: "sscUrl"}},
Aliases: []config.Alias{{Name: "fortifyServerUrl"}, {Name: "sscUrl", Deprecated: true}},
Default: os.Getenv("PIPER_serverUrl"),
},
{
@ -768,7 +768,7 @@ func fortifyExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "GENERAL", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "defaultVersioningModel"}},
Aliases: []config.Alias{{Name: "defaultVersioningModel", Deprecated: true}},
Default: `major`,
},
{

View File

@ -269,7 +269,7 @@ func gitopsUpdateDeploymentMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "image"}, {Name: "containerImage"}},
Aliases: []config.Alias{{Name: "image", Deprecated: true}, {Name: "containerImage"}},
Default: os.Getenv("PIPER_containerImageNameTag"),
},
{

View File

@ -203,7 +203,7 @@ func kanikoExecuteMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "containerImageNameAndTag"}},
Aliases: []config.Alias{{Name: "containerImageNameAndTag", Deprecated: true}},
Default: os.Getenv("PIPER_containerImage"),
},
{

View File

@ -215,7 +215,7 @@ func nexusUploadMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "nexus/mavenRepository"}, {Name: "nexus/repository"}},
Aliases: []config.Alias{{Name: "nexus/mavenRepository"}, {Name: "nexus/repository", Deprecated: true}},
Default: os.Getenv("PIPER_mavenRepository"),
},
{

View File

@ -372,7 +372,7 @@ func protecodeExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "bool",
Mandatory: false,
Aliases: []config.Alias{{Name: "reuseExisting"}},
Aliases: []config.Alias{{Name: "reuseExisting", Deprecated: true}},
Default: false,
},
{
@ -402,7 +402,7 @@ func protecodeExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "user"}},
Aliases: []config.Alias{{Name: "user", Deprecated: true}},
Default: os.Getenv("PIPER_username"),
},
{
@ -437,7 +437,7 @@ func protecodeExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "artifactVersion"}},
Aliases: []config.Alias{{Name: "artifactVersion", Deprecated: true}},
Default: os.Getenv("PIPER_version"),
},
{

View File

@ -319,7 +319,7 @@ func sonarExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "projectVersion"}},
Aliases: []config.Alias{{Name: "projectVersion", Deprecated: true}},
Default: os.Getenv("PIPER_version"),
},
{
@ -373,7 +373,7 @@ func sonarExecuteScanMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "[]string",
Mandatory: false,
Aliases: []config.Alias{{Name: "sonarProperties"}},
Aliases: []config.Alias{{Name: "sonarProperties", Deprecated: true}},
Default: []string{},
},
{

View File

@ -534,7 +534,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "whitesource/jreDownloadUrl"}},
Aliases: []config.Alias{{Name: "whitesource/jreDownloadUrl", Deprecated: true}},
Default: `https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.2/sapmachine-jre-11.0.2_linux-x64_bin.tar.gz`,
},
{
@ -557,7 +557,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "whitesourceOrgToken"}, {Name: "whitesource/orgToken"}},
Aliases: []config.Alias{{Name: "whitesourceOrgToken"}, {Name: "whitesource/orgToken", Deprecated: true}},
Default: os.Getenv("PIPER_orgToken"),
},
{
@ -566,7 +566,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "whitesourceProductName"}, {Name: "whitesource/productName"}},
Aliases: []config.Alias{{Name: "whitesourceProductName"}, {Name: "whitesource/productName", Deprecated: true}},
Default: os.Getenv("PIPER_productName"),
},
{
@ -575,7 +575,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "whitesourceProductToken"}, {Name: "whitesource/productToken"}},
Aliases: []config.Alias{{Name: "whitesourceProductToken"}, {Name: "whitesource/productToken", Deprecated: true}},
Default: os.Getenv("PIPER_productToken"),
},
{
@ -589,7 +589,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "productVersion"}, {Name: "whitesourceProductVersion"}, {Name: "whitesource/productVersion"}},
Aliases: []config.Alias{{Name: "productVersion"}, {Name: "whitesourceProductVersion"}, {Name: "whitesource/productVersion", Deprecated: true}},
Default: os.Getenv("PIPER_version"),
},
{
@ -671,7 +671,7 @@ func whitesourceExecuteScanMetadata() config.StepData {
Scope: []string{"GENERAL", "PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{{Name: "whitesourceServiceUrl"}, {Name: "whitesource/serviceUrl"}},
Aliases: []config.Alias{{Name: "whitesourceServiceUrl"}, {Name: "whitesource/serviceUrl", Deprecated: true}},
Default: `https://saas.whitesourcesoftware.com/api`,
},
{

View File

@ -275,7 +275,7 @@ func xsDeployMetadata() config.StepData {
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{{Name: "user"}},
Aliases: []config.Alias{{Name: "user", Deprecated: true}},
Default: os.Getenv("PIPER_username"),
},
{

View File

@ -242,7 +242,7 @@ func {{ .StepName }}Metadata() config.StepData {
Scope: []string{{ "{" }}{{ range $notused, $scope := $value.Scope }}{{ $scope | quote }},{{ end }}{{ "}" }},
Type: {{ $value.Type | quote }},
Mandatory: {{ $value.Mandatory }},
Aliases: []config.Alias{{ "{" }}{{ range $notused, $alias := $value.Aliases }}{{ "{" }}Name: {{ $alias.Name | quote }}{{ "}" }},{{ end }}{{ "}" }},
Aliases: []config.Alias{{ "{" }}{{ range $notused, $alias := $value.Aliases }}{{ "{" }}Name: {{ $alias.Name | quote }}{{ if $alias.Deprecated }}, Deprecated: {{$alias.Deprecated}}{{ end }}{{ "}" }},{{ end }}{{ "}" }},
{{ if $value.Default -}} Default: {{ $value.Default }}, {{- end}}{{ if $value.Conditions }}
Conditions: []config.Condition{ {{- range $i, $cond := $value.Conditions }} {ConditionRef: {{ $cond.ConditionRef | quote }}, Params: []config.Param{ {{- range $j, $p := $cond.Params}} { Name: {{ $p.Name | quote }}, Value: {{ $p.Value | quote }} }, {{end -}} } }, {{ end -}} },{{- end }}
},{{ end }}

View File

@ -48,6 +48,8 @@ spec:
type: stash
params:
- name: param0
aliases:
- name: oldparam0
type: string
description: param0 description
default: val0
@ -56,6 +58,9 @@ spec:
- PARAMETERS
mandatory: true
- name: param1
aliases:
- name: oldparam1
deprecated: true
type: string
description: param1 description
scope:

View File

@ -222,7 +222,7 @@ func testStepMetadata() config.StepData {
Scope: []string{"GENERAL","PARAMETERS",},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "oldparam0"},},
Default: `val0`,
},
{
@ -231,7 +231,7 @@ func testStepMetadata() config.StepData {
Scope: []string{"PARAMETERS",},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "oldparam1", Deprecated: true},},
Default: os.Getenv("PIPER_param1"),
},
{

View File

@ -221,7 +221,7 @@ func testStepMetadata() config.StepData {
Scope: []string{"GENERAL","PARAMETERS",},
Type: "string",
Mandatory: true,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "oldparam0"},},
Default: `val0`,
},
{
@ -230,7 +230,7 @@ func testStepMetadata() config.StepData {
Scope: []string{"PARAMETERS",},
Type: "string",
Mandatory: false,
Aliases: []config.Alias{},
Aliases: []config.Alias{{Name: "oldparam1", Deprecated: true},},
Default: os.Getenv("PIPER_param1"),
},
{