From aff12753dab4339c6152251172a60b1948e202dd Mon Sep 17 00:00:00 2001 From: dongli Date: Thu, 19 Jun 2025 21:08:08 -0700 Subject: [PATCH 1/2] Add deployment_app_url --- apps/devops/app/common/models/deployment/deployment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/devops/app/common/models/deployment/deployment.py b/apps/devops/app/common/models/deployment/deployment.py index 4d9a9e1..b9a3619 100644 --- a/apps/devops/app/common/models/deployment/deployment.py +++ b/apps/devops/app/common/models/deployment/deployment.py @@ -24,6 +24,7 @@ class Deployment(Document): deployment_git_url: str deployment_git_sha256: str deployment_reason: str + deployment_app_url: str = "" # URL to access the deployed application, keep it empty to be filled later deployed_by: str created_at: datetime = datetime.now() From 2934c647c6841551530082ce1a85e9c75640b27d Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 20 Jun 2025 15:09:27 -0700 Subject: [PATCH 2/2] make sha256 optional --- apps/devops/app/common/models/deployment/deployment.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/devops/app/common/models/deployment/deployment.py b/apps/devops/app/common/models/deployment/deployment.py index b9a3619..d4b9982 100644 --- a/apps/devops/app/common/models/deployment/deployment.py +++ b/apps/devops/app/common/models/deployment/deployment.py @@ -2,7 +2,6 @@ from datetime import datetime, timedelta from typing import Literal, List from beanie import Document -from bson import ObjectId from pydantic import Field, field_validator from pydantic import BaseModel from pymongo import IndexModel @@ -40,8 +39,8 @@ class Deployment(Document): class InitDeploymentRequest(BaseModel): product_id: str - sha256: str - target_env: str + sha256: str = "" + target_env: Literal["alpha", "prod"] user_id: str reason: str = "not provided" ttl_hours: int = 3 @@ -53,7 +52,7 @@ class CheckDeploymentStatusRequest(BaseModel): class CheckApplicationLogsRequest(BaseModel): product_id: str - target_env: Literal["alpha", "prod"] = "alpha" + target_env: Literal["alpha", "prod"] user_id: str = '' log_level: List[Literal["info", "error", "debug"]] = Field(default_factory=lambda: ["info"]) start_time: datetime = datetime.now() - timedelta(minutes=5)