From 6701acb9f9fcca272f515a6d0e0d4f541c5864e8 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Thu, 3 Mar 2022 09:22:30 -0500 Subject: [PATCH 1/2] Convert env[NAME] to env."NAME" To avoid having to whitelist org.codehaus.groovy.runtime.DefaultGroovyMethods getAt java.lang.Object java.lang.String Skip-PR-comments: true Signed-off-by: Brian J. Murrell --- vars/daosPackagesVersion.groovy | 3 ++- vars/dockerBuildArgs.groovy | 4 ++-- vars/notifyBrokenBranch.groovy | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/vars/daosPackagesVersion.groovy b/vars/daosPackagesVersion.groovy index d34079990..7bd931624 100644 --- a/vars/daosPackagesVersion.groovy +++ b/vars/daosPackagesVersion.groovy @@ -15,9 +15,10 @@ import groovy.transform.Field @Field static rpm_version_cache = "" String daos_latest_version(String next_version, String repo_type='stable') { + repo_type = repo_type.toUpperCase() String v = sh(label: "Get RPM packages version", script: 'repoquery --repofrompath=daos,' + env.REPOSITORY_URL + - env["DAOS_STACK_EL_7_" + repo_type.toUpperCase() + "_REPO"] + + env."DAOS_STACK_EL_7_${repo_type}_REPO" + '''/ --repoid daos --qf %{version}-%{release} --whatprovides 'daos-tests(x86-64) < ''' + next_version + '''' | rpmdev-sort | tail -1''', diff --git a/vars/dockerBuildArgs.groovy b/vars/dockerBuildArgs.groovy index 61b49b29e..79f8184a7 100644 --- a/vars/dockerBuildArgs.groovy +++ b/vars/dockerBuildArgs.groovy @@ -158,8 +158,8 @@ String call(Map config = [:]) { repo_alias = 'FEDORA' daos_arg = 'FEDORA' } - dist_repo = env["DAOS_STACK_${repo_alias}${repo_mod}_${dist_type}_REPO"] - daos_repo = env["DAOS_STACK_${repo_alias}_${daos_type}_REPO"] + dist_repo = env."DAOS_STACK_${repo_alias}${repo_mod}_${dist_type}_REPO" + daos_repo = env."DAOS_STACK_${repo_alias}_${daos_type}_REPO" // Only add the build args if a repo was found. if (dist_repo || daos_repo) { diff --git a/vars/notifyBrokenBranch.groovy b/vars/notifyBrokenBranch.groovy index de089482b..bdfebf7af 100644 --- a/vars/notifyBrokenBranch.groovy +++ b/vars/notifyBrokenBranch.groovy @@ -34,8 +34,8 @@ def call(Map config = [:]) { subject: 'Build broken on ' + env.GIT_BRANCH, onPR: config['onPR'] - def branch = env['GIT_BRANCH'].toUpperCase().replaceAll("-", "_") - def watchers = env["DAOS_STACK_${branch}_WATCHER"] + def branch = env.GIT_BRANCH.toUpperCase().replaceAll("-", "_")) + def watchers = env."DAOS_STACK_${branch}_WATCHER" if (watchers != "null") { emailextDaos body: env.GIT_BRANCH + ' is broken.\n\n' + From 0784e5c3f80bfffc43cdb50312e47bf8c3ade6e8 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Thu, 3 Mar 2022 21:27:26 -0500 Subject: [PATCH 2/2] Remove extraneous ) Signed-off-by: Brian J. Murrell --- vars/notifyBrokenBranch.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/notifyBrokenBranch.groovy b/vars/notifyBrokenBranch.groovy index bdfebf7af..4f2ee69e7 100644 --- a/vars/notifyBrokenBranch.groovy +++ b/vars/notifyBrokenBranch.groovy @@ -34,7 +34,7 @@ def call(Map config = [:]) { subject: 'Build broken on ' + env.GIT_BRANCH, onPR: config['onPR'] - def branch = env.GIT_BRANCH.toUpperCase().replaceAll("-", "_")) + def branch = env.GIT_BRANCH.toUpperCase().replaceAll("-", "_") def watchers = env."DAOS_STACK_${branch}_WATCHER" if (watchers != "null") {