feat(config): enhance ignore_pr_authors to support regex patterns

This commit is contained in:
mrT23
2025-07-20 11:56:55 +03:00
parent 7251e6df96
commit f42dc28a55
4 changed files with 4 additions and 4 deletions

View File

@ -246,7 +246,7 @@ To supplement the automatic bot detection, you can manually specify users to ign
ignore_pr_authors = ["my-special-bot-user", ...] 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 !!! 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. 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.

View File

@ -139,7 +139,7 @@ def should_process_pr_logic(data) -> bool:
# logic to ignore PRs from specific users # logic to ignore PRs from specific users
ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", [])
if ignore_pr_users and sender: 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") get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' setting")
return False return False

View File

@ -270,7 +270,7 @@ def should_process_pr_logic(body) -> bool:
# logic to ignore PRs from specific users # logic to ignore PRs from specific users
ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", [])
if ignore_pr_users and sender: 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") get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' setting")
return False return False

View File

@ -125,7 +125,7 @@ def should_process_pr_logic(data) -> bool:
# logic to ignore PRs from specific users # logic to ignore PRs from specific users
ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", []) ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", [])
if ignore_pr_users and sender: 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") get_logger().info(f"Ignoring PR from user '{sender}' due to 'config.ignore_pr_authors' settings")
return False return False