@@ -38,7 +38,7 @@ def remove_symbols_and_title_case(input_string: str) -> str:
38
38
return title_case_string
39
39
40
40
async def sync_applications (self ) -> None :
41
- logger .info ("Started syncing applications " )
41
+ logger .info (f"Syncing entities for blueprint { BLUEPRINT . APPLICATION } " )
42
42
applications = await self .humanitec_client .get_all_applications ()
43
43
44
44
def create_entity (application ):
@@ -58,9 +58,10 @@ def create_entity(application):
58
58
]
59
59
60
60
await asyncio .gather (* tasks )
61
+ logger .info (f"Finished syncing entities for blueprint { BLUEPRINT .APPLICATION } " )
61
62
62
63
async def sync_environments (self ) -> None :
63
-
64
+ logger . info ( f"Syncing entities for blueprint { BLUEPRINT . ENVIRONMENT } " )
64
65
applications = await self .humanitec_client .get_all_applications ()
65
66
66
67
def create_entity (application , environment ):
@@ -95,8 +96,10 @@ def create_entity(application, environment):
95
96
for environment in environments
96
97
]
97
98
await asyncio .gather (* tasks )
99
+ logger .info (f"Finished syncing entities for blueprint { BLUEPRINT .ENVIRONMENT } " )
98
100
99
101
async def sync_workloads (self ):
102
+ logger .info (f"Syncing entities for blueprint { BLUEPRINT .WORKLOAD } " )
100
103
def create_workload_entity (resource ):
101
104
return {
102
105
"identifier" : resource ["res_id" ].replace ("modules." , "" ),
@@ -124,9 +127,6 @@ def create_workload_entity(resource):
124
127
resources = await self .humanitec_client .get_all_resources (
125
128
application , environment
126
129
)
127
- logger .info (
128
- f"Received resources batch with size { len (resources )} from app: { application ['name' ]} and env: { environment ['name' ]} "
129
- )
130
130
resource_group = humanitec_client .group_resources_by_type (resources )
131
131
tasks = [
132
132
self .port_client .upsert_entity (
@@ -137,8 +137,10 @@ def create_workload_entity(resource):
137
137
if resource and resource ["type" ] == "workload"
138
138
]
139
139
await asyncio .gather (* tasks )
140
+ logger .info (f"Finished syncing entities for blueprint { BLUEPRINT .WORKLOAD } " )
140
141
141
142
async def sync_resource_graphs (self ) -> None :
143
+ logger .info (f"Syncing entities for blueprint { BLUEPRINT .RESOURCE_GRAPH } " )
142
144
def get_resource_graph_request_body (modules ):
143
145
return [
144
146
{
@@ -207,6 +209,7 @@ def create_resource_graph_entity(graph_data, include_relations):
207
209
for graph_data in resource_graph
208
210
]
209
211
await asyncio .gather (* tasks )
212
+ logger .info (f"Finished syncing entities for blueprint { BLUEPRINT .RESOURCE_GRAPH } " )
210
213
211
214
async def enrich_resource_with_graph (self , resource , application , environment ):
212
215
data = {
@@ -224,6 +227,7 @@ async def enrich_resource_with_graph(self, resource, application, environment):
224
227
return resource
225
228
226
229
async def sync_resources (self ) -> None :
230
+ logger .info (f"Syncing entities for blueprint { BLUEPRINT .RESOURCE } " )
227
231
def create_resource_entity (resource ):
228
232
workload_id = (
229
233
resource ["res_id" ].split ("." )[1 ]
@@ -284,6 +288,7 @@ async def fetch_resources(application, environment):
284
288
for resource in all_resources
285
289
]
286
290
await asyncio .gather (* entity_tasks )
291
+ logger .info (f"Finished syncing entities for blueprint { BLUEPRINT .RESOURCE } " )
287
292
288
293
async def sync_all (self ) -> None :
289
294
await self .sync_applications ()
0 commit comments