From 2310bb4bd5ad1fafda706403282d2f52b4b7b2d0 Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Thu, 12 Jul 2018 09:49:18 +0200 Subject: [PATCH] Do not repeat the same parameter names for different configuration layers changeId is removed from the step parameters since the changeId is specific to the build. Hence there is no reason for providing it from the deeper configuration layers. --- vars/checkChangeInDevelopment.groovy | 15 ++------------- vars/transportRequestCreate.groovy | 10 ++-------- vars/transportRequestRelease.groovy | 13 +++++-------- vars/transportRequestUploadFile.groovy | 15 ++++++--------- 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/vars/checkChangeInDevelopment.groovy b/vars/checkChangeInDevelopment.groovy index f8e172789..060bdee71 100644 --- a/vars/checkChangeInDevelopment.groovy +++ b/vars/checkChangeInDevelopment.groovy @@ -9,8 +9,7 @@ import com.sap.piper.cm.ChangeManagementException @Field def STEP_NAME = 'checkChangeInDevelopment' -@Field Set parameterKeys = [ - 'changeDocumentId', +@Field Set stepConfigurationKeys = [ 'cmClientOpts', 'credentialsId', 'endpoint', @@ -21,17 +20,7 @@ import com.sap.piper.cm.ChangeManagementException 'gitFormat' ] -@Field Set stepConfigurationKeys = [ - 'changeDocumentId', - 'cmClientOpts', - 'credentialsId', - 'endpoint', - 'failIfStatusIsNotInDevelopment', - 'gitFrom', - 'gitTo', - 'gitChangeDocumentLabel', - 'gitFormat' - ] +@Field Set parameterKeys = stepConfigurationKeys.plus('changeDocumentId') @Field Set generalConfigurationKeys = stepConfigurationKeys diff --git a/vars/transportRequestCreate.groovy b/vars/transportRequestCreate.groovy index 485ffaab6..26f627eff 100644 --- a/vars/transportRequestCreate.groovy +++ b/vars/transportRequestCreate.groovy @@ -11,20 +11,14 @@ import hudson.AbortException @Field def STEP_NAME = 'transportRequestCreate' -@Field Set parameterKeys = [ - 'changeDocumentId', - 'clientOpts', - 'developmentSystemId', - 'credentialsId', - 'endpoint' - ] - @Field Set stepConfigurationKeys = [ 'credentialsId', 'clientOpts', 'endpoint' ] +@Field Set parameterKeys = stepConfigurationKeys.plus(['changeDocumentId', 'developmentSystemId']) + @Field generalConfigurationKeys = stepConfigurationKeys def call(parameters = [:]) { diff --git a/vars/transportRequestRelease.groovy b/vars/transportRequestRelease.groovy index fa6899b27..0fb114f9b 100644 --- a/vars/transportRequestRelease.groovy +++ b/vars/transportRequestRelease.groovy @@ -11,20 +11,17 @@ import hudson.AbortException @Field def STEP_NAME = 'transportRequestRelease' -@Field Set parameterKeys = [ - 'changeDocumentId', - 'cmClientOpts', - 'transportRequestId', - 'credentialsId', - 'endpoint' - ] - @Field Set stepConfigurationKeys = [ 'credentialsId', 'cmClientOpts', 'endpoint' ] +@Field Set parameterKeys = stepConfigurationKeys.plus([ + 'changeDocumentId', + 'transportRequestId', + ]) + @Field Set generalConfigurationKeys = stepConfigurationKeys def call(parameters = [:]) { diff --git a/vars/transportRequestUploadFile.groovy b/vars/transportRequestUploadFile.groovy index 919b2b713..f2f9ae16e 100644 --- a/vars/transportRequestUploadFile.groovy +++ b/vars/transportRequestUploadFile.groovy @@ -11,20 +11,17 @@ import hudson.AbortException @Field def STEP_NAME = 'transportRequestUploadFile' -@Field Set parameterKeys = [ - 'changeDocumentId', - 'transportRequestId', - 'applicationId', - 'filePath', - 'credentialsId', - 'endpoint' - ] - @Field Set generalConfigurationKeys = [ 'credentialsId', 'endpoint' ] +@Field Set parameterKeys = generalConfigurationKeys.plus([ + 'applicationId', + 'changeDocumentId', + 'filePath', + 'transportRequestId']) + @Field Set stepConfigurationKeys = generalConfigurationKeys def call(parameters = [:]) {