ci_run_n_monitor.py: automatically retry on transient errors
authorEric Engestrom <eric@engestrom.ch>
Thu, 1 Dec 2022 10:49:56 +0000 (10:49 +0000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 6 Jan 2023 19:28:55 +0000 (19:28 +0000)
This morning a GitLab update was deployed, leading to a few moments
where the API returned an error.

python-gitlab is actually able to handle a number of those and retry
automatically, so let's enable that:
https://python-gitlab.readthedocs.io/en/stable/api-usage-advanced.html#transient-errors

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20094>

bin/ci/ci_run_n_monitor.py

index 3e497e6..915299e 100755 (executable)
@@ -276,7 +276,9 @@ if __name__ == "__main__":
 
         token = read_token(args.token)
 
-        gl = gitlab.Gitlab(url="https://gitlab.freedesktop.org", private_token=token)
+        gl = gitlab.Gitlab(url="https://gitlab.freedesktop.org",
+                           private_token=token,
+                           retry_transient_errors=True)
 
         cur_project = get_gitlab_project(gl, "mesa")