Hello,

recent openbsd ftp unavailability has shown that we should more carefully
generate build matrix

Ilya
From 62069d1e7edefdd313bdc7567e3817069632bfda Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Wed, 26 Apr 2023 20:39:39 +0200
Subject: [PATCH] CI: more granular failure on generating build matrix

when some api endpoints used for determine latest OpenSSL, LibreSSL
are unavailable, fail only those builds, not entire matrix
---
 .github/matrix.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/.github/matrix.py b/.github/matrix.py
index a2a02e968..7f22c43bb 100755
--- a/.github/matrix.py
+++ b/.github/matrix.py
@@ -33,11 +33,13 @@ def determine_latest_openssl(ssl):
     headers = {}
     if environ.get("GITHUB_TOKEN") is not None:
         headers["Authorization"] = "token {}".format(environ.get("GITHUB_TOKEN"))
-
     request = urllib.request.Request(
         "https://api.github.com/repos/openssl/openssl/tags";, headers=headers
     )
-    openssl_tags = urllib.request.urlopen(request)
+    try:
+      openssl_tags = urllib.request.urlopen(request)
+    except:
+      return "OPENSSL_VERSION=failed_to_detect"
     tags = json.loads(openssl_tags.read().decode("utf-8"))
     latest_tag = ""
     for tag in tags:
@@ -50,9 +52,12 @@ def determine_latest_openssl(ssl):
 
 @functools.lru_cache(5)
 def determine_latest_libressl(ssl):
-    libressl_download_list = urllib.request.urlopen(
-        "https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/";
-    )
+    try:
+      libressl_download_list = urllib.request.urlopen(
+          "https://cdn.openbsd.org/pub/OpenBSD/LibreSSL/";
+      )
+    except:
+      return "LIBRESSL_VERSION=failed_to_detect"
     for line in libressl_download_list.readlines():
         decoded_line = line.decode("utf-8")
         if "libressl-" in decoded_line and ".tar.gz.asc" in decoded_line:
-- 
2.40.0

Reply via email to