mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-02 11:50:37 +08:00
Support adding / removing reaction from comments in GitHub different servers
This commit is contained in:
@ -11,6 +11,7 @@ from starlette_context.middleware import RawContextMiddleware
|
||||
|
||||
from pr_agent.agent.pr_agent import PRAgent
|
||||
from pr_agent.config_loader import get_settings, global_settings
|
||||
from pr_agent.git_providers import get_git_provider
|
||||
from pr_agent.servers.utils import verify_signature
|
||||
|
||||
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
||||
@ -80,7 +81,13 @@ async def handle_request(body: Dict[str, Any]):
|
||||
return {}
|
||||
pull_request = body["issue"]["pull_request"]
|
||||
api_url = pull_request.get("url")
|
||||
comment_id = body.get("comment", {}).get("id")
|
||||
provider = get_git_provider()(pr_url=api_url)
|
||||
added_reaction = provider.add_eyes_reaction(comment_id)
|
||||
await agent.handle_request(api_url, comment_body)
|
||||
if added_reaction:
|
||||
provider.remove_reaction(comment_id, added_reaction)
|
||||
|
||||
|
||||
elif action == "opened" or 'reopened' in action:
|
||||
pull_request = body.get("pull_request")
|
||||
|
Reference in New Issue
Block a user