From 6a8a0974e9a9d0d3efab9cfc9c74b0a73a4e6c20 Mon Sep 17 00:00:00 2001 From: Laura Barcziova Date: Mon, 23 Dec 2024 18:55:12 +0100 Subject: [PATCH] Adjust condition for GitLab fallback reporting If the reason is not related to reporting the same status (e.g. pending -> pending), fallback to comment reporting. --- packit_service/worker/reporting/reporters/gitlab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packit_service/worker/reporting/reporters/gitlab.py b/packit_service/worker/reporting/reporters/gitlab.py index 7dfafc872..b4fcc6748 100644 --- a/packit_service/worker/reporting/reporters/gitlab.py +++ b/packit_service/worker/reporting/reporters/gitlab.py @@ -52,9 +52,9 @@ def set_status( ) except GitlabAPIException as e: logger.debug(f"Failed to set the status: {e}. Response code: {e.response_code}") - # Ignoring Gitlab 'enqueue' error + # Ignoring Gitlab error regarding reporting a status of the same state # https://github.com/packit-service/packit-service/issues/741 - if e.response_code != 400: + if e.response_code != 400 or "Cannot transition status" not in str(e): # 403: No permissions to set status, falling back to comment # 404: Commit has not been found, e.g. used target project on GitLab logger.debug(