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

⭐ New Source: Goldcast #38786

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bd2a77c
feat: Goldcast source connector WIP
FVidalCarneiro Apr 17, 2024
e890d44
feat: Adding goldcast api source connector
FVidalCarneiro Apr 17, 2024
f250ee5
feat: Adapting README
FVidalCarneiro Apr 17, 2024
33aab01
feat: Adding other streams without any schema for now.
FVidalCarneiro Apr 19, 2024
183dae6
feat: Adding last higher level objects
FVidalCarneiro Apr 19, 2024
b96377f
fix: Fixing schema files
FVidalCarneiro Apr 19, 2024
2671286
feat: Adding webinars endpoint
FVidalCarneiro Apr 22, 2024
8bb6de9
feat: Specifying webinars schema
FVidalCarneiro Apr 22, 2024
dcb6d3e
feat: Adding new streams
FVidalCarneiro Apr 24, 2024
998dfdb
feat: Adding session attendance stream WIP
FVidalCarneiro Apr 25, 2024
b8cc886
feat: Adding event agenda and members stream
FVidalCarneiro Apr 26, 2024
8d9812e
fix: Removing array type object
FVidalCarneiro Apr 26, 2024
e8390f0
fix: Fixing stream schemas
FVidalCarneiro Apr 26, 2024
c012be1
fix: Making embedded schema fields not required
FVidalCarneiro Apr 26, 2024
4119041
fix: Schema fixes
FVidalCarneiro Apr 29, 2024
f613aaf
fix: Removing props field from event members object
FVidalCarneiro Apr 30, 2024
1353fa0
Adding
FVidalCarneiro May 14, 2024
fc12726
fix: Event members mart
FVidalCarneiro May 29, 2024
b48840b
Merge branch 'master' into fvidalcarneiro/feat-goldcast-source
FVidalCarneiro May 30, 2024
a6056df
Merge branch 'master' into fvidalcarneiro/feat-goldcast-source
FVidalCarneiro May 31, 2024
924252e
fix: Formatting
FVidalCarneiro May 31, 2024
f7cfa69
fix: Fixing comments on PR
FVidalCarneiro Jun 7, 2024
02b2e9d
Merge branch 'master' into fvidalcarneiro/feat-goldcast-source
FVidalCarneiro Jun 10, 2024
908274b
fix: Updating docker base image of connector
FVidalCarneiro Jun 10, 2024
9de3a9f
Apply suggestions from code review
FVidalCarneiro Jun 10, 2024
85817e7
fix: Renaming goldcast connector
FVidalCarneiro Jun 10, 2024
6cbacbe
fix: Removing integration test files and renaming folder
FVidalCarneiro Jun 10, 2024
d1fb33f
Merge branch 'master' into fvidalcarneiro/feat-goldcast-source
FVidalCarneiro Jun 25, 2024
70b63c4
feat: Migrating schema to inline yaml definition
FVidalCarneiro Jun 25, 2024
0e835e4
fix: Formatting
FVidalCarneiro Jun 25, 2024
3c9ffd5
feat: Documentation for source
FVidalCarneiro Jun 26, 2024
29459fe
fix: Version upgrade
FVidalCarneiro Jun 26, 2024
c01886d
fix: CI tests
FVidalCarneiro Jul 4, 2024
4f00cbd
fix: Icon
FVidalCarneiro Jul 4, 2024
c679c68
Update airbyte-integrations/connectors/source-goldcast/metadata.yaml
FVidalCarneiro Jul 8, 2024
1a5c79d
feat: Upgrade airbyte cdk
FVidalCarneiro Jul 8, 2024
749d1b7
Merge branch 'master' into fvidalcarneiro/feat-goldcast-source
FVidalCarneiro Jul 8, 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
104 changes: 104 additions & 0 deletions airbyte-integrations/connectors/source-goldcast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Goldcast Source

This is the repository for the Goldcast API configuration based source connector.
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/goldcast).

Currently we are not able to implement incremental streams with this source as the api does not allow a filter on updated at / last modified column. The link to the API documentation is available [here](https://customapi.goldcast.io/swagger-ui/#/).

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

**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/goldcast) to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_goldcast/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. For simplicity, instructions are also included here: please refer to the offical Goldcast [documentation](https://help.goldcast.io/hc/en-us/articles/22931655725723-How-To-Create-an-API-Token-in-Goldcast) to generate a token.


### Locally running the connector

```
poetry run source-goldcast spec
poetry run source-goldcast check --config secrets/config.json
poetry run source-goldcast discover --config secrets/config.json
poetry run source-goldcast read --config secrets/config.json --catalog integration_tests/configured_catalog.json
```

### Running tests

To run tests locally, from the connector directory run:

```
poetry run pytest tests
```

### Building the docker image

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:
```bash
airbyte-ci connectors --name=source-goldcast build
```

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


### Running as a docker container

Then run any of the connector commands as follows:
```
docker run --rm airbyte/source-goldcast:dev spec
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-goldcast:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-goldcast:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-goldcast:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
```

### Running our 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-goldcast 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-goldcast 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.
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/goldcast.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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-goldcast:dev
acceptance_tests:
spec:
tests:
- spec_path: "source_goldcast/spec.yaml"
connection:
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
discovery:
tests:
- config_path: "secrets/config.json"
basic_read:
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
incremental:
bypass_reason: "This connector does not implement incremental sync"
full_refresh:
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
16 changes: 16 additions & 0 deletions airbyte-integrations/connectors/source-goldcast/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#


import pytest

pytest_plugins = ("connector_acceptance_test.plugin",)


@pytest.fixture(scope="session", autouse=True)
def connector_setup():
"""This fixture is a placeholder for external resources that acceptance test might require."""
# TODO: setup test dependencies if needed. otherwise remove the TODO comments
yield
# TODO: clean up test dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "organizations",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "agenda_items",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "discussion_groups",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "tracks",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "webinars",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "event_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "event_agenda",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "event_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "event_agenda",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "session_attendance",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "webinars",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"access_key": "invalid access key"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"streams": [
{
"stream": {
"name": "events",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
13 changes: 13 additions & 0 deletions airbyte-integrations/connectors/source-goldcast/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#


import sys

from airbyte_cdk.entrypoint import launch
from source_goldcast import SourceGoldcast

if __name__ == "__main__":
source = SourceGoldcast()
launch(source, sys.argv[1:])
Loading
Loading