11use crate :: {
2- lib_context:: { FlowExecutionContext , LibSetupContext , get_auth_registry } ,
2+ lib_context:: { FlowContext , FlowExecutionContext , LibSetupContext } ,
33 ops:: {
44 get_optional_executor_factory,
55 interface:: { ExportTargetFactory , FlowInstanceContext } ,
@@ -411,7 +411,7 @@ async fn maybe_update_resource_setup<
411411
412412async fn apply_changes_for_flow (
413413 write : & mut ( dyn std:: io:: Write + Send ) ,
414- flow_name : & str ,
414+ flow_ctx : & FlowContext ,
415415 flow_status : & FlowSetupStatus ,
416416 existing_setup_state : & mut Option < setup:: FlowSetupState < setup:: ExistingMode > > ,
417417 pool : & PgPool ,
@@ -425,7 +425,7 @@ async fn apply_changes_for_flow(
425425 ObjectStatus :: Existing => "Updating resources for " ,
426426 _ => bail ! ( "invalid flow status" ) ,
427427 } ;
428- write ! ( write, "\n {verb} flow {flow_name }:\n " ) ?;
428+ write ! ( write, "\n {verb} flow {}:\n " , flow_ctx . flow_name ( ) ) ?;
429429
430430 let mut update_info =
431431 HashMap :: < db_metadata:: ResourceTypeKey , db_metadata:: StateUpdateInfo > :: new ( ) ;
@@ -475,7 +475,7 @@ async fn apply_changes_for_flow(
475475 }
476476
477477 let new_version_id = db_metadata:: stage_changes_for_flow (
478- flow_name,
478+ flow_ctx . flow_name ( ) ,
479479 flow_status. seen_flow_metadata_version ,
480480 & update_info,
481481 pool,
@@ -517,7 +517,7 @@ async fn apply_changes_for_flow(
517517 setup_status : s. setup_status . as_ref ( ) ,
518518 } )
519519 . collect ( ) ,
520- get_auth_registry ( ) ,
520+ flow_ctx . flow . flow_instance_ctx . clone ( ) ,
521521 )
522522 . await ?;
523523 Ok ( ( ) )
@@ -528,7 +528,7 @@ async fn apply_changes_for_flow(
528528
529529 let is_deletion = status == ObjectStatus :: Deleted ;
530530 db_metadata:: commit_changes_for_flow (
531- flow_name,
531+ flow_ctx . flow_name ( ) ,
532532 new_version_id,
533533 & update_info,
534534 is_deletion,
@@ -580,7 +580,7 @@ async fn apply_changes_for_flow(
580580 } ) ;
581581 }
582582
583- writeln ! ( write, "Done for flow {flow_name}" ) ?;
583+ writeln ! ( write, "Done for flow {}" , flow_ctx . flow_name ( ) ) ?;
584584 Ok ( ( ) )
585585}
586586
@@ -734,7 +734,7 @@ impl SetupChangeBundle {
734734 let mut flow_states = setup_ctx. all_setup_states . flows . remove ( flow_name) ;
735735 apply_changes_for_flow (
736736 write,
737- flow_name ,
737+ & flow_ctx ,
738738 setup_status,
739739 & mut flow_states,
740740 & persistence_ctx. builtin_db_pool ,
0 commit comments