From a68ee8ae1c9528b671a1c43898cd9b4875ac455a Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 12 Dec 2024 22:38:03 +0200 Subject: [PATCH 1/2] fix(pyproject.toml): Fix serialization issues with fastapi Upgrade package version to fix beanie/fastapi-users incompatibility with pydantic. Fixing: https://github.com/kernelci/kernelci-api/issues/589 https://github.com/kernelci/kernelci-api/issues/587 Signed-off-by: Denys Fedoryshchenko --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aeb3b0f2..ff1f2c23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,9 +13,10 @@ requires-python = ">=3.10" license = {text = "LGPL-2.1-or-later"} dependencies = [ "cloudevents == 1.9.0", + "beanie == 1.28.0", "fastapi[all] == 0.115.0", "fastapi-pagination == 0.12.30", - "fastapi-users[beanie, oauth] == 13.0.0", + "fastapi-users[beanie, oauth] == 14.0.0", "fastapi-versioning == 0.10.0", "MarkupSafe == 2.0.1", "motor == 3.6.0", From 901f079957b79ac94bd90934de05d12416155a9a Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Fri, 13 Dec 2024 13:18:58 +0200 Subject: [PATCH 2/2] workaround(main.py): Disable doc temporarily As we are experiencing serialization issues, better to disable docs for now, until we figure out solution (and have time). Signed-off-by: Denys Fedoryshchenko --- api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/main.py b/api/main.py index a664dedb..bb2cba87 100644 --- a/api/main.py +++ b/api/main.py @@ -77,7 +77,7 @@ async def lifespan(app: FastAPI): # pylint: disable=redefined-outer-name API_VERSIONS = ['v0'] metrics = Metrics() -app = FastAPI(lifespan=lifespan, debug=True) +app = FastAPI(lifespan=lifespan, debug=True, docs_url=None, redoc_url=None) db = Database(service=(os.getenv('MONGO_SERVICE') or 'mongodb://db:27017')) auth = Authentication(token_url="user/login") pubsub = None # pylint: disable=invalid-name