Skip to content

Commit 13fc33f

Browse files
✨Source Aha: Make Connector Compatible with Builder (#38144)
Co-authored-by: Alexandre Girard <[email protected]>
1 parent 47f304b commit 13fc33f

25 files changed

+2324
-753
lines changed

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

-6
This file was deleted.

airbyte-integrations/connectors/source-aha/Dockerfile

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,103 @@
11
# Aha Source
22

33
This is the repository for the Aha configuration based source connector.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/aha).
4+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/aha).
55

66
## Local development
77

8-
#### Create credentials
8+
### Prerequisites
99

10-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/aha)
11-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_aha/spec.yaml` file.
12-
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
13-
See `integration_tests/sample_config.json` for a sample config file.
14-
15-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source aha test creds`
16-
and place them into `secrets/config.json`.
10+
* Python (`^3.9`)
11+
* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)
1712

18-
### Locally running the connector docker image
1913

20-
#### Build
2114

22-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
15+
### Installing the connector
2316

17+
From this connector directory, run:
2418
```bash
25-
airbyte-ci connectors --name=source-aha build
19+
poetry install --with dev
20+
```
21+
22+
23+
### Create credentials
24+
25+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/aha)
26+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_aha/spec.yaml` file.
27+
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
28+
See `sample_files/sample_config.json` for a sample config file.
29+
30+
31+
### Locally running the connector
32+
33+
```
34+
poetry run source-aha spec
35+
poetry run source-aha check --config secrets/config.json
36+
poetry run source-aha discover --config secrets/config.json
37+
poetry run source-aha read --config secrets/config.json --catalog integration_tests/configured_catalog.json
2638
```
2739

28-
An image will be built with the tag `airbyte/source-aha:dev`.
40+
### Running tests
2941

30-
**Via `docker build`:**
42+
To run tests locally, from the connector directory run:
3143

44+
```
45+
poetry run pytest tests
46+
```
47+
48+
### Building the docker image
49+
50+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
51+
2. Run the following command to build the docker image:
3252
```bash
33-
docker build -t airbyte/source-aha:dev .
53+
airbyte-ci connectors --name=source-aha build
3454
```
3555

36-
#### Run
56+
An image will be available on your host with the tag `airbyte/source-aha:dev`.
3757

38-
Then run any of the connector commands as follows:
3958

59+
### Running as a docker container
60+
61+
Then run any of the connector commands as follows:
4062
```
4163
docker run --rm airbyte/source-aha:dev spec
4264
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-aha:dev check --config /secrets/config.json
4365
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-aha:dev discover --config /secrets/config.json
4466
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-aha:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
4567
```
4668

47-
## Testing
69+
### Running our CI test suite
4870

4971
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
50-
5172
```bash
5273
airbyte-ci connectors --name=source-aha test
5374
```
5475

5576
### Customizing acceptance Tests
5677

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

60-
## Dependency Management
81+
### Dependency Management
6182

62-
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.
63-
We split dependencies between two groups, dependencies that are:
83+
All of your dependencies should be managed via Poetry.
84+
To add a new dependency, run:
85+
```bash
86+
poetry add <package-name>
87+
```
6488

65-
- required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
66-
- required for the testing need to go to `TEST_REQUIREMENTS` list
89+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
6790

68-
### Publishing a new version of the connector
91+
## Publishing a new version of the connector
6992

7093
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
71-
7294
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-aha test`
73-
2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
95+
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)):
96+
- bump the `dockerImageTag` value in in `metadata.yaml`
97+
- bump the `version` value in `pyproject.toml`
7498
3. Make sure the `metadata.yaml` content is up to date.
75-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/aha.md`).
99+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/aha.md`).
76100
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).
77101
6. Pat yourself on the back for being an awesome contributor.
78102
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
103+
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
@@ -1,3 +1,3 @@
11
#
2-
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
33
#

airbyte-integrations/connectors/source-aha/integration_tests/configured_catalog.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"streams": [
33
{
44
"stream": {
5-
"name": "products",
5+
"name": "products_stream",
66
"json_schema": {},
77
"supported_sync_modes": ["full_refresh"]
88
},
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"stream": {
14-
"name": "ideas",
14+
"name": "ideas_stream",
1515
"json_schema": {},
1616
"supported_sync_modes": ["full_refresh"]
1717
},
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"stream": {
23-
"name": "users",
23+
"name": "users_stream",
2424
"json_schema": {},
2525
"supported_sync_modes": ["full_refresh"]
2626
},
@@ -29,7 +29,7 @@
2929
},
3030
{
3131
"stream": {
32-
"name": "idea_categories",
32+
"name": "idea_categories_stream",
3333
"json_schema": {},
3434
"supported_sync_modes": ["full_refresh"]
3535
},
@@ -38,7 +38,7 @@
3838
},
3939
{
4040
"stream": {
41-
"name": "idea_endorsements",
41+
"name": "idea_endorsements_stream",
4242
"json_schema": {},
4343
"supported_sync_modes": ["full_refresh"]
4444
},
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"stream": {
50-
"name": "idea_comments",
50+
"name": "idea_comments_stream",
5151
"json_schema": {},
5252
"supported_sync_modes": ["full_refresh"]
5353
},

airbyte-integrations/connectors/source-aha/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
2+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
33
#
44

55
from source_aha.run import run

airbyte-integrations/connectors/source-aha/metadata.yaml

+15-10
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,30 @@ data:
22
ab_internal:
33
ql: 200
44
sl: 100
5+
registries:
6+
oss:
7+
enabled: true
8+
cloud:
9+
enabled: true
10+
remoteRegistries:
11+
pypi:
12+
enabled: true
13+
packageName: airbyte-source-aha
14+
connectorBuildOptions:
15+
# Please update to the latest version of the connector base image.
16+
# https://hub.docker.com/r/airbyte/python-connector-base
17+
# Please use the full address with sha256 hash to guarantee build reproducibility.
18+
baseImage: docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9
519
connectorSubtype: api
620
connectorType: source
721
definitionId: 81ca39dc-4534-4dd2-b848-b0cfd2c11fce
8-
dockerImageTag: 0.3.1
22+
dockerImageTag: 0.3.2
923
dockerRepository: airbyte/source-aha
1024
documentationUrl: https://docs.airbyte.com/integrations/sources/aha
1125
githubIssueLabel: source-aha
1226
icon: aha.svg
1327
license: MIT
1428
name: Aha
15-
remoteRegistries:
16-
pypi:
17-
enabled: true
18-
packageName: airbyte-source-aha
19-
registries:
20-
cloud:
21-
enabled: true
22-
oss:
23-
enabled: true
2429
releaseStage: alpha
2530
supportLevel: community
2631
tags:

0 commit comments

Comments
 (0)