From 6c62a81a7c20e499c818fdd9c1f11a223a8b9290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 7 Aug 2024 12:43:53 +0200 Subject: [PATCH] fix(specs): ingestion docker task input (#3488) --- specs/ingestion/common/schemas/task.yml | 26 ++++++++++++- .../transformations/transformationsTry.yml | 2 +- tests/CTS/requests/ingestion/createTask.json | 35 +++++++++++++++++ .../CTS/requests/ingestion/createTaskV1.json | 39 +++++++++++++++++++ ...formations.json => tryTransformation.json} | 0 5 files changed, 100 insertions(+), 2 deletions(-) rename tests/CTS/requests/ingestion/{tryTransformations.json => tryTransformation.json} (100%) diff --git a/specs/ingestion/common/schemas/task.yml b/specs/ingestion/common/schemas/task.yml index a383b825ee..0992d6a5d7 100644 --- a/specs/ingestion/common/schemas/task.yml +++ b/specs/ingestion/common/schemas/task.yml @@ -460,10 +460,34 @@ DockerStreamsInput: type: object properties: streams: - type: object + type: array + items: + $ref: '#/DockerStreams' required: - streams +DockerStreams: + type: object + properties: + name: + type: string + description: The name of the stream to fetch the data from (e.g. table name). + properties: + type: array + description: The properties of the stream to select (e.g. column). + items: + type: string + syncMode: + $ref: '#/DockerStreamsSyncMode' + required: + - name + - syncMode + +DockerStreamsSyncMode: + type: string + description: The strategy to use to fetch the data. + enum: [incremental, fullTable] + failureThreshold: type: integer minimum: 0 diff --git a/specs/ingestion/paths/transformations/transformationsTry.yml b/specs/ingestion/paths/transformations/transformationsTry.yml index 2e2567bbf6..2f4c61ef24 100644 --- a/specs/ingestion/paths/transformations/transformationsTry.yml +++ b/specs/ingestion/paths/transformations/transformationsTry.yml @@ -3,7 +3,7 @@ post: - transformations summary: Try a transformation description: Try a transformation. - operationId: tryTransformations + operationId: tryTransformation x-acl: - addObject - deleteIndex diff --git a/tests/CTS/requests/ingestion/createTask.json b/tests/CTS/requests/ingestion/createTask.json index 4c20362ed0..3daa050891 100644 --- a/tests/CTS/requests/ingestion/createTask.json +++ b/tests/CTS/requests/ingestion/createTask.json @@ -34,5 +34,40 @@ "action": "replace" } } + }, + { + "testName": "task shopify", + "parameters": { + "sourceID": "search", + "destinationID": "destinationName", + "cron": "* * * * *", + "action": "replace", + "input": { + "streams": [ + { + "name": "foo", + "syncMode": "incremental" + } + ] + } + }, + "request": { + "path": "/2/tasks", + "method": "POST", + "body": { + "sourceID": "search", + "destinationID": "destinationName", + "cron": "* * * * *", + "action": "replace", + "input": { + "streams": [ + { + "name": "foo", + "syncMode": "incremental" + } + ] + } + } + } } ] diff --git a/tests/CTS/requests/ingestion/createTaskV1.json b/tests/CTS/requests/ingestion/createTaskV1.json index 81c5c1e8ff..091fa6bfee 100644 --- a/tests/CTS/requests/ingestion/createTaskV1.json +++ b/tests/CTS/requests/ingestion/createTaskV1.json @@ -69,5 +69,44 @@ "action": "replace" } } + }, + { + "testName": "task shopify", + "parameters": { + "sourceID": "search", + "destinationID": "destinationName", + "trigger": { + "type": "onDemand" + }, + "action": "replace", + "input": { + "streams": [ + { + "name": "foo", + "syncMode": "incremental" + } + ] + } + }, + "request": { + "path": "/1/tasks", + "method": "POST", + "body": { + "sourceID": "search", + "destinationID": "destinationName", + "trigger": { + "type": "onDemand" + }, + "action": "replace", + "input": { + "streams": [ + { + "name": "foo", + "syncMode": "incremental" + } + ] + } + } + } } ] diff --git a/tests/CTS/requests/ingestion/tryTransformations.json b/tests/CTS/requests/ingestion/tryTransformation.json similarity index 100% rename from tests/CTS/requests/ingestion/tryTransformations.json rename to tests/CTS/requests/ingestion/tryTransformation.json