Skip to content

Commit

Permalink
🐛 Source Onesignal: Update connectors spec; fix incremental sync (#24076
Browse files Browse the repository at this point in the history
)

* Source Onesignal: Update connectors spec; fix incremental sync

* Source Onesignal: Update connectors spec; fix incremental sync

* Source Onesignal: fix unit tests

* Source Onesignal: fix tests

* Source Onesignal: update config

* Source Onesignal: update schemas

* Source Onesignal: add order

* Source Onesignal: update docs

* Source Onesignal: bump version

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
2 people authored and erohmensing committed Mar 22, 2023
1 parent 1aaa221 commit 2a66839
Show file tree
Hide file tree
Showing 21 changed files with 276 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@
- name: OneSignal
sourceDefinitionId: bb6afd81-87d5-47e3-97c4-e2c2901b1cf8
dockerRepository: airbyte/source-onesignal
dockerImageTag: 0.1.2
dockerImageTag: 1.0.0
documentationUrl: https://docs.airbyte.com/integrations/sources/onesignal
icon: onesignal.svg
sourceType: api
Expand Down
37 changes: 34 additions & 3 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10387,25 +10387,53 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-onesignal:0.1.2"
- dockerImage: "airbyte/source-onesignal:1.0.0"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/onesignal"
connectionSpecification:
$schema: "http://json-schema.org/draft-07/schema#"
$schema: "https://json-schema.org/draft-07/schema#"
title: "OneSignal Source Spec"
type: "object"
required:
- "user_auth_key"
- "start_date"
- "outcome_names"
additionalProperties: false
- "applications"
additionalProperties: true
properties:
user_auth_key:
type: "string"
title: "User Auth Key"
description: "OneSignal User Auth Key, see the <a href=\"https://documentation.onesignal.com/docs/accounts-and-keys#user-auth-key\"\
>docs</a> for more information on how to obtain this key."
airbyte_secret: true
order: 0
applications:
type: "array"
title: "Applications"
description: "Applications keys, see the <a href=\"https://documentation.onesignal.com/docs/accounts-and-keys\"\
>docs</a> for more information on how to obtain this data"
items:
type: "object"
properties:
app_name:
type: "string"
title: "OneSignal App Name"
order: 0
app_id:
type: "string"
title: "OneSignal App ID"
order: 1
airbyte_secret: true
app_api_key:
type: "string"
title: "REST API Key"
order: 2
airbyte_secret: true
required:
- "app_id"
- "app_api_key"
order: 1
start_date:
type: "string"
title: "Start Date"
Expand All @@ -10415,6 +10443,8 @@
examples:
- "2020-11-16T00:00:00Z"
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
format: "date-time"
order: 2
outcome_names:
type: "string"
title: "Outcome Names"
Expand All @@ -10423,6 +10453,7 @@
>docs</a> for more details"
examples:
- "os__session_duration.count,os__click.count,CustomOutcomeName.sum"
order: 3
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_onesignal ./source_onesignal
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.2
LABEL io.airbyte.version=1.0.0
LABEL io.airbyte.name=airbyte/source-onesignal
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ connector_image: airbyte/source-onesignal:dev
tests:
spec:
- spec_path: "source_onesignal/spec.json"
backward_compatibility_tests_config:
disable_for_version: "0.1.2"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
backward_compatibility_tests_config:
disable_for_version: "0.1.2"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: no
exact_order: no
extra_records: yes
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state_path: "integration_tests/abnormal_state.json"
empty_streams: ["devices", "notifications"]
# TODO: enable incremental test after seeding the connector
# incremental:
# - config_path: "secrets/config.json"
# configured_catalog_path: "integration_tests/configured_catalog.json"
# future_state_path: "integration_tests/abnormal_state.json"
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"devices": {
"created_at": 33190962600
[
{
"type": "STREAM",
"stream": {
"stream_state": { "8d466489-38af-4067-a6b8-2645ad83f4c2": { "last_active": 2598826148 }},
"stream_descriptor": { "name": "devices" }
}
},
"notifications": {
"queued_at": 33190962600
{
"type": "STREAM",
"stream": {
"stream_state": { "8d466489-38af-4067-a6b8-2645ad83f4c2": { "last_active": 2598826148 }},
"stream_descriptor": { "name": "notifications" }
}
}
}
]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"stream": {
"name": "devices",
"json_schema": {},
"supported_sync_modes": ["incremental"]
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
Expand All @@ -22,7 +22,7 @@
"stream": {
"name": "notifications",
"json_schema": {},
"supported_sync_modes": ["incremental"]
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"user_auth_key": "some auth key",
"start_date": "2021-04-01T04:20:02Z",
"outcome_names": "os__click.count"
"outcome_names": "os__click.count",
"applications": [
{
"app_name": "test_app",
"app_id": "fake_app_id",
"app_api_key": "fake_app_api_key"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"devices": {
"created_at": 1580510247
[
{
"type": "STREAM",
"stream": {
"stream_state": { "fake_app_id": { "last_active": 1598826147 }},
"stream_descriptor": { "name": "devices" }
}
},
"notifications": {
"queued_at": 1580510247
{
"type": "STREAM",
"stream": {
"stream_state": { "fake_app_id": { "last_active": 1598826147 }},
"stream_descriptor": { "name": "notifications" }
}
}
}
]
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
"type": ["null", "string"]
},
"name": {
"type": ["null", "string"]
},
"players": {
"type": "integer"
"type": ["null", "integer"]
},
"messageable_players": {
"type": "integer"
"type": ["null", "integer"]
},
"updated_at": {
"type": ["null", "string"]
"type": ["null", "string"],
"format": "date-time"
},
"created_at": {
"type": ["null", "string"]
"type": ["null", "string"],
"format": "date-time"
},
"gcm_key": {
"type": ["null", "string"]
Expand Down Expand Up @@ -76,7 +77,7 @@
"type": ["null", "string"]
},
"basic_auth_key": {
"type": "string"
"type": ["null", "string"]
},
"additional_data_is_root_payload": {
"type": ["null", "boolean"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "https://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
Expand Down Expand Up @@ -35,7 +34,6 @@
},
"tags": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {}
},
"last_active": {
Expand Down
Loading

0 comments on commit 2a66839

Please sign in to comment.