File tree Expand file tree Collapse file tree 3 files changed +750
-150
lines changed
Expand file tree Collapse file tree 3 files changed +750
-150
lines changed Original file line number Diff line number Diff line change @@ -861,6 +861,42 @@ async def scaffold_articles(
861861 "data" : response .json () if response .status_code < 500 else {}
862862 }
863863
864+ async def decide_scaffold (
865+ self ,
866+ * ,
867+ scan_run_id : str ,
868+ decision : str ,
869+ domain : str ,
870+ slack_user_id : str ,
871+ slack_channel_id : str ,
872+ slack_thread_ts : str ,
873+ ) -> dict :
874+ """Approve or deny scaffold creation for a scan run."""
875+ if not self .base_url :
876+ raise ValueError ("MLAI_BACKEND_URL not configured" )
877+
878+ clean_id = self ._clean_slack_id (slack_user_id )
879+ payload = {
880+ "scan_run_id" : scan_run_id ,
881+ "decision" : decision ,
882+ "domain" : domain ,
883+ "slack_user_id" : clean_id ,
884+ "slack_channel_id" : slack_channel_id ,
885+ "slack_thread_ts" : slack_thread_ts ,
886+ }
887+
888+ async with httpx .AsyncClient () as client :
889+ response = await client .post (
890+ f"{ self .base_url } /api/v1/integrations/github/scaffold/decision" ,
891+ json = payload ,
892+ headers = self .headers ,
893+ timeout = 60.0 ,
894+ )
895+ return {
896+ "status_code" : response .status_code ,
897+ "data" : response .json () if response .status_code < 500 else {},
898+ }
899+
864900 async def decide_article_system (
865901 self ,
866902 * ,
You can’t perform that action at this time.
0 commit comments