diff --git a/pr_agent/git_providers/gitlab_provider.py b/pr_agent/git_providers/gitlab_provider.py index 2e6f2140..b8344fd4 100644 --- a/pr_agent/git_providers/gitlab_provider.py +++ b/pr_agent/git_providers/gitlab_provider.py @@ -228,6 +228,9 @@ class GitLabProvider(GitProvider): except Exception as e: logging.exception(f"Could not publish code suggestion:\nsuggestion: {suggestion}\nerror: {e}") + # note that we publish suggestions one-by-one. so, if one fails, the rest will still be published + return True + def search_line(self, relevant_file, relevant_line_in_file): target_file = None diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index e1d5206c..7f0b1264 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -138,9 +138,9 @@ class PRCodeSuggestions: if get_settings().config.verbosity_level >= 2: logging.info(f"Could not parse suggestion: {d}") - # is_successful = self.git_provider.publish_code_suggestions(code_suggestions) - if True: - # logging.info("Failed to publish code suggestions, trying to publish each suggestion separately") + is_successful = self.git_provider.publish_code_suggestions(code_suggestions) + if not is_successful: + logging.info("Failed to publish code suggestions, trying to publish each suggestion separately") for code_suggestion in code_suggestions: self.git_provider.publish_code_suggestions([code_suggestion])