Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 36 |
-
if not
|
| 37 |
print("require_human_approval key not found in environment variables.")
|
| 38 |
-
print(f"Using require_human_approval key: {
|
| 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":
|
| 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
|