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
8 changes: 4 additions & 4 deletions github_assign/autokitteh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ project:
triggers:
- name: assign_issue_comment
connection: github
event_type: issue_comment
event_type: slash_command
call: handlers.py:on_assign_issue_comment
filter: "data.comment.body.startsWith('/assign') && (data.action in ['created', 'edited'])"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'assign'"
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter no longer includes the 'edited' action that was supported in the original implementation. The old filter checked data.action in ['created', 'edited'], but the new filter only checks for data.actual_data.action == 'created'. This means slash commands in edited comments will no longer trigger the handler. If this behavior change is intentional, it should be documented; otherwise, the filter should be updated to: data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'assign'

Suggested change
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'assign'"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'assign'"

Copilot uses AI. Check for mistakes.

- name: unassign_issue_comment
connection: github
event_type: issue_comment
event_type: slash_command
call: handlers.py:on_unassign_issue_comment
filter: "data.comment.body.startsWith('/unassign') && (data.action in ['created', 'edited'])"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'unassign'"
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter no longer includes the 'edited' action that was supported in the original implementation. The old filter checked data.action in ['created', 'edited'], but the new filter only checks for data.actual_data.action == 'created'. This means slash commands in edited comments will no longer trigger the handler. If this behavior change is intentional, it should be documented; otherwise, the filter should be updated to: data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'unassign'

Suggested change
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'unassign'"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'unassign'"

Copilot uses AI. Check for mistakes.
26 changes: 4 additions & 22 deletions github_assign/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@

def on_assign_issue_comment(event: Event) -> None:
"""Handle /assign commands in issue comments"""
data = event.data

assignees = [a.removeprefix("@") for a in event.data.command.args]
data = event.data.actual_data
comment = data["comment"]
cmd = comment["body"].strip().split()

print(f"command: {cmd!r}")

if not cmd[0].startswith("/assign"):
print("irrelevant command")
return

assignees = [a.removeprefix("@") for a in cmd[1:]]

repo = github.get_repo(data["repository"]["full_name"])
issue = repo.get_issue(number=data["issue"]["number"])
Expand Down Expand Up @@ -61,18 +52,9 @@ def on_assign_issue_comment(event: Event) -> None:

def on_unassign_issue_comment(event: Event) -> None:
"""Handle /unassign commands in issue comments"""
data = event.data

assignees = [a.removeprefix("@") for a in event.data.command.args]
data = event.data.actual_data
comment = data["comment"]
cmd = comment["body"].strip().split()

print(f"command: {cmd!r}")

if not cmd[0].startswith("/unassign"):
print("irrelevant command")
return

assignees = [a.removeprefix("@") for a in cmd[1:]]

repo = github.get_repo(data["repository"]["full_name"])
issue = repo.get_issue(number=data["issue"]["number"])
Expand Down
8 changes: 4 additions & 4 deletions github_review/autokitteh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ project:
triggers:
- name: review_issue_comment
connection: github
event_type: issue_comment
event_type: slash_command
call: handlers.py:on_review_issue_comment
filter: "data.comment.body.startsWith('/review') && (data.action in ['created', 'edited'])"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'review'"
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter no longer includes the 'edited' action that was supported in the original implementation. The old filter checked data.action in ['created', 'edited'], but the new filter only checks for data.actual_data.action == 'created'. This means slash commands in edited comments will no longer trigger the handler. If this behavior change is intentional, it should be documented; otherwise, the filter should be updated to: data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'review'

Suggested change
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'review'"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'review'"

Copilot uses AI. Check for mistakes.

- name: unreview_issue_comment
connection: github
event_type: issue_comment
event_type: slash_command
call: handlers.py:on_unreview_issue_comment
filter: "data.comment.body.startsWith('/unreview') && (data.action in ['created', 'edited'])"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'unreview'"
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter no longer includes the 'edited' action that was supported in the original implementation. The old filter checked data.action in ['created', 'edited'], but the new filter only checks for data.actual_data.action == 'created'. This means slash commands in edited comments will no longer trigger the handler. If this behavior change is intentional, it should be documented; otherwise, the filter should be updated to: data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'unreview'

Suggested change
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action == 'created' && data.command.name == 'unreview'"
filter: "data.actual_event_type == 'issue_comment' && data.actual_data.action in ['created', 'edited'] && data.command.name == 'unreview'"

Copilot uses AI. Check for mistakes.
26 changes: 4 additions & 22 deletions github_review/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@

def on_review_issue_comment(event: Event) -> None:
"""Handle /review commands in issue comments"""
data = event.data

reviewers = [a.removeprefix("@") for a in event.data.command.args]
data = event.data.actual_data
comment = data["comment"]
cmd = comment["body"].strip().split()

print(f"command: {cmd!r}")

if not cmd[0].startswith("/review"):
print("irrelevant command")
return

reviewers = [a.removeprefix("@") for a in cmd[1:]]

repo = github.get_repo(data["repository"]["full_name"])
n = data["issue"]["number"]
Expand Down Expand Up @@ -68,18 +59,9 @@ def on_review_issue_comment(event: Event) -> None:

def on_unreview_issue_comment(event: Event) -> None:
"""Handle /unreview commands in issue comments"""
data = event.data

reviewers = [a.removeprefix("@") for a in event.data.command.args]
data = event.data.actual_data
comment = data["comment"]
cmd = comment["body"].strip().split()

print(f"command: {cmd!r}")

if not cmd[0].startswith("/unreview"):
print("irrelevant command")
return

reviewers = [a.removeprefix("@") for a in cmd[1:]]

repo = github.get_repo(data["repository"]["full_name"])
n = data["issue"]["number"]
Expand Down