diff --git a/src/response_agent.py b/src/response_agent.py index eeb4bfc..a2cfb2c 100644 --- a/src/response_agent.py +++ b/src/response_agent.py @@ -1001,6 +1001,10 @@ def process_issue( print(f"Processing {entity_type} #{issue_or_pr.number}") try: + if triggers.has_ignore_comment(issue_or_pr): + # This is a skip outcome, not an error + return False, f"{entity_type} #{issue_or_pr.number} contains ignore pattern" + has_bot_mention = triggers.has_blech_bot_tag(issue_or_pr) \ or '[ blech_bot ]' in (issue_or_pr.title or '').lower() if not has_bot_mention: diff --git a/src/triggers.py b/src/triggers.py index a0ef1cb..a6e0a1d 100644 --- a/src/triggers.py +++ b/src/triggers.py @@ -138,6 +138,20 @@ def has_error_comment(issue: Issue) -> bool: return 'Traceback (most recent call last):' in comments[-1].body if comments else False +def has_ignore_comment(issue: Issue) -> bool: + """ + Check if any comment contains the ignore pattern [ blech_bot ignore ] + + Args: + issue: The GitHub issue to check + + Returns: + True if the ignore pattern is found in any comment + """ + comments = get_issue_comments(issue) + return any("[ blech_bot ignore ]" in comment.body for comment in comments) + + def has_user_comment_on_pr(issue: Issue) -> bool: """ Check if there is a user comment on a pull request that needs processing