From 3f60d12a9a1b1ca1ae5449b7db02c4e2f5d51fa2 Mon Sep 17 00:00:00 2001 From: Tim Perkins Date: Mon, 14 Aug 2023 13:07:00 -0400 Subject: [PATCH 1/2] Publish comment when improve has no suggestions --- pr_agent/tools/pr_code_suggestions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index a235852e..320b7dfb 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -93,6 +93,10 @@ class PRCodeSuggestions: def push_inline_code_suggestions(self, data): code_suggestions = [] + + if not data['Code suggestions']: + return self.git_provider.publish_comment('🎉 The PR looks good and there is nothing to suggest!') + for d in data['Code suggestions']: try: if get_settings().config.verbosity_level >= 2: From 70286e95740f31ce36c5585af6a96ae84e37ede4 Mon Sep 17 00:00:00 2001 From: Tim Perkins Date: Tue, 15 Aug 2023 08:35:57 -0400 Subject: [PATCH 2/2] Make the message more modest --- pr_agent/tools/pr_code_suggestions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index 320b7dfb..e759d61d 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -95,7 +95,7 @@ class PRCodeSuggestions: code_suggestions = [] if not data['Code suggestions']: - return self.git_provider.publish_comment('🎉 The PR looks good and there is nothing to suggest!') + return self.git_provider.publish_comment('No suggestions found to improve this PR.') for d in data['Code suggestions']: try: