ci: Always print status code of HTTP uploads in tracie
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 28 Jul 2020 05:47:40 +0000 (07:47 +0200)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 29 Jul 2020 12:25:30 +0000 (14:25 +0200)
I'm seeing occasional unexpected 403 errors when uploading artifacts.
Print the response in case MinIO is telling us why.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6101>

.gitlab-ci/tracie/tracie.py

index d220ef5dc60683e7bfcfc13270bccff5c1068c9b..f8e3eab870b346701bc147b5924e248f31e2b397 100644 (file)
@@ -92,7 +92,8 @@ def upload_artifact(file_name, key, content_type):
                    'x-amz-security-token': minio_token}
         print("Uploading artifact to %s" % url);
         r = requests.put(url, headers=headers, data=data)
-        #print(r.text)
+        if r.status_code >= 400:
+            print(r.text)
         r.raise_for_status()
 
 def gitlab_check_trace(project_url, device_name, trace, expectation):