nikhmr1235 commited on
Commit
9fd9486
·
verified ·
1 Parent(s): 76cf2a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -32,10 +32,10 @@ GITHUB_WEBHOOK_SECRET = os.getenv("GITHUB_WEBHOOK_SECRET")
32
  if not GITHUB_WEBHOOK_SECRET:
33
  raise ValueError("GITHUB_WEBHOOK_SECRET environment variable not set. Please create a .env file.")
34
 
35
- require_human_approval = os.getenv("require_human_approval")
36
- if not require_human_approval:
37
  print("require_human_approval key not found in environment variables.")
38
- print(f"Using require_human_approval key: {require_human_approval}")
39
 
40
 
41
  # --- Build the Graph ---
@@ -175,6 +175,7 @@ async def github_webhook(
175
  """
176
  # Ensure it's a pull_request event first
177
  print("/webhook triggered successfully")
 
178
 
179
  # Handle ping event separately
180
  if x_github_event == "ping":
@@ -251,7 +252,7 @@ async def github_webhook(
251
  "parsed_llm_review_data": None, # Optional field, explicitly set to None if not available
252
  "main_comment_body": None,
253
  "review_status": "initiated", # REQUIRED: Set an initial valid Literal value
254
- "require_human_approval": require_human_approval, # REQUIRED: Set an initial boolean value
255
  "human_approval_status": False, # Optional field
256
  "human_feedback_message": None, # Optional field
257
  "original_review_id": None, # Optional field
 
32
  if not GITHUB_WEBHOOK_SECRET:
33
  raise ValueError("GITHUB_WEBHOOK_SECRET environment variable not set. Please create a .env file.")
34
 
35
+ require_human_approval_from_env = os.getenv("require_human_approval")
36
+ if not require_human_approval_from_env:
37
  print("require_human_approval key not found in environment variables.")
38
+ print(f"Using require_human_approval key: {require_human_approval_from_env}")
39
 
40
 
41
  # --- Build the Graph ---
 
175
  """
176
  # Ensure it's a pull_request event first
177
  print("/webhook triggered successfully")
178
+ nonlocal require_human_approval_from_env
179
 
180
  # Handle ping event separately
181
  if x_github_event == "ping":
 
252
  "parsed_llm_review_data": None, # Optional field, explicitly set to None if not available
253
  "main_comment_body": None,
254
  "review_status": "initiated", # REQUIRED: Set an initial valid Literal value
255
+ "require_human_approval": require_human_approval_from_env, # REQUIRED: Set an initial boolean value
256
  "human_approval_status": False, # Optional field
257
  "human_feedback_message": None, # Optional field
258
  "original_review_id": None, # Optional field