From 2934c647c6841551530082ce1a85e9c75640b27d Mon Sep 17 00:00:00 2001 From: dongli Date: Fri, 20 Jun 2025 15:09:27 -0700 Subject: [PATCH] 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)