Skip to content

Commit

Permalink
Adjust condition for GitLab fallback reporting (#2686)
Browse files Browse the repository at this point in the history
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.
RELEASE NOTES BEGIN
We have improved fallback commit status reporting via comments in GitLab.
RELEASE NOTES END

Reviewed-by: Nikola Forró
  • Loading branch information
2 parents 1655de9 + 6a8a097 commit 735045c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packit_service/worker/reporting/reporters/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 735045c

Please sign in to comment.