From e1c32b6a20e3b4aca2ae399411909a7cc1279737 Mon Sep 17 00:00:00 2001 From: Piotr Dec Date: Wed, 8 Oct 2025 01:12:12 +0200 Subject: [PATCH] CI API --- app/api/models.py | 15 +++++++++++++++ app/api/v1.py | 13 ++++++++++++- app/services/ci.py | 0 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app/api/models.py delete mode 100644 app/services/ci.py diff --git a/app/api/models.py b/app/api/models.py new file mode 100644 index 0000000..35afedb --- /dev/null +++ b/app/api/models.py @@ -0,0 +1,15 @@ +from dataclasses import dataclass +from typing import List + + +@dataclass +class Request: + build_id: str + build_url: str + commit_id: str + commit_url: str + changelist: List[str] + +@dataclass +class Response: + status: int diff --git a/app/api/v1.py b/app/api/v1.py index 1cd9f50..fc52bd4 100644 --- a/app/api/v1.py +++ b/app/api/v1.py @@ -1,8 +1,19 @@ from fastapi import APIRouter +from app.api.models import Request, Response + router = APIRouter() @router.get("/", summary="Main API") async def root(): - return {"message": "Witaj w API v12"} + return {"message": "Witaj w API v1"} + + +@router.get("/health", summary="Health check") +async def health(): + return {"status": "ok"} + +@router.post("/ci", summary="CI Webhook") +async def ci(request: Request): + return Response(200) diff --git a/app/services/ci.py b/app/services/ci.py deleted file mode 100644 index e69de29..0000000