From a1b1f8d421c180111fdba8ed2d0bcf684ea1c490 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Sat, 1 Apr 2023 14:13:59 -0400 Subject: [PATCH] jobs/kola-upgrade: use latest in `start_stream` if necessary We hit this today in the pipeline. The `builds.size() % max-min+1` code specified 39 as the start_version (rawhide is currently on 39) but the `next` stream is on 38. So the `releases.json` traversal code wasn't finding any builds in the `next` stream and the test ultimately failed. If we encounter a case like this, let's just use the latest build from the `start_stream`. --- jobs/kola-upgrade.Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jobs/kola-upgrade.Jenkinsfile b/jobs/kola-upgrade.Jenkinsfile index 21670a292..d06e884b6 100644 --- a/jobs/kola-upgrade.Jenkinsfile +++ b/jobs/kola-upgrade.Jenkinsfile @@ -102,13 +102,21 @@ lock(resource: "kola-upgrade-${params.ARCH}") { } else { shwrap("curl -LO https://builds.coreos.fedoraproject.org/prod/streams/${start_stream}/releases.json") def releases = readJSON file: "releases.json" + def newest_version = releases["releases"][-1]["version"] for (release in releases["releases"]) { def has_arch = release["commits"].find{ commit -> commit["architecture"] == params.ARCH } if (release["version"] in deadends || has_arch == null) { continue // This release has been disqualified } if (start_version.length() == 2) { - if ((release["version"][0..1] as Integer) > (start_version as Integer)) { + if (release["version"] == newest_version) { + // We've reached the latest build in the stream. This can happen + // when we're testing i.e. rawhide and it's moved on to FN+1, but + // `next` hasn't. Just use the newest build in `start_stream` in + // that case. + start_version = newest_version + break + } else if ((release["version"][0..1] as Integer) > (start_version as Integer)) { echo "There wasn't a release for this architecture for Fedora ${start_version}.. Skipping" return } else if (release["version"][0..1] == start_version) {