@@ -92,6 +92,7 @@ async def handle_webhook(
9292 payload : MergeRequestPayload | PipelinePayload | EmojiPayload ,
9393 x_conversation_token : Annotated [str , Header ()],
9494 x_gitlab_token : Annotated [str , Header ()],
95+ filter_on_participant_ids : str | None = None ,
9596):
9697 validate_gitlab_token (x_gitlab_token )
9798 conversation_tokens = list (
@@ -100,9 +101,20 @@ async def handle_webhook(
100101 [validate_uuid (ct .strip ()) for ct in x_conversation_token .split ("," )],
101102 )
102103 )
104+
103105 try :
104106 if isinstance (payload , MergeRequestPayload ):
105- await webhook .merge_request (payload , conversation_tokens )
107+ participant_ids_filter : list [int ] = []
108+ if filter_on_participant_ids :
109+ try :
110+ participant_ids_filter = [int (entry ) for entry in filter_on_participant_ids .split ("," )]
111+ except ValueError :
112+ raise HTTPException (
113+ status_code = 400 ,
114+ detail = "filter_on_participant_ids must be a list of comma separated integers" ,
115+ )
116+
117+ await webhook .merge_request (payload , conversation_tokens , participant_ids_filter )
106118 if isinstance (payload , PipelinePayload ):
107119 await webhook .pipeline (payload , conversation_tokens )
108120 if isinstance (payload , EmojiPayload ):
0 commit comments