Commit 290526c9 authored by Dimitrios Gogos's avatar Dimitrios Gogos
Browse files

feat: enhance CloudEvent ID type to string

parent 526c1891
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ dev = [
    "pytest>=9.0.2",
    "pytest-asyncio>=0.24",
    "pytest-cov>=6.0.0",
    "pyyaml>=6.0.1",
    "ruff>=0.15.6",
    "schemathesis>=4.22",
    "testcontainers>=4.0.0",
+650 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -646,7 +646,7 @@ def build_app_instance_status_change_event(
    occurred_at: str,
) -> AppInstanceStatusChangeCloudEvent:
    return AppInstanceStatusChangeCloudEvent(
        id=uuid4(),
        id=str(uuid4()),
        source=_CALLBACK_EVENT_SOURCE,
        time=occurred_at,
        data=AppInstanceStatusChangeData(
+4 −7
Original line number Diff line number Diff line
@@ -333,13 +333,10 @@ class AppInstanceStatusChangeData(BaseModel):


class AppInstanceStatusChangeCloudEvent(BaseModel):
    # CloudEvents v1.0 attributes, per the vendored spec's onAppInstanceStatusChange
    # callback (ADR-0008). The referenced ../common/CAMARA_event_common.yaml
    # defining the shared CloudEvent schema is not itself vendored into this repo;
    # this shape is transcribed from the worked example in
    # architecture/oeg/app-instance-flow.md instead.
    id: UUID
    source: str
    # CloudEvents v1.0 attributes, per the vendored CAMARA_event_common.yaml
    # CloudEvent schema (../common/CAMARA_event_common.yaml).
    id: str = Field(max_length=256)
    source: str = Field(min_length=1, max_length=2048)
    specversion: str = "1.0"
    type: str = "org.camaraproject.edge-application-management.v0.app-instance-status-change"
    time: str
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ HttpHandler = Callable[[httpx.Request], httpx.Response]
SINK = "https://consumer.example.com/callbacks"

EVENT = AppInstanceStatusChangeCloudEvent(
    id=uuid4(),
    id=str(uuid4()),
    source="oeg",
    time="2026-07-29T00:00:00Z",
    data=AppInstanceStatusChangeData(
Loading