Skip to content

Commit

Permalink
feat: keep manual comments working when commenting draft MRs
Browse files Browse the repository at this point in the history
  • Loading branch information
paolomainardi authored Aug 26, 2024
1 parent 6a5ff2f commit c9ed271
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pr_agent/servers/gitlab_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ async def inner(data: dict):
if 'merge_request' in data:
mr = data['merge_request']
url = mr.get('url')
draft = mr.get('draft')
if draft:
get_logger().info(f"Skipping draft MR: {url}")
return JSONResponse(status_code=status.HTTP_200_OK, content=jsonable_encoder({"message": "success"}))


get_logger().info(f"A comment has been added to a merge request: {url}")
body = data.get('object_attributes', {}).get('note')
if data.get('object_attributes', {}).get('type') == 'DiffNote' and '/ask' in body: # /ask_line
Expand Down

0 comments on commit c9ed271

Please sign in to comment.