Skip to content

Commit eee94ae

Browse files
btkcodedevgirarda
andauthored
✨Source Outreach: Migrate Python CDK to Low-code CDK (#36954)
Co-authored-by: Alexandre Girard <[email protected]>
1 parent 7de236e commit eee94ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6241
-5768
lines changed

airbyte-integrations/connectors/source-outreach/.dockerignore

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,67 @@
11
# Outreach source connector
22

3-
This is the repository for the Outreach source connector, written in Python.
3+
This is the repository for the Outreach configuration based source connector.
44
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/outreach).
55

66
## Local development
77

88
### Prerequisites
99

10-
- Python (~=3.9)
11-
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
10+
* Python (`^3.9`)
11+
* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)
12+
13+
1214

1315
### Installing the connector
1416

1517
From this connector directory, run:
16-
1718
```bash
1819
poetry install --with dev
1920
```
2021

22+
2123
### Create credentials
2224

2325
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/outreach)
24-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_outreach/spec.yaml` file.
26+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` inside `manifest.yaml` file.
2527
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
2628
See `sample_files/sample_config.json` for a sample config file.
2729

30+
2831
### Locally running the connector
2932

33+
3034
```
3135
poetry run source-outreach spec
3236
poetry run source-outreach check --config secrets/config.json
3337
poetry run source-outreach discover --config secrets/config.json
3438
poetry run source-outreach read --config secrets/config.json --catalog sample_files/configured_catalog.json
39+
poetry run source-outreach spec
40+
poetry run source-outreach check --config secrets/config.json
41+
poetry run source-outreach discover --config secrets/config.json
42+
poetry run source-outreach read --config secrets/config.json --catalog sample_files/configured_catalog.json
3543
```
3644

37-
### Running unit tests
45+
### Running tests
3846

39-
To run unit tests locally, from the connector directory run:
47+
To run tests locally, from the connector directory run:
4048

4149
```
42-
poetry run pytest unit_tests
50+
poetry run pytest tests
4351
```
4452

4553
### Building the docker image
4654

4755
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
4856
2. Run the following command to build the docker image:
49-
5057
```bash
5158
airbyte-ci connectors --name=source-outreach build
5259
```
5360

5461
An image will be available on your host with the tag `airbyte/source-outreach:dev`.
5562

63+
64+
### Running as a docker container
5665
### Running as a docker container
5766

5867
Then run any of the connector commands as follows:
@@ -66,6 +75,8 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
6675

6776
### Running our CI test suite
6877

78+
### Running our CI test suite
79+
6980
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
7081

7182
```bash
@@ -74,14 +85,15 @@ airbyte-ci connectors --name=source-outreach test
7485

7586
### Customizing acceptance Tests
7687

88+
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
89+
7790
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
7891
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.
7992

8093
### Dependency Management
8194

82-
All of your dependencies should be managed via Poetry.
95+
All of your dependencies should be managed via Poetry.
8396
To add a new dependency, run:
84-
8597
```bash
8698
poetry add <package-name>
8799
```
@@ -93,12 +105,13 @@ Please commit the changes to `pyproject.toml` and `poetry.lock` files.
93105
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
94106

95107
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-outreach test`
96-
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
97-
- bump the `dockerImageTag` value in in `metadata.yaml`
98-
- bump the `version` value in `pyproject.toml`
108+
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
109+
- bump the `dockerImageTag` value in in `metadata.yaml`
110+
- bump the `version` value in `pyproject.toml`
99111
3. Make sure the `metadata.yaml` content is up to date.
100112
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/outreach.md`).
113+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/outreach.md`).
101114
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
102115
6. Pat yourself on the back for being an awesome contributor.
103116
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
104-
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
117+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
3+
#

airbyte-integrations/connectors/source-outreach/acceptance-test-config.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ connector_image: airbyte/source-outreach:dev
44
acceptance_tests:
55
spec:
66
tests:
7-
- spec_path: "source_outreach/spec.json"
7+
- spec_path: "source_outreach/spec.yaml"
88
connection:
99
tests:
1010
- config_path: "secrets/config.json"
@@ -14,7 +14,8 @@ acceptance_tests:
1414
discovery:
1515
tests:
1616
- config_path: "secrets/config.json"
17-
# https://github.com/airbytehq/airbyte/issues/8180
17+
backward_compatibility_tests_config:
18+
disable_for_version: 0.5.0 # The sequence_steps changed its ['properties']['creator']['items']['type'] field to include integers
1819
basic_read:
1920
tests:
2021
- config_path: "secrets/config.json"
@@ -28,6 +29,9 @@ acceptance_tests:
2829
bypass_reason: "Sandbox account cannot seed the stream"
2930
- name: "templates"
3031
bypass_reason: "Sandbox account cannot seed the stream"
32+
expect_records:
33+
path: "integration_tests/expected_records.jsonl"
34+
exact_order: no
3135
incremental:
3236
tests:
3337
- config_path: "secrets/config.json"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#
2-
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
33
#
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
22
"prospects": {
3-
"updatedAt": "2040-11-16T00:00:00Z"
3+
"updatedAt": "2040-11-16T00:00:00.000Z"
44
},
55
"sequences": {
6-
"updatedAt": "2040-11-16T00:00:00Z"
6+
"updatedAt": "2040-11-16T00:00:00.000Z"
77
},
88
"sequence_states": {
9-
"updatedAt": "2040-11-16T00:00:00Z"
9+
"updatedAt": "2040-11-16T00:00:00.000Z"
1010
},
1111
"sequence_steps": {
12-
"updatedAt": "2040-11-16T00:00:00Z"
12+
"updatedAt": "2040-11-16T00:00:00.000Z"
1313
},
1414
"accounts": {
15-
"updatedAt": "2040-11-16T00:00:00Z"
15+
"updatedAt": "2040-11-16T00:00:00.000Z"
1616
},
1717
"opportunities": {
18-
"updatedAt": "2040-11-16T00:00:00Z"
18+
"updatedAt": "2040-11-16T00:00:00.000Z"
1919
},
2020
"personas": {
21-
"updatedAt": "2040-11-16T00:00:00Z"
21+
"updatedAt": "2040-11-16T00:00:00.000Z"
2222
},
2323
"mailings": {
24-
"updatedAt": "2040-11-16T00:00:00Z"
24+
"updatedAt": "2040-11-16T00:00:00.000Z"
2525
},
2626
"mailboxes": {
27-
"updatedAt": "2040-11-16T00:00:00Z"
27+
"updatedAt": "2040-11-16T00:00:00.000Z"
2828
},
2929
"stages": {
30-
"updatedAt": "2040-11-16T00:00:00Z"
30+
"updatedAt": "2040-11-16T00:00:00.000Z"
3131
},
3232
"calls": {
33-
"updatedAt": "2040-11-16T00:00:00Z"
33+
"updatedAt": "2040-11-16T00:00:00.000Z"
3434
},
3535
"call_purposes": {
36-
"updatedAt": "2040-11-16T00:00:00Z"
36+
"updatedAt": "2040-11-16T00:00:00.000Z"
3737
},
3838
"call_dispositions": {
39-
"updatedAt": "2040-11-16T00:00:00Z"
39+
"updatedAt": "2040-11-16T00:00:00.000Z"
4040
},
4141
"users": {
42-
"updatedAt": "2040-11-16T00:00:00Z"
42+
"updatedAt": "2040-11-16T00:00:00.000Z"
4343
},
4444
"tasks": {
45-
"updatedAt": "2040-11-16T00:00:00Z"
45+
"updatedAt": "2040-11-16T00:00:00.000Z"
4646
},
4747
"templates": {
48-
"updatedAt": "2040-11-16T00:00:00Z"
48+
"updatedAt": "2040-11-16T00:00:00.000Z"
4949
},
5050
"snippets": {
51-
"updatedAt": "2040-11-16T00:00:00Z"
51+
"updatedAt": "2040-11-16T00:00:00.000Z"
5252
}
5353
}

airbyte-integrations/connectors/source-outreach/integration_tests/acceptance.py

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111
@pytest.fixture(scope="session", autouse=True)
1212
def connector_setup():
1313
"""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
1415
yield
16+
# TODO: clean up test dependencies

0 commit comments

Comments
 (0)