Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(specs): add ga4BigqueryExport, streaming and append options to task inputs #2858

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion specs/ingestion/common/schemas/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SourceSearch:

SourceType:
type: string
enum: ['bigcommerce', 'commercetools', 'json', 'csv', 'bigquery', 'docker']
enum: ['bigcommerce', 'commercetools', 'json', 'csv', 'bigquery', 'docker', 'ga4BigqueryExport']

SourceCommercetools:
type: object
Expand Down Expand Up @@ -261,6 +261,28 @@ SourceCSV:
required:
- url

SourceGA4BigQueryExport:
type: object
additionalProperties: false
properties:
projectID:
type: string
description: GCP project ID that the BigQuery Export writes to.
datasetID:
type: string
description: BigQuery dataset ID that the BigQuery Export writes to.
tablePrefix:
type: string
description: Prefix of the tables that the BigQuery Export writes to (i.e. events_intraday_ for streaming, events_ for daily).
required:
- projectID
- datasetID
JasonBerry marked this conversation as resolved.
Show resolved Hide resolved
- tablePrefix
x-discriminator-fields:
JasonBerry marked this conversation as resolved.
Show resolved Hide resolved
- projectID
- datasetID
- tablePrefix

SourceBigQuery:
type: object
additionalProperties: false
Expand Down Expand Up @@ -356,6 +378,7 @@ SourceInput:
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'
- $ref: '#/SourceBigQuery'
- $ref: '#/SourceGA4BigQueryExport'
- $ref: '#/SourceDocker'

SourceUpdateCommercetools:
Expand Down Expand Up @@ -388,6 +411,7 @@ SourceUpdateInput:
- $ref: '#/SourceJSON'
- $ref: '#/SourceCSV'
- $ref: '#/SourceBigQuery'
- $ref: '#/SourceGA4BigQueryExport'
- $ref: '#/SourceUpdateDocker'

DockerSourceStream:
Expand Down
35 changes: 33 additions & 2 deletions specs/ingestion/common/schemas/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Trigger:
- $ref: '#/OnDemandTrigger'
- $ref: '#/ScheduleTrigger'
- $ref: '#/SubscriptionTrigger'
- $ref: '#/StreamingTrigger'

TaskCreate:
type: object
Expand Down Expand Up @@ -76,6 +77,7 @@ TaskCreateTrigger:
- $ref: '#/OnDemandTriggerInput'
- $ref: '#/ScheduleTriggerInput'
- $ref: '#/SubscriptionTrigger'
- $ref: '#/StreamingTrigger'

TaskCreateResponse:
type: object
Expand Down Expand Up @@ -134,12 +136,13 @@ TaskSearch:
ActionType:
type: string
description: The action to perform on the Algolia index.
enum: ['replace', 'save', 'partial']
enum: ['replace', 'save', 'partial', 'append']

TaskInput:
oneOf:
- $ref: '#/OnDemandDateUtilsInput'
- $ref: '#/ScheduleDateUtilsInput'
- $ref: '#/StreamingUtilsInput'

TriggerInput:
type: object
Expand Down Expand Up @@ -168,7 +171,8 @@ TriggerType:
- onDemand: a task that runs manually
- schedule: a task that runs regularly, following a given cron expression
- subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook).
enum: ['onDemand', 'schedule', 'subscription']
- streaming: a task that runs continuously.
enum: ['onDemand', 'schedule', 'subscription', 'streaming']

# schedule trigger

Expand Down Expand Up @@ -264,6 +268,23 @@ SubscriptionTrigger:
required:
- type

# streaming trigger

StreamingTriggerType:
type: string
description: A task that runs continuously.
enum: ['streaming']

StreamingTrigger:
type: object
additionalProperties: false
description: The trigger input for a task of type 'streaming'.
properties:
type:
$ref: '#/StreamingTriggerType'
required:
- type

# Task input

MappingFieldDirective:
Expand Down Expand Up @@ -353,6 +374,16 @@ ScheduleDateUtilsInput:
required:
- timeframe

StreamingUtilsInput:
type: object
additionalProperties: false
description: The input for a `streaming` task whose source is of type `ga4BigqueryExport` and for which extracted data is continuously streamed.
properties:
mapping:
$ref: '#/MappingInput'
required:
- mapping

failureThreshold:
type: integer
minimum: 0
Expand Down
8 changes: 4 additions & 4 deletions specs/ingestion/common/taskParameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ action:
description: An array of actions to perform on the Algolia index.
items:
$ref: './schemas/task.yml#/ActionType'
example: save,replace
example: save,replace,partial,append

sourceID:
name: sourceID
in: query
description: The sourceIDs of the tasks to retrive.
description: The sourceIDs of the tasks to retrieve.
JasonBerry marked this conversation as resolved.
Show resolved Hide resolved
required: false
style: form
explode: false
Expand All @@ -35,7 +35,7 @@ sourceID:
destinationID:
name: destinationID
in: query
description: The destinationIDs of the tasks to retrive.
description: The destinationIDs of the tasks to retrieve.
required: false
style: form
explode: false
Expand All @@ -55,7 +55,7 @@ triggerType:
type: array
items:
$ref: './schemas/task.yml#/TriggerType'
example: onDemand,schedule
example: onDemand,schedule,subscription,streaming

sort:
name: sort
Expand Down
Loading