feat: support 'publish_output_no_suggestions' by 'pr_reviewer'

The tool reuses the existing variable name.
The change is non-breaking because by default it keeps the old behavior.
This commit is contained in:
Alessio
2025-06-09 17:29:03 +03:00
parent 9c17a3902b
commit 8d2e92fe83
2 changed files with 12 additions and 8 deletions

View File

@ -80,6 +80,7 @@ require_can_be_split_review=false
require_security_review=true
require_ticket_analysis_review=true
# general options
publish_output_no_suggestions=true # Set to "false" if you only need the reviewer's remarks (not labels, not "security audit", etc.) and want to avoid noisy "No major issues detected" comments.
persistent_comment=true
extra_instructions = ""
num_max_findings = 3

View File

@ -160,14 +160,17 @@ class PRReviewer:
if get_settings().config.publish_output:
# publish the review
if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental:
if get_settings().pr_reviewer.persistent_comment:
if self.incremental.is_incremental:
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, )
else:
elif 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.")
self.git_provider.remove_initial_comment()
else: