From e8770beba125c407acbe5bd88aa68a194f581551 Mon Sep 17 00:00:00 2001 From: Alessio <148966056+alessio-locatelli@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:42:04 +0300 Subject: [PATCH] fix: correct IF/ELSE block --- pr_agent/tools/pr_reviewer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index af67a00f..8500f722 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -160,14 +160,17 @@ class PRReviewer: if get_settings().config.publish_output: # publish the review - if get_settings().pr_reviewer.persistent_comment: - if self.incremental.is_incremental: + if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental: + if get_settings().pr_reviewer.get('publish_output_no_suggestions', True) or "No major issues detected" not in pr_review: final_update_message = get_settings().pr_reviewer.final_update_message self.git_provider.publish_persistent_comment(pr_review, initial_header=f"{PRReviewHeader.REGULAR.value} 🔍", update_header=True, final_update_message=final_update_message, ) - elif get_settings().pr_reviewer.get('publish_output_no_suggestions', True) or "No major issues detected" not in pr_review: + else: + get_logger().info("Review output is not published: no major issues detected.") + else: + if get_settings().pr_reviewer.get('publish_output_no_suggestions', True) or "No major issues detected" not in pr_review: self.git_provider.publish_comment(pr_review) else: get_logger().info("Review output is not published: no major issues detected.")