Buckets:

download
raw
1.31 kB
# src/veronica/rollouts/models.py
"""Rollout pipeline data models."""
from __future__ import annotations
import uuid
from dataclasses import dataclass, field
from datetime import datetime, timezone
from enum import Enum
from typing import Any
from veronica.types import PolicyConfig
class RolloutState(str, Enum):
DRAFT = "draft"
SIMULATED = "simulated"
APPROVED = "approved"
PROMOTED = "promoted"
ACTIVE = "active"
REVOKED = "revoked"
@dataclass
class StateTransition:
from_state: RolloutState
to_state: RolloutState
timestamp: datetime
actor: str
@dataclass
class Rollout:
id: str
policy_config: PolicyConfig
state: RolloutState
created_at: datetime
updated_at: datetime
created_by: str
history: list[StateTransition] = field(default_factory=list)
simulation_result: dict[str, Any] | None = None
def new_rollout(policy_config: PolicyConfig, created_by: str) -> Rollout:
"""Factory: create a new Rollout in DRAFT state."""
now = datetime.now(timezone.utc)
return Rollout(
id=str(uuid.uuid4()),
policy_config=policy_config,
state=RolloutState.DRAFT,
created_at=now,
updated_at=now,
created_by=created_by,
history=[],
simulation_result=None,
)

Xet Storage Details

Size:
1.31 kB
·
Xet hash:
35c1e1a931589366bee2468789f4c2a7dc72f5b90db48e3ef5d0f6d4c90f6f35

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.