Skip to content

Commit b7b6507

Browse files
albert-marreroGreeneWoodsmarcosmarxm
authored
🎉 New Source: Zapier Supported Storage (#18442)
* generating app * updating spec * updating template * initial connection confirmed * updating configured catalog * updating names to better reflect endpoint secret_key -> secret * removing unnecessary schemas * successful read from connector * Updated Airbyte Intergrations Build, Updated Intergrations ReadME Updated, Added Zapier Supported Storage in Intergrations * generating app * updating spec * updating template * initial connection confirmed * updating configured catalog * updating names to better reflect endpoint secret_key -> secret * removing unnecessary schemas * successful read from connector * Did all the changes the reviewer wanted. * Update docs/integrations/README.md Co-authored-by: Marcos Marx <[email protected]> * updated pending errors in markdown and sample config * including the md here as well * updating invalid_config * updating abnormal state * updated configured catalogue * updated schema among other things * all tests passed * Update Zapier Intergration Docs * run format * update doc * add lines * add zapier supported storage to source def * run airbyte cnfig process Co-authored-by: Ben <[email protected]> Co-authored-by: Marcos Marx <[email protected]> Co-authored-by: marcosmarxm <[email protected]>
1 parent 77c7d3e commit b7b6507

26 files changed

+405
-0
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,13 @@
13781378
icon: wrike.svg
13791379
sourceType: api
13801380
releaseStage: alpha
1381+
- name: Zapier Supported Storage
1382+
sourceDefinitionId: b8c917bc-7d1b-4828-995f-6726820266d0
1383+
dockerRepository: airbyte/source-zapier-supported-storage
1384+
dockerImageTag: 0.1.0
1385+
documentationUrl: https://docs.airbyte.com/integrations/sources/zendesk-supported-storage
1386+
sourceType: api
1387+
releaseStage: alpha
13811388
- name: Zendesk Chat
13821389
sourceDefinitionId: 40d24d0f-b8f9-4fe0-9e6c-b06c0f3f45e4
13831390
dockerRepository: airbyte/source-zendesk-chat

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13105,6 +13105,25 @@
1310513105
supportsNormalization: false
1310613106
supportsDBT: false
1310713107
supported_destination_sync_modes: []
13108+
- dockerImage: "airbyte/source-zapier-supported-storage:0.1.0"
13109+
spec:
13110+
documentationUrl: "https://docs.airbyte.com/integrations/sources/zapier-supported-storage"
13111+
connectionSpecification:
13112+
$schema: "http://json-schema.org/draft-07/schema#"
13113+
title: "Zapier Supported Storage Spec"
13114+
type: "object"
13115+
required:
13116+
- "secret"
13117+
additionalProperties: true
13118+
properties:
13119+
secret:
13120+
title: "Secret Key"
13121+
type: "string"
13122+
description: "Secret key supplied by zapier"
13123+
airbyte_secret: true
13124+
supportsNormalization: false
13125+
supportsDBT: false
13126+
supported_destination_sync_modes: []
1310813127
- dockerImage: "airbyte/source-zendesk-chat:0.1.11"
1310913128
spec:
1311013129
documentationUrl: "https://docs.airbyte.com/integrations/sources/zendesk-chat"

airbyte-integrations/builds.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
| Wrike | [![source-wrike](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-wrike%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-wrike) |
128128
| YouTube Analytics | [![source-youtube-analytics](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-youtube-analytics%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-youtube-analytics) |
129129
| Xkcd | [![source-xkcd](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-xkcd%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-xkcd) |
130+
| Zapier Supported Storage | [![source-zapier-supported-storage](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-zapier-supported-storage%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-zapier-supported-storage) |
130131
| Zendesk Chat | [![source-zendesk-chat](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-zendesk-chat%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-zendesk-chat) |
131132
| Zendesk Support | [![source-zendesk-support](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-zendesk-support%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-zendesk-support) |
132133
| Zendesk Talk | [![source-zendesk-talk](https://img.shields.io/endpoint?url=https%3A%2F%2Fdnsgjos7lj2fu.cloudfront.net%2Ftests%2Fsummary%2Fsource-zendesk-talk%2Fbadge.json)](https://dnsgjos7lj2fu.cloudfront.net/tests/summary/source-zendesk-talk) |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
!Dockerfile
3+
!main.py
4+
!source_zapier_supported_storage
5+
!setup.py
6+
!secrets
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM python:3.9.11-alpine3.15 as base
2+
3+
# build and load all requirements
4+
FROM base as builder
5+
WORKDIR /airbyte/integration_code
6+
7+
# upgrade pip to the latest version
8+
RUN apk --no-cache upgrade \
9+
&& pip install --upgrade pip \
10+
&& apk --no-cache add tzdata build-base
11+
12+
13+
COPY setup.py ./
14+
# install necessary packages to a temporary folder
15+
RUN pip install --prefix=/install .
16+
17+
# build a clean environment
18+
FROM base
19+
WORKDIR /airbyte/integration_code
20+
21+
# copy all loaded and built libraries to a pure basic image
22+
COPY --from=builder /install /usr/local
23+
# add default timezone settings
24+
COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime
25+
RUN echo "Etc/UTC" > /etc/timezone
26+
27+
# bash is installed for more convenient debugging.
28+
RUN apk --no-cache add bash
29+
30+
# copy payload code only
31+
COPY main.py ./
32+
COPY source_zapier_supported_storage ./source_zapier_supported_storage
33+
34+
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
35+
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
36+
37+
LABEL io.airbyte.version=0.1.0
38+
LABEL io.airbyte.name=airbyte/source-zapier-supported-storage
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Zapier Supported Storage Source
2+
3+
This is the repository for the Zapier Supported Storage configuration based source connector.
4+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/zapier-supported-storage).
5+
6+
## Local development
7+
8+
#### Building via Gradle
9+
You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow.
10+
11+
To build using Gradle, from the Airbyte repository root, run:
12+
```
13+
./gradlew :airbyte-integrations:connectors:source-zapier-supported-storage:build
14+
```
15+
16+
#### Create credentials
17+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/zapier-supported-storage)
18+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_zapier_supported_storage/spec.yaml` file.
19+
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
20+
See `integration_tests/sample_config.json` for a sample config file.
21+
22+
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source zapier-supported-storage test creds`
23+
and place them into `secrets/config.json`.
24+
25+
### Locally running the connector docker image
26+
27+
#### Build
28+
First, make sure you build the latest Docker image:
29+
```
30+
docker build . -t airbyte/source-zapier-supported-storage:dev
31+
```
32+
33+
You can also build the connector image via Gradle:
34+
```
35+
./gradlew :airbyte-integrations:connectors:source-zapier-supported-storage:airbyteDocker
36+
```
37+
When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in
38+
the Dockerfile.
39+
40+
#### Run
41+
Then run any of the connector commands as follows:
42+
```
43+
docker run --rm airbyte/source-zapier-supported-storage:dev spec
44+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-zapier-supported-storage:dev check --config /secrets/config.json
45+
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-zapier-supported-storage:dev discover --config /secrets/config.json
46+
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-zapier-supported-storage:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
47+
```
48+
## Testing
49+
50+
#### Acceptance Tests
51+
Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information.
52+
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
53+
54+
To run your integration tests with docker
55+
56+
### Using gradle to run tests
57+
All commands should be run from airbyte project root.
58+
To run unit tests:
59+
```
60+
./gradlew :airbyte-integrations:connectors:source-zapier-supported-storage:unitTest
61+
```
62+
To run acceptance and custom integration tests:
63+
```
64+
./gradlew :airbyte-integrations:connectors:source-zapier-supported-storage:integrationTest
65+
```
66+
67+
## Dependency Management
68+
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
69+
We split dependencies between two groups, dependencies that are:
70+
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
71+
* required for the testing need to go to `TEST_REQUIREMENTS` list
72+
73+
### Publishing a new version of the connector
74+
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
75+
1. Make sure your changes are passing unit and integration tests.
76+
1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use [SemVer](https://semver.org/)).
77+
1. Create a Pull Request.
78+
1. Pat yourself on the back for being an awesome contributor.
79+
1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
2+
# for more information about how to configure these tests
3+
connector_image: airbyte/source-zapier-supported-storage:dev
4+
tests:
5+
spec:
6+
- spec_path: "source_zapier_supported_storage/spec.yaml"
7+
connection:
8+
- config_path: "secrets/config.json"
9+
status: "succeed"
10+
- config_path: "integration_tests/invalid_config.json"
11+
status: "failed"
12+
discovery:
13+
- config_path: "secrets/config.json"
14+
basic_read:
15+
- config_path: "secrets/config.json"
16+
configured_catalog_path: "integration_tests/configured_catalog.json"
17+
empty_streams: []
18+
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
19+
# expect_records:
20+
# path: "integration_tests/expected_records.txt"
21+
# extra_fields: no
22+
# exact_order: no
23+
# extra_records: yes
24+
# incremental: # TODO if your connector does not implement incremental sync, remove this block
25+
# - config_path: "secrets/config.json"
26+
# configured_catalog_path: "integration_tests/configured_catalog.json"
27+
# future_state_path: "integration_tests/abnormal_state.json"
28+
full_refresh:
29+
- config_path: "secrets/config.json"
30+
configured_catalog_path: "integration_tests/configured_catalog.json"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
# Build latest connector image
4+
docker build . -t $(cat acceptance-test-config.yml | grep "connector_image" | head -n 1 | cut -d: -f2-)
5+
6+
# Pull latest acctest image
7+
docker pull airbyte/source-acceptance-test:latest
8+
9+
# Run
10+
docker run --rm -it \
11+
-v /var/run/docker.sock:/var/run/docker.sock \
12+
-v /tmp:/tmp \
13+
-v $(pwd):/test_input \
14+
airbyte/source-acceptance-test \
15+
--acceptance-test-config /test_input
16+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id 'airbyte-python'
3+
id 'airbyte-docker'
4+
id 'airbyte-source-acceptance-test'
5+
}
6+
7+
airbytePython {
8+
moduleDirectory 'source_zapier_supported_storage'
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"zapier_supported_storage_stream": {
3+
"some_key_other_than_data": "any_value_being_returned(this should not work)"
4+
}
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
6+
import pytest
7+
8+
pytest_plugins = ("source_acceptance_test.plugin",)
9+
10+
11+
@pytest.fixture(scope="session", autouse=True)
12+
def connector_setup():
13+
"""This fixture is a placeholder for external resources that acceptance test might require."""
14+
# TODO: setup test dependencies if needed. otherwise remove the TODO comments
15+
yield
16+
# TODO: clean up test dependencies
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"streams": [
3+
{
4+
"stream": {
5+
"name": "zapier_supported_storage",
6+
"json_schema": {},
7+
"supported_sync_modes": ["full_refresh"]
8+
},
9+
"sync_mode": "full_refresh",
10+
"destination_sync_mode": "overwrite"
11+
}
12+
]
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"secret": "invalid_key"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"secret": "<secret key from Zapier>"
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"zapier_supported_storage_stream": {
3+
"data": "any_value"
4+
}
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
6+
import sys
7+
8+
from airbyte_cdk.entrypoint import launch
9+
from source_zapier_supported_storage import SourceZapierSupportedStorage
10+
11+
if __name__ == "__main__":
12+
source = SourceZapierSupportedStorage()
13+
launch(source, sys.argv[1:])
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-e ../../bases/source-acceptance-test
2+
-e .
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
6+
from setuptools import find_packages, setup
7+
8+
MAIN_REQUIREMENTS = [
9+
"airbyte-cdk~=0.1",
10+
]
11+
12+
TEST_REQUIREMENTS = [
13+
"pytest~=6.1",
14+
"pytest-mock~=3.6.1",
15+
"source-acceptance-test",
16+
]
17+
18+
setup(
19+
name="source_zapier_supported_storage",
20+
description="Source implementation for Zapier Supported Storage.",
21+
author="Airbyte",
22+
author_email="[email protected]",
23+
packages=find_packages(),
24+
install_requires=MAIN_REQUIREMENTS,
25+
package_data={"": ["*.json", "*.yaml", "schemas/*.json", "schemas/shared/*.json"]},
26+
extras_require={
27+
"tests": TEST_REQUIREMENTS,
28+
},
29+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
6+
from .source import SourceZapierSupportedStorage
7+
8+
__all__ = ["SourceZapierSupportedStorage"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "object",
3+
"additionalProperties": true,
4+
"properties": {}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
3+
#
4+
5+
from airbyte_cdk.sources.declarative.yaml_declarative_source import YamlDeclarativeSource
6+
7+
"""
8+
This file provides the necessary constructs to interpret a provided declarative YAML configuration file into
9+
source connector.
10+
11+
WARNING: Do not modify this file.
12+
"""
13+
14+
15+
# Declarative Source
16+
class SourceZapierSupportedStorage(YamlDeclarativeSource):
17+
def __init__(self):
18+
super().__init__(**{"path_to_yaml": "zapier_supported_storage.yaml"})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
documentationUrl: https://docs.airbyte.com/integrations/sources/zapier-supported-storage
2+
connectionSpecification:
3+
$schema: http://json-schema.org/draft-07/schema#
4+
title: Zapier Supported Storage Spec
5+
type: object
6+
required:
7+
- secret
8+
additionalProperties: true
9+
properties:
10+
secret:
11+
title: Secret Key
12+
type: string
13+
description: Secret key supplied by zapier
14+
airbyte_secret: true

0 commit comments

Comments
 (0)