This commit is contained in:
Slipstream 2025-05-09 17:21:40 -06:00
parent 6bc445f249
commit e3decb81d8
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 8 additions and 0 deletions

View File

@ -522,6 +522,10 @@ app.mount("/dashboard/api", dashboard_api_app) # Mount the new dashboard API
try: try:
from webhook_endpoints import router as webhook_router # Relative import from webhook_endpoints import router as webhook_router # Relative import
app.mount("/webhook", webhook_router) # Mount directly on the main app for simplicity app.mount("/webhook", webhook_router) # Mount directly on the main app for simplicity
# After mounting the webhook router
log.info("Available routes in webhook_router:")
for route in webhook_router.routes:
log.info(f" {route.path} - {route.name} - {route.methods}")
# Or, if you prefer to nest it under /api: # Or, if you prefer to nest it under /api:
# api_app.include_router(webhook_router, prefix="/webhooks", tags=["Webhooks"]) # api_app.include_router(webhook_router, prefix="/webhooks", tags=["Webhooks"])
log.info("Webhook endpoints loaded and mounted successfully at /webhook") log.info("Webhook endpoints loaded and mounted successfully at /webhook")

View File

@ -333,3 +333,7 @@ async def webhook_gitlab(
else: else:
log.error(f"Failed to send GitLab webhook notification for repo {repo_db_id}. Error: {send_result.get('message')}") log.error(f"Failed to send GitLab webhook notification for repo {repo_db_id}. Error: {send_result.get('message')}")
return {"status": "error", "message": f"Webhook received, but notification failed: {send_result.get('message')}"} return {"status": "error", "message": f"Webhook received, but notification failed: {send_result.get('message')}"}
@router.get("/test")
async def test_webhook_router():
return {"message": "Webhook router is working. Or mounted, at least."}