Support adding / removing reaction from comments in GitHub different servers

This commit is contained in:
Ori Kotek
2023-08-07 16:18:08 +03:00
parent 8f751f7371
commit 886139c6b5
7 changed files with 57 additions and 3 deletions

View File

@ -98,8 +98,12 @@ async def polling_loop():
if user_tag not in comment_body:
continue
rest_of_comment = comment_body.split(user_tag)[1].strip()
comment_id = comment['id']
git_provider.set_pr(pr_url)
added_reaction = git_provider.add_eyes_reaction(comment_id)
success = await agent.handle_request(pr_url, rest_of_comment)
if added_reaction:
git_provider.remove_reaction(comment_id, added_reaction)
if not success:
git_provider.set_pr(pr_url)
git_provider.publish_comment("### How to use PR-Agent\n" +