@@ -191,6 +191,8 @@ async def import_objects_from_files(
191191                    branch_name = infrahub_branch_name , commit = commit , config_file = config_file 
192192                )  # type: ignore[misc] 
193193
194+                 await  self .import_objects (branch_name = infrahub_branch_name , commit = commit , config_file = config_file )  # type: ignore[misc] 
195+ 
194196                await  self .import_all_python_files (  # type: ignore[call-overload] 
195197                    branch_name = infrahub_branch_name , commit = commit , config_file = config_file 
196198                )  # type: ignore[misc] 
@@ -200,7 +202,9 @@ async def import_objects_from_files(
200202                await  self .import_artifact_definitions (
201203                    branch_name = infrahub_branch_name , commit = commit , config_file = config_file 
202204                )  # type: ignore[misc] 
203-                 await  self .import_objects (branch_name = infrahub_branch_name , commit = commit , config_file = config_file )  # type: ignore[misc] 
205+ 
206+                 # TODO: import menu, check def load() in menu.^y + add a deidcated group for menu, work as for objects 
207+                 # "CoreRepositoryMenuGroup" 
204208
205209        except  Exception  as  exc :
206210            sync_status  =  RepositorySyncStatus .ERROR_IMPORT 
@@ -838,16 +842,35 @@ async def _load_objects(
838842        for  file  in  files :
839843            await  file .validate_format (client = self .client , branch = branch )
840844        for  file  in  files :
845+             # check if we log by default otherwise log 
846+ 
847+             # TODO: do not create if no hfid/default_filter 
841848            await  file .process (client = self .client , branch = branch )
842849
843850    @task (name = "import-objects" , task_run_name = "Import Objects" , cache_policy = NONE )  # type: ignore[arg-type]  
844851    async  def  import_objects (self , branch_name : str , commit : str , config_file : InfrahubRepositoryConfig ) ->  None :
845852        branch_wt  =  self .get_worktree (identifier = commit  or  branch_name )
846853
847854        file_pathes  =  [branch_wt .directory  /  obj .file_path  for  obj  in  config_file .objects ]
848-         await  self ._load_objects (paths = file_pathes , branch = branch_name )
849855
850-         # TODO attach to a group? 
856+         # do not clone for now, assume only one import at a time 
857+         if  self .client  is  None :
858+             raise  ValueError ("Client is not set" )
859+ 
860+         if  self .is_read_only :
861+             sdk_repo_obj  =  await  self .client .get (
862+                 kind = InfrahubKind .READONLYREPOSITORY , id = str (self .id ), raise_when_missing = True 
863+             )
864+         else :
865+             sdk_repo_obj  =  await  self .client .get (kind = InfrahubKind .REPOSITORY , id = str (self .id ), raise_when_missing = True )
866+ 
867+         async  with  self .client .start_tracking (
868+             identifier = f"group-repo-{ self .id }  " ,
869+             delete_unused_nodes = True ,
870+             group_type = "CoreRepositoryGroup" ,
871+             group_params = {"content" : "Objects" , "repository" : sdk_repo_obj },
872+         ):
873+             await  self ._load_objects (paths = file_pathes , branch = branch_name )
851874
852875    @task (name = "check-definition-get" , task_run_name = "Get Check Definition" , cache_policy = NONE )  # type: ignore[arg-type]  
853876    async  def  get_check_definition (
0 commit comments