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

Source Intercom: Migrate to manifest only format with components #47240

Merged
merged 26 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
620f5eb
Source Intercom: migrate to manifest only
btkcodedev Oct 22, 2024
6800bbf
chore: auto-fix lint and format issues
octavia-squidington-iii Oct 22, 2024
efcdd3b
update docs
btkcodedev Oct 22, 2024
8bebea4
Merge branch 'master' into btkcodedev/intercomMigrateManifestOnly
btkcodedev Dec 9, 2024
b0d4537
Merge branch 'master' into btkcodedev/intercomMigrateManifestOnly
btkcodedev Dec 12, 2024
75c6c7c
update manifest
btkcodedev Dec 12, 2024
0921b3d
Merge branch 'master' into btkcodedev/intercomMigrateManifestOnly
btkcodedev Dec 12, 2024
bc85586
add stream hash after testing without custom components
btkcodedev Dec 12, 2024
f657d4d
test failing streams
btkcodedev Dec 12, 2024
0b17a7a
Merge branch 'master' into btkcodedev/intercomMigrateManifestOnly
btkcodedev Dec 12, 2024
e1b4716
update incremental parent
btkcodedev Dec 12, 2024
9b9daf9
update test scenarios
btkcodedev Dec 12, 2024
7714da3
change incremental dependency
btkcodedev Dec 15, 2024
d83859d
revert back custom components
btkcodedev Dec 16, 2024
cbc9a62
update incremental sync
btkcodedev Dec 16, 2024
d85b794
feat: re-implement unit tests
ChristoGrab Dec 16, 2024
d896f60
chore: version bump
ChristoGrab Dec 17, 2024
205ba72
update abnormal state values
btkcodedev Dec 17, 2024
2fc0c70
Merge branch 'btkcodedev/intercomMigrateManifestOnly' of https://gith…
btkcodedev Dec 17, 2024
fa00fd6
revert base image version bump due to failure
btkcodedev Dec 17, 2024
b60eda9
Merge branch 'master' into btkcodedev/intercomMigrateManifestOnly
DanyloGL Dec 17, 2024
53d4733
chore: disable unit tests and comment
ChristoGrab Dec 17, 2024
c7dc09f
chore: auto-fix lint and format issues
octavia-squidington-iii Dec 17, 2024
7577a5c
Update airbyte-integrations/connectors/source-intercom/metadata.yaml
ChristoGrab Dec 17, 2024
87849a9
Update airbyte-integrations/connectors/source-intercom/metadata.yaml
ChristoGrab Dec 17, 2024
3cc1013
chore: update changelog
ChristoGrab Dec 17, 2024
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
89 changes: 25 additions & 64 deletions airbyte-integrations/connectors/source-intercom/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
# Intercom source connector

This is the repository for the Intercom source connector, written in Python.
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/intercom).
This directory contains the manifest-only connector for `source-intercom`.
This _manifest-only_ connector is not a Python package on its own, as it runs inside of the base `source-declarative-manifest` image.

## Local development

### Prerequisites

- Python (~=3.9)
- Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)

### Installing the connector

From this connector directory, run:

```bash
poetry install --with dev
```

### Create credentials
For information about how to configure and use this connector within Airbyte, see [the connector's full documentation](https://docs.airbyte.com/integrations/sources/intercom).

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

### Locally running the connector

```
poetry run source-intercom spec
poetry run source-intercom check --config secrets/config.json
poetry run source-intercom discover --config secrets/config.json
poetry run source-intercom read --config secrets/config.json --catalog integration_tests/configured_catalog.json
```
## Local development

### Running unit tests
We recommend using the Connector Builder to edit this connector.
Using either Airbyte Cloud or your local Airbyte OSS instance, navigate to the **Builder** tab and select **Import a YAML**.
Then select the connector's `manifest.yaml` file to load the connector into the Builder. You're now ready to make changes to the connector!

To run unit tests locally, from the connector directory run:

```
poetry run pytest unit_tests
```
If you prefer to develop locally, you can follow the instructions below.

### Building the docker image

You can build any manifest-only connector with `airbyte-ci`:

1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
2. Run the following command to build the docker image:

Expand All @@ -53,52 +26,40 @@ airbyte-ci connectors --name=source-intercom build

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

### Creating credentials

**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/intercom)
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` object in the connector's `manifest.yaml` file.
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.

### Running as a docker container

Then run any of the connector commands as follows:
Then run any of the standard source connector commands:

```
```bash
docker run --rm airbyte/source-intercom:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-intercom:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-intercom:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-intercom:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
```

### Running our CI test suite
### Running the CI test suite

You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):

```bash
airbyte-ci connectors --name=source-intercom test
```

### Customizing acceptance Tests

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.
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.

### Dependency Management

All of your dependencies should be managed via Poetry.
To add a new dependency, run:

```bash
poetry add <package-name>
```

Please commit the changes to `pyproject.toml` and `poetry.lock` files.

## Publishing a new version of the connector

You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?

1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-intercom test`
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)):
- bump the `dockerImageTag` value in in `metadata.yaml`
- bump the `version` value in `pyproject.toml`
3. Make sure the `metadata.yaml` content is up to date.
If you want to contribute changes to `source-intercom`, here's how you can do that:
1. Make your changes locally, or load the connector's manifest into Connector Builder and make changes there.
2. Make sure your changes are passing our test suite with `airbyte-ci connectors --name=source-intercom test`
3. 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)):
- bump the `dockerImageTag` value in in `metadata.yaml`
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/intercom.md`).
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).
6. Pat yourself on the back for being an awesome contributor.
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
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 number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_strictness_level: high
acceptance_tests:
spec:
tests:
- spec_path: "source_intercom/spec.json"
- spec_path: "manifest.yaml"
connection:
tests:
- config_path: "secrets/config.json"
Expand All @@ -20,6 +20,9 @@ acceptance_tests:
- config_path: "secrets/config.json"
expect_records:
path: "integration_tests/expected_records.jsonl"
empty_streams:
- name: conversation_parts
bypass_reason: Deeply nested response which could not be seeded with sandbox
incremental:
tests:
- config_path: "secrets/config.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"name": "company_segments"
},
"stream_state": {
"updated_at": 7626086649,
"companies": {
"updated_at": 7626086649
}
"updated_at": 7626086649
}
}
},
Expand All @@ -42,10 +39,7 @@
"name": "conversations"
},
"stream_state": {
"updated_at": 7626086649,
"conversations": {
"updated_at": 7626086649
}
"updated_at": 7626086649
}
}
},
Expand All @@ -56,10 +50,7 @@
"name": "conversation_parts"
},
"stream_state": {
"updated_at": 7626086649,
"conversations": {
"updated_at": 7626086649
}
"updated_at": 7626086649
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
{"stream": "conversations", "data": {"type": "conversation", "id": "1", "created_at": 1607553243, "updated_at": 1626346673, "waiting_since": null, "snoozed_until": null, "source": {"type": "conversation", "id": "701718739", "delivered_as": "customer_initiated", "subject": "", "body": "<p>hey there</p>", "author": {"type": "lead", "id": "5fd150d50697b6d0bbc4a2c2", "name": null, "email": ""}, "attachments": [], "url": "http://localhost:63342/airbyte-python/airbyte-integrations/bases/base-java/build/tmp/expandedArchives/org.jacoco.agent-0.8.5.jar_6a2df60c47de373ea127d14406367999/about.html?_ijt=uosck1k6vmp2dnl4oqib2g3u9d"}, "contacts": {"type": "contact.list", "contacts": [{"type": "contact", "id": "5fd150d50697b6d0bbc4a2c2"}]}, "first_contact_reply": {"created_at": 1607553243, "type": "conversation", "url": "http://localhost:63342/airbyte-python/airbyte-integrations/bases/base-java/build/tmp/expandedArchives/org.jacoco.agent-0.8.5.jar_6a2df60c47de373ea127d14406367999/about.html?_ijt=uosck1k6vmp2dnl4oqib2g3u9d"}, "open": true, "state": "open", "read": false, "tags": {"type": "tag.list", "tags": []}, "priority": "not_priority", "sla_applied": null, "statistics": {"type": "conversation_statistics", "time_to_assignment": null, "time_to_admin_reply": 4317957, "time_to_first_close": null, "time_to_last_close": null, "median_time_to_reply": 4317954, "first_contact_reply_at": 1607553243, "first_assignment_at": null, "first_admin_reply_at": 1625654131, "first_close_at": null, "last_assignment_at": null, "last_assignment_admin_reply_at": null, "last_contact_reply_at": 1607553246, "last_admin_reply_at": 1625656000, "last_close_at": null, "last_closed_by_id": null, "count_reopens": 0, "count_assignments": 0, "count_conversation_parts": 7}, "conversation_rating": null, "teammates": {"type": "admin.list", "admins": [{"type": "admin", "id": "4423433"}]}, "assignee": null}, "emitted_at": 1707747714058}
{"stream": "conversations", "data": {"type": "conversation", "id": "60", "created_at": 1676461133, "updated_at": 1676461134, "waiting_since": null, "snoozed_until": null, "source": {"type": "conversation", "id": "51952871", "delivered_as": "automated", "subject": "", "body": "<p class=\"no-margin\">Test 3</p>", "author": {"type": "admin", "id": "4423433", "name": "Airbyte Team", "email": "[email protected]"}, "attachments": [], "url": null}, "contacts": {"type": "contact.list", "contacts": [{"type": "contact", "id": "63ea41a0eddb9b625fb712c9"}]}, "first_contact_reply": null, "open": true, "state": "open", "read": false, "tags": {"type": "tag.list", "tags": []}, "priority": "not_priority", "sla_applied": null, "statistics": {"type": "conversation_statistics", "time_to_assignment": null, "time_to_admin_reply": null, "time_to_first_close": null, "time_to_last_close": null, "median_time_to_reply": null, "first_contact_reply_at": null, "first_assignment_at": null, "first_admin_reply_at": null, "first_close_at": null, "last_assignment_at": null, "last_assignment_admin_reply_at": null, "last_contact_reply_at": null, "last_admin_reply_at": null, "last_close_at": null, "last_closed_by_id": null, "count_reopens": 0, "count_assignments": 0, "count_conversation_parts": 2}, "conversation_rating": null, "teammates": {"type": "admin.list", "admins": [{"type": "admin", "id": "4423433"}]}, "assignee": {"type": "admin", "id": "4423433"}}, "emitted_at": 1707747714064}
{"stream": "conversations", "data": {"type": "conversation", "id": "61", "created_at": 1676461196, "updated_at": 1676461197, "waiting_since": null, "snoozed_until": null, "source": {"type": "conversation", "id": "51952963", "delivered_as": "automated", "subject": "", "body": "<p class=\"no-margin\">Test 4</p>", "author": {"type": "admin", "id": "4423433", "name": "Airbyte Team", "email": "[email protected]"}, "attachments": [], "url": null}, "contacts": {"type": "contact.list", "contacts": [{"type": "contact", "id": "63ea41a1b0e17c53248c7956"}]}, "first_contact_reply": null, "open": true, "state": "open", "read": false, "tags": {"type": "tag.list", "tags": []}, "priority": "not_priority", "sla_applied": null, "statistics": {"type": "conversation_statistics", "time_to_assignment": null, "time_to_admin_reply": null, "time_to_first_close": null, "time_to_last_close": null, "median_time_to_reply": null, "first_contact_reply_at": null, "first_assignment_at": null, "first_admin_reply_at": null, "first_close_at": null, "last_assignment_at": null, "last_assignment_admin_reply_at": null, "last_contact_reply_at": null, "last_admin_reply_at": null, "last_close_at": null, "last_closed_by_id": null, "count_reopens": 0, "count_assignments": 0, "count_conversation_parts": 2}, "conversation_rating": null, "teammates": {"type": "admin.list", "admins": [{"type": "admin", "id": "4423433"}]}, "assignee": {"type": "admin", "id": "4423433"}}, "emitted_at": 1707747714069}
{"stream": "conversation_parts", "data": {"type": "conversation_part", "id": "7288120839", "part_type": "comment", "body": "<p>is this showing up</p>", "created_at": 1607553246, "updated_at": 1607553246, "notified_at": 1607553246, "assigned_to": null, "author": {"id": "5fd150d50697b6d0bbc4a2c2", "type": "user", "name": null, "email": ""}, "attachments": [], "external_id": null, "conversation_id": "1"}, "emitted_at": 1707747716219}
{"stream": "conversation_parts", "data": {"type": "conversation_part", "id": "7288121348", "part_type": "comment", "body": "<p>Airbyte [DEV] will reply as soon as they can.</p>", "created_at": 1607553249, "updated_at": 1607553249, "notified_at": 1607553249, "assigned_to": null, "author": {"id": "4423434", "type": "bot", "name": "Operator", "email": "[email protected]"}, "attachments": [], "external_id": null, "conversation_id": "1"}, "emitted_at": 1707747716222}
{"stream": "conversation_parts", "data": {"type": "conversation_part", "id": "7288121392", "part_type": "comment", "body": "<p>Give the team a way to reach you:</p>", "created_at": 1607553250, "updated_at": 1607553250, "notified_at": 1607553250, "assigned_to": null, "author": {"id": "4423434", "type": "bot", "name": "Operator", "email": "[email protected]"}, "attachments": [], "external_id": null, "conversation_id": "1"}, "emitted_at": 1707747716225}
{"stream": "company_segments", "data": {"type": "segment", "id": "63ea1a19d248071b8d297b39", "name": "Companies less then 100 people", "created_at": 1676286489, "updated_at": 1676461957, "person_type": "user"}, "emitted_at": 1707747722461}
{"stream": "company_segments", "data": {"type": "segment", "id": "63eb62f228758099dbc7fabe", "name": "Companies not IT", "created_at": 1676370674, "updated_at": 1676461960, "person_type": "user"}, "emitted_at": 1707747722463}
{"stream": "company_segments", "data": {"type": "segment", "id": "63eb63c3046264426ef4bfd6", "name": "Companies tag not 3", "created_at": 1676370883, "updated_at": 1676461915, "person_type": "user"}, "emitted_at": 1707747722465}
8 changes: 0 additions & 8 deletions airbyte-integrations/connectors/source-intercom/main.py

This file was deleted.

Loading
Loading