Skip to content

Commit

Permalink
jobs/kola-upgrade: use latest in start_stream if necessary
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
dustymabe authored and jlebon committed Apr 3, 2023
1 parent d5b1a0e commit a1b1f8d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion jobs/kola-upgrade.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a1b1f8d

Please sign in to comment.