Update gitlab_webhook.py

This commit is contained in:
Tal
2025-07-05 09:07:47 +03:00
committed by GitHub
parent a3d52f9cc7
commit 34cc434459

View File

@ -237,7 +237,6 @@ async def gitlab_webhook(background_tasks: BackgroundTasks, request: Request):
# Apply repo settings before checking push commands or handle_push_trigger
apply_repo_settings(url)
commands_on_push = get_settings().get(f"gitlab.push_commands", {})
commands_on_push = get_settings().get(f"gitlab.push_commands", {})
handle_push_trigger = get_settings().get(f"gitlab.handle_push_trigger", False)
if not commands_on_push or not handle_push_trigger:
@ -286,8 +285,8 @@ def handle_ask_line(body, data):
question = body.replace('/ask', '').strip()
path = data['object_attributes']['position']['new_path']
side = 'RIGHT' # if line_range_['start']['type'] == 'new' else 'LEFT'
comment_id = data['object_attributes']["discussion_id"]
get_logger().info("Handling line comment")
_id = data['object_attributes']["discussion_id"]
get_logger().info("Handling line ")
body = f"/ask_line --line_start={start_line} --line_end={end_line} --side={side} --file_name={path} --comment_id={comment_id} {question}"
except Exception as e:
get_logger().error(f"Failed to handle ask line comment: {e}")