Spaces:
Build error
Build error
better logs
Browse files
src/gradio_space_ci/webhook.py
CHANGED
|
@@ -283,18 +283,18 @@ async def trigger_ci_on_pr(payload: WebhookPayload, task_queue: BackgroundTasks)
|
|
| 283 |
# Found a PR that is not yet synced
|
| 284 |
task_queue.add_task(sync_ci_space, space_id=space_id, pr_num=discussion.num)
|
| 285 |
has_task = True
|
| 286 |
-
|
| 287 |
-
# Comment on an open pr by trusted_authors
|
| 288 |
payload.event.scope == "discussion.comment"
|
| 289 |
and payload.event.action == "create"
|
| 290 |
and payload.discussion.isPullRequest
|
| 291 |
and payload.discussion.status == "open"
|
| 292 |
# TODO:
|
| 293 |
-
#
|
| 294 |
-
and payload.discussion.author.id
|
| 295 |
):
|
| 296 |
-
print("
|
| 297 |
-
|
|
|
|
| 298 |
if has_task:
|
| 299 |
return Response("Task scheduled to sync/delete Space", status_code=status.HTTP_202_ACCEPTED)
|
| 300 |
else:
|
|
|
|
| 283 |
# Found a PR that is not yet synced
|
| 284 |
task_queue.add_task(sync_ci_space, space_id=space_id, pr_num=discussion.num)
|
| 285 |
has_task = True
|
| 286 |
+
if (
|
|
|
|
| 287 |
payload.event.scope == "discussion.comment"
|
| 288 |
and payload.event.action == "create"
|
| 289 |
and payload.discussion.isPullRequest
|
| 290 |
and payload.discussion.status == "open"
|
| 291 |
# TODO:
|
| 292 |
+
# figure out how to get the username from the id
|
| 293 |
+
# and payload.discussion.author.id in EPHEMERAL_SPACES_CONFIG["trusted_authors"]
|
| 294 |
):
|
| 295 |
+
print("Comment detected with content:\n ", payload.comment.content)
|
| 296 |
+
|
| 297 |
+
|
| 298 |
if has_task:
|
| 299 |
return Response("Task scheduled to sync/delete Space", status_code=status.HTTP_202_ACCEPTED)
|
| 300 |
else:
|