Add disable_auto_feedback configuration option to control automatic PR feedback

This commit is contained in:
mrT23
2024-12-02 21:28:48 +02:00
parent 91bf3c0749
commit 8610aa27a4
7 changed files with 45 additions and 14 deletions

View File

@ -374,6 +374,9 @@ def _check_pull_request_event(action: str, body: dict, log_context: dict) -> Tup
async def _perform_auto_commands_github(commands_conf: str, agent: PRAgent, body: dict, api_url: str,
log_context: dict):
apply_repo_settings(api_url)
if commands_conf == "pr_commands" and get_settings().config.disable_auto_feedback: # auto commands for PR, and auto feedback is disabled
get_logger().info(f"Auto feedback is disabled, skipping auto commands for PR {api_url=}")
return
if not should_process_pr_logic(body): # Here we already updated the configuration with the repo settings
return {}
commands = get_settings().get(f"github_app.{commands_conf}")