From 6a86e078b3b93ccd1f5897866399188069639640 Mon Sep 17 00:00:00 2001 From: Tobias Persson Date: Mon, 28 Oct 2024 09:59:50 +0100 Subject: [PATCH] Allow for the passing of a causal event --- python/src/etos_api/routers/etos/router.py | 5 ++++- python/src/etos_api/routers/etos/schemas.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python/src/etos_api/routers/etos/router.py b/python/src/etos_api/routers/etos/router.py index 3e83d00..326babf 100644 --- a/python/src/etos_api/routers/etos/router.py +++ b/python/src/etos_api/routers/etos/router.py @@ -101,7 +101,10 @@ async def _start(etos: StartEtosRequest, span: Span) -> dict: span.set_attribute("etos.artifact.id", artifact_id) span.set_attribute("etos.artifact.identity", identity) - links = {"CAUSE": artifact_id} + if etos.parent_activity is not None: + links = {"CAUSE": [artifact_id, etos.parent_activity]} + else: + links = {"CAUSE": artifact_id} data = { "selectionStrategy": {"tracker": "Suite Builder", "id": str(uuid4())}, "batchesUri": etos.test_suite_url, diff --git a/python/src/etos_api/routers/etos/schemas.py b/python/src/etos_api/routers/etos/schemas.py index f4084e0..19817c2 100644 --- a/python/src/etos_api/routers/etos/schemas.py +++ b/python/src/etos_api/routers/etos/schemas.py @@ -38,6 +38,7 @@ class StartEtosRequest(EtosRequest): artifact_identity: Optional[str] artifact_id: Optional[UUID] = Field(default=None, validate_default=True) + parent_activity: Optional[UUID] = None test_suite_url: str dataset: Optional[Union[dict, list]] = {} execution_space_provider: Optional[str] = os.getenv(