From a328a64a803aa5d15a2d6c64ef0fad3119164761 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 4 Oct 2019 18:10:43 +0200 Subject: [PATCH] bpo/submit.py: require and pass BPO_JOB_{ID,NAME} Let's send both to to the bpo server with each request. This is needed to handle failing jobs (we need to know which job exactly is failing). Note that this is not directly using a sourcehut specific environment variable, because with bpo it is also possible to choose a "local" job service for testing (manual and testsuite). The local job service will just generate a random number as job id and place that in this variable. --- .build.postmarketos.org/submit.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.build.postmarketos.org/submit.py b/.build.postmarketos.org/submit.py index 0c0862a0e..dc782c327 100755 --- a/.build.postmarketos.org/submit.py +++ b/.build.postmarketos.org/submit.py @@ -12,6 +12,8 @@ for key in ["BPO_API_ENDPOINT", "BPO_API_HOST", "BPO_ARCH", "BPO_BRANCH", + "BPO_JOB_ID", + "BPO_JOB_NAME", "BPO_TOKEN_FILE", "BPO_PAYLOAD_FILES", # one file per line "BPO_PAYLOAD_IS_JSON", # set to "1" to enable @@ -42,6 +44,8 @@ is_json = (os.environ["BPO_PAYLOAD_IS_JSON"] == "1") # Prepare HTTP headers headers = {"X-BPO-Arch": os.environ["BPO_ARCH"], "X-BPO-Branch": os.environ["BPO_BRANCH"], + "X-BPO-Job-Id": os.environ["BPO_JOB_ID"], + "X-BPO-Job-Name": os.environ["BPO_JOB_NAME"], "X-BPO-Token": token, "X-BPO-Pkgname": os.environ["BPO_PKGNAME"], "X-BPO-Version": os.environ["BPO_VERSION"]}