diff --git a/docs/docs/usage-guide/additional_configurations.md b/docs/docs/usage-guide/additional_configurations.md index 17b49cf9..ef18eb44 100644 --- a/docs/docs/usage-guide/additional_configurations.md +++ b/docs/docs/usage-guide/additional_configurations.md @@ -246,7 +246,7 @@ To supplement the automatic bot detection, you can manually specify users to ign ignore_pr_authors = ["my-special-bot-user", ...] ``` -Where the `ignore_pr_authors` is a list of usernames that you want to ignore. +Where the `ignore_pr_authors` is a regex list of usernames that you want to ignore. !!! note There is one specific case where bots will receive an automatic response - when they generated a PR with a _failed test_. In that case, the [`ci_feedback`](https://qodo-merge-docs.qodo.ai/tools/ci_feedback/) tool will be invoked. diff --git a/pr_agent/servers/bitbucket_app.py b/pr_agent/servers/bitbucket_app.py index 0d75d143..7c751bd5 100644 --- a/pr_agent/servers/bitbucket_app.py +++ b/pr_agent/servers/bitbucket_app.py @@ -139,7 +139,7 @@ def should_process_pr_logic(data) -> bool: # logic to ignore PRs from specific users ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) if ignore_pr_users and sender: - if sender in ignore_pr_users: + if any(re.search(regex, sender) for regex in ignore_pr_users): get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' setting") return False diff --git a/pr_agent/servers/github_app.py b/pr_agent/servers/github_app.py index 36db3c69..b94b79e3 100644 --- a/pr_agent/servers/github_app.py +++ b/pr_agent/servers/github_app.py @@ -270,7 +270,7 @@ def should_process_pr_logic(body) -> bool: # logic to ignore PRs from specific users ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) if ignore_pr_users and sender: - if sender in ignore_pr_users: + if any(re.search(regex, sender) for regex in ignore_pr_users): get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' setting") return False diff --git a/pr_agent/servers/gitlab_webhook.py b/pr_agent/servers/gitlab_webhook.py index 60f13501..69187530 100644 --- a/pr_agent/servers/gitlab_webhook.py +++ b/pr_agent/servers/gitlab_webhook.py @@ -125,7 +125,7 @@ def should_process_pr_logic(data) -> bool: # logic to ignore PRs from specific users ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) if ignore_pr_users and sender: - if sender in ignore_pr_users: + if any(re.search(regex, sender) for regex in ignore_pr_users): get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' settings") return False