From d00cbd4da74dd97a7e4f68ae92cfc621a16ec3cb Mon Sep 17 00:00:00 2001 From: Alessio <148966056+alessio-locatelli@users.noreply.github.com> Date: Sat, 21 Jun 2025 15:28:27 +0300 Subject: [PATCH] Revert "fix: do not fail the CLI when GitLab API return 5xx code" This reverts commit 68f78e1a30b492fc73ada3e4832d3b155d7fb9be. --- pr_agent/agent/pr_agent.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/pr_agent/agent/pr_agent.py b/pr_agent/agent/pr_agent.py index bfe924d6..0a42a50d 100644 --- a/pr_agent/agent/pr_agent.py +++ b/pr_agent/agent/pr_agent.py @@ -1,9 +1,6 @@ import shlex from functools import partial -import gitlab -from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR, HTTP_503_SERVICE_UNAVAILABLE - from pr_agent.algo.ai_handlers.base_ai_handler import BaseAiHandler from pr_agent.algo.ai_handlers.litellm_ai_handler import LiteLLMAIHandler from pr_agent.algo.cli_args import CliArgs @@ -116,19 +113,7 @@ class PRAgent: if notify: notify() - try: - await command2class[action](pr_url, ai_handler=self.ai_handler, args=args).run() - except gitlab.GitlabError as gitlab_error: - # For GitLab 5xx codes see: https://docs.gitlab.com/api/rest/troubleshooting/#status-codes - if gitlab_error.response_code in {HTTP_500_INTERNAL_SERVER_ERROR, HTTP_503_SERVICE_UNAVAILABLE}: - # The problem is likely temporary and not on our side; therefore, do not fail the application. - get_logger().error( - f"Failed to process the command due to a problem on the GitLab API side: {gitlab_error!r}\n" - + "Check https://status.gitlab.com and try again later." - ) - return False - raise - + await command2class[action](pr_url, ai_handler=self.ai_handler, args=args).run() else: return False return True