|
1 | 1 | # Aha Source
|
2 | 2 |
|
3 | 3 | 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). |
5 | 5 |
|
6 | 6 | ## Local development
|
7 | 7 |
|
8 |
| -#### Create credentials |
| 8 | +### Prerequisites |
9 | 9 |
|
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) |
17 | 12 |
|
18 |
| -### Locally running the connector docker image |
19 | 13 |
|
20 |
| -#### Build |
21 | 14 |
|
22 |
| -**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):** |
| 15 | +### Installing the connector |
23 | 16 |
|
| 17 | +From this connector directory, run: |
24 | 18 | ```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 |
26 | 38 | ```
|
27 | 39 |
|
28 |
| -An image will be built with the tag `airbyte/source-aha:dev`. |
| 40 | +### Running tests |
29 | 41 |
|
30 |
| -**Via `docker build`:** |
| 42 | +To run tests locally, from the connector directory run: |
31 | 43 |
|
| 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: |
32 | 52 | ```bash
|
33 |
| -docker build -t airbyte/source-aha:dev . |
| 53 | +airbyte-ci connectors --name=source-aha build |
34 | 54 | ```
|
35 | 55 |
|
36 |
| -#### Run |
| 56 | +An image will be available on your host with the tag `airbyte/source-aha:dev`. |
37 | 57 |
|
38 |
| -Then run any of the connector commands as follows: |
39 | 58 |
|
| 59 | +### Running as a docker container |
| 60 | + |
| 61 | +Then run any of the connector commands as follows: |
40 | 62 | ```
|
41 | 63 | docker run --rm airbyte/source-aha:dev spec
|
42 | 64 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-aha:dev check --config /secrets/config.json
|
43 | 65 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-aha:dev discover --config /secrets/config.json
|
44 | 66 | 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
|
45 | 67 | ```
|
46 | 68 |
|
47 |
| -## Testing |
| 69 | +### Running our CI test suite |
48 | 70 |
|
49 | 71 | 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 |
| - |
51 | 72 | ```bash
|
52 | 73 | airbyte-ci connectors --name=source-aha test
|
53 | 74 | ```
|
54 | 75 |
|
55 | 76 | ### Customizing acceptance Tests
|
56 | 77 |
|
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. |
58 | 79 | 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.
|
59 | 80 |
|
60 |
| -## Dependency Management |
| 81 | +### Dependency Management |
61 | 82 |
|
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 | +``` |
64 | 88 |
|
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. |
67 | 90 |
|
68 |
| -### Publishing a new version of the connector |
| 91 | +## Publishing a new version of the connector |
69 | 92 |
|
70 | 93 | 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 |
| - |
72 | 94 | 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` |
74 | 98 | 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`). |
76 | 100 | 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).
|
77 | 101 | 6. Pat yourself on the back for being an awesome contributor.
|
78 | 102 | 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. |
0 commit comments