serJD commited on
Commit
1339ce3
·
verified ·
1 Parent(s): 01a9e73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -219,9 +219,12 @@ async def update_streams(request: Request):
219
  print(payload)
220
  print("============= config ==============")
221
  print(config)
222
- print("============= rest ==============")
223
 
224
  payload = payload["payload"]
 
 
 
225
 
226
  # Check if the payload structure matches the expected format
227
  # Assuming payload["event"]["event_name"] gives you the event type
@@ -231,10 +234,10 @@ async def update_streams(request: Request):
231
  # Extract branchName for commit_update events from the "old" commit data
232
  if event_name == "commit_update":
233
  branchName = payload.get("event", {}).get("data", {}).get("old", {}).get("branchName")
234
- print("payload brnachname", branchName)
235
  else:
236
  branchName = payload.get("event", {}).get("data", {}).get("commit", {}).get("branchName")
237
- print("payload brnachname", branchName)
238
 
239
  # List of valid event types
240
  valid_event_types = ["commit_create", "commit_delete", "commit_update"]
@@ -251,15 +254,14 @@ async def update_streams(request: Request):
251
  else:
252
  print(f"Event type {event_name} is not one of the specified types.")
253
 
 
 
254
  # If the flag is True, continue running the main part of the code
255
  if should_continue:
256
- print("is continuing with branch name: ", branchName, "fin branchname", finalBranchName)
257
  config_entry = config[streamName][branchName]
258
- print("--> selected config subset", config_entry)
259
  STREAM_NAME = config_entry["STREAM_NAME"]
260
  STREAM_ID = config_entry["STREAM_ID"]
261
  SOURCE_BRANCH = config_entry["SOURCE_BRANCH"]
262
- print("--> configEntry Source branch", SOURCE_BRANCH)
263
  TARGET_BRANCH = config_entry["TARGET_BRANCH"]
264
  UUID_COL = config_entry["UUID_COL"]
265
  ATTR_METADATA = config_entry["ATTR_METADATA"]
 
219
  print(payload)
220
  print("============= config ==============")
221
  print(config)
222
+ print("===================================")
223
 
224
  payload = payload["payload"]
225
+
226
+
227
+
228
 
229
  # Check if the payload structure matches the expected format
230
  # Assuming payload["event"]["event_name"] gives you the event type
 
234
  # Extract branchName for commit_update events from the "old" commit data
235
  if event_name == "commit_update":
236
  branchName = payload.get("event", {}).get("data", {}).get("old", {}).get("branchName")
237
+
238
  else:
239
  branchName = payload.get("event", {}).get("data", {}).get("commit", {}).get("branchName")
240
+
241
 
242
  # List of valid event types
243
  valid_event_types = ["commit_create", "commit_delete", "commit_update"]
 
254
  else:
255
  print(f"Event type {event_name} is not one of the specified types.")
256
 
257
+ print("payload branchname", branchName)
258
+
259
  # If the flag is True, continue running the main part of the code
260
  if should_continue:
 
261
  config_entry = config[streamName][branchName]
 
262
  STREAM_NAME = config_entry["STREAM_NAME"]
263
  STREAM_ID = config_entry["STREAM_ID"]
264
  SOURCE_BRANCH = config_entry["SOURCE_BRANCH"]
 
265
  TARGET_BRANCH = config_entry["TARGET_BRANCH"]
266
  UUID_COL = config_entry["UUID_COL"]
267
  ATTR_METADATA = config_entry["ATTR_METADATA"]