From 2c9e1d3a37f57feaa88860b8bb4f324e7745c824 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Fri, 15 May 2026 17:44:49 -0400 Subject: [PATCH] ceph-dev-pipeline: Validate given BRANCH param against derived BRANCH Handles an unlikely edge case but handled nonetheless. This could be problematic if, for example, a user triggered ceph-dev-pipeline by specifying:: SHA1=1234abcd BRANCH=main But that SHA1 actually belongs to a wip branch. Now both chacra and shaman think the tip of main is 1234abcd. Fixes: https://tracker.ceph.com/issues/73658 Signed-off-by: David Galloway --- ceph-dev-pipeline/build/Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ceph-dev-pipeline/build/Jenkinsfile b/ceph-dev-pipeline/build/Jenkinsfile index db61bd4ba..fe1e71ad4 100644 --- a/ceph-dev-pipeline/build/Jenkinsfile +++ b/ceph-dev-pipeline/build/Jenkinsfile @@ -253,7 +253,7 @@ pipeline { stage("copy artifacts") { steps { script { - def artifact_filter = "dist/sha1,dist/version,dist/other_envvars,dist/ceph-*.tar.bz2" + def artifact_filter = "dist/sha1,dist/version,dist/branch,dist/other_envvars,dist/ceph-*.tar.bz2" def os = get_os_info(env.DIST) if ( env.CI_COMPILE && os.pkg_type == "deb" ) { artifact_filter += ",dist/ceph_*.diff.gz,dist/ceph_*.dsc" @@ -276,6 +276,10 @@ pipeline { env.SHA1 = sha1_from_artifact } println "SHA1=${sha1_trimmed}" + // Derive canonical BRANCH from artifact. + // This way, if SHA1 and BRANCH were both provided as params and BRANCH didn't match, it will now. + def branch_props = readProperties file: "${WORKSPACE}/dist/branch" + env.BRANCH = branch_props.BRANCH.trim() env.VERSION = readFile(file: "${WORKSPACE}/dist/version").trim() script { // In a release build, dist/other_envvars contains CEPH_REPO, and chacra_url