Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/response_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions src/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@
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)

Check warning on line 152 in src/triggers.py

View check run for this annotation

Codecov / codecov/patch

src/triggers.py#L151-L152

Added lines #L151 - L152 were not covered by tests


def has_user_comment_on_pr(issue: Issue) -> bool:
"""
Check if there is a user comment on a pull request that needs processing
Expand Down