mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 13:20:39 +08:00
Add configuration option to control publish of no code suggestions message
This commit is contained in:
@ -7,6 +7,7 @@ fallback_models=["gpt-4o-2024-05-13"]
|
|||||||
git_provider="github"
|
git_provider="github"
|
||||||
publish_output=true
|
publish_output=true
|
||||||
publish_output_progress=true
|
publish_output_progress=true
|
||||||
|
publish_output_no_suggestions=true
|
||||||
verbosity_level=0 # 0,1,2
|
verbosity_level=0 # 0,1,2
|
||||||
use_extra_bad_extensions=false
|
use_extra_bad_extensions=false
|
||||||
# Configurations
|
# Configurations
|
||||||
|
@ -113,12 +113,15 @@ class PRCodeSuggestions:
|
|||||||
if (data is None or 'code_suggestions' not in data or not data['code_suggestions']
|
if (data is None or 'code_suggestions' not in data or not data['code_suggestions']
|
||||||
and get_settings().config.publish_output):
|
and get_settings().config.publish_output):
|
||||||
get_logger().warning('No code suggestions found for the PR.')
|
get_logger().warning('No code suggestions found for the PR.')
|
||||||
pr_body = "## PR Code Suggestions ✨\n\nNo code suggestions found for the PR."
|
|
||||||
get_logger().debug(f"PR output", artifact=pr_body)
|
if (get_settings().config.publish_output_no_suggestions):
|
||||||
if self.progress_response:
|
pr_body = "## PR Code Suggestions ✨\n\nNo code suggestions found for the PR."
|
||||||
self.git_provider.edit_comment(self.progress_response, body=pr_body)
|
get_logger().debug(f"PR output", artifact=pr_body)
|
||||||
else:
|
if self.progress_response:
|
||||||
self.git_provider.publish_comment(pr_body)
|
self.git_provider.edit_comment(self.progress_response, body=pr_body)
|
||||||
|
else:
|
||||||
|
self.git_provider.publish_comment(pr_body)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if (not self.is_extended and get_settings().pr_code_suggestions.rank_suggestions) or \
|
if (not self.is_extended and get_settings().pr_code_suggestions.rank_suggestions) or \
|
||||||
|
Reference in New Issue
Block a user