From c2ad35d846b87dcc0f11b504815e0eb247c19ec3 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 23 Feb 2023 15:55:17 -0500 Subject: [PATCH] jobs/build: gate all rerun logic on uploading We only actually run the jobs when `uploading` is set. So it seems wrong to update the build description. In fact, let's not even waste time looking for missing arches or reading build metadata. Patch best viewed with whitespace ignored. --- jobs/build.Jenkinsfile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/jobs/build.Jenkinsfile b/jobs/build.Jenkinsfile index f5a475588..02d2cb359 100644 --- a/jobs/build.Jenkinsfile +++ b/jobs/build.Jenkinsfile @@ -265,15 +265,16 @@ lock(resource: "build-${params.STREAM}") { // Nothing changed since the latest build. Check if it's missing // some arches and retrigger `build-arch` only for the missing // arches, and the follow-up `release` job. Match the exact src - // config commit that was used. - def builds = readJSON file: "builds/builds.json" - assert buildID == builds.builds[0].id - def missing_arches = additional_arches - builds.builds[0].arches - if (missing_arches) { - def meta = readJSON(text: shwrapCapture("cosa meta --build=${buildID} --dump")) - def rev = meta["coreos-assembler.config-gitrev"] - currentBuild.description = "${build_description} 🔨 ${buildID}" - if (uploading) { + // config commit that was used. Skip if not uploading since it's + // required for multi-arch. + if (uploading) { + def builds = readJSON file: "builds/builds.json" + assert buildID == builds.builds[0].id + def missing_arches = additional_arches - builds.builds[0].arches + if (missing_arches) { + def meta = readJSON(text: shwrapCapture("cosa meta --build=${buildID} --dump")) + def rev = meta["coreos-assembler.config-gitrev"] + currentBuild.description = "${build_description} 🔨 ${buildID}" // Run the mArch jobs and wait. We wait here because if they fail // we don't want to bother running the release job again since the // goal is to get a complete build.