|
1 | 1 | # Harness source connector
|
2 | 2 |
|
| 3 | +This directory contains the manifest-only connector for `source-harness`. |
| 4 | +This _manifest-only_ connector is not a Python package on its own, as it runs inside of the base `source-declarative-manifest` image. |
3 | 5 |
|
4 |
| -This is the repository for the Harness source connector, written in Python. |
5 |
| -For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/harness). |
| 6 | +For information about how to configure and use this connector within Airbyte, see [the connector's full documentation](https://docs.airbyte.com/integrations/sources/harness). |
6 | 7 |
|
7 | 8 | ## Local development
|
8 | 9 |
|
9 |
| -### Prerequisites |
10 |
| -* Python (~=3.9) |
11 |
| -* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation) |
| 10 | +We recommend using the Connector Builder to edit this connector. |
| 11 | +Using either Airbyte Cloud or your local Airbyte OSS instance, navigate to the **Builder** tab and select **Import a YAML**. |
| 12 | +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! |
12 | 13 |
|
| 14 | +If you prefer to develop locally, you can follow the instructions below. |
13 | 15 |
|
14 |
| -### Installing the connector |
15 |
| -From this connector directory, run: |
16 |
| -```bash |
17 |
| -poetry install --with dev |
18 |
| -``` |
19 |
| - |
20 |
| - |
21 |
| -### Create credentials |
22 |
| -**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/harness) |
23 |
| -to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_harness/spec.yaml` file. |
24 |
| -Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. |
25 |
| -See `sample_files/sample_config.json` for a sample config file. |
26 |
| - |
27 |
| - |
28 |
| -### Locally running the connector |
29 |
| -``` |
30 |
| -poetry run source-harness spec |
31 |
| -poetry run source-harness check --config secrets/config.json |
32 |
| -poetry run source-harness discover --config secrets/config.json |
33 |
| -poetry run source-harness read --config secrets/config.json --catalog sample_files/configured_catalog.json |
34 |
| -``` |
| 16 | +### Building the docker image |
35 | 17 |
|
36 |
| -### Running unit tests |
37 |
| -To run unit tests locally, from the connector directory run: |
38 |
| -``` |
39 |
| -poetry run pytest unit_tests |
40 |
| -``` |
| 18 | +You can build any manifest-only connector with `airbyte-ci`: |
41 | 19 |
|
42 |
| -### Building the docker image |
43 | 20 | 1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
44 | 21 | 2. Run the following command to build the docker image:
|
| 22 | + |
45 | 23 | ```bash
|
46 | 24 | airbyte-ci connectors --name=source-harness build
|
47 | 25 | ```
|
48 | 26 |
|
49 | 27 | An image will be available on your host with the tag `airbyte/source-harness:dev`.
|
50 | 28 |
|
| 29 | +### Creating credentials |
| 30 | + |
| 31 | +**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/harness) |
| 32 | +to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `spec` object in the connector's `manifest.yaml` file. |
| 33 | +Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information. |
51 | 34 |
|
52 | 35 | ### Running as a docker container
|
53 |
| -Then run any of the connector commands as follows: |
54 |
| -``` |
| 36 | + |
| 37 | +Then run any of the standard source connector commands: |
| 38 | + |
| 39 | +```bash |
55 | 40 | docker run --rm airbyte/source-harness:dev spec
|
56 | 41 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-harness:dev check --config /secrets/config.json
|
57 | 42 | docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-harness:dev discover --config /secrets/config.json
|
58 | 43 | docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-harness:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
59 | 44 | ```
|
60 | 45 |
|
61 |
| -### Running our CI test suite |
62 |
| -You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md): |
63 |
| -```bash |
64 |
| -airbyte-ci connectors --name=source-harness test |
65 |
| -``` |
| 46 | +### Running the CI test suite |
66 | 47 |
|
67 |
| -### Customizing acceptance Tests |
68 |
| -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. |
69 |
| -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. |
| 48 | +You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md): |
70 | 49 |
|
71 |
| -### Dependency Management |
72 |
| -All of your dependencies should be managed via Poetry. |
73 |
| -To add a new dependency, run: |
74 | 50 | ```bash
|
75 |
| -poetry add <package-name> |
| 51 | +airbyte-ci connectors --name=source-harness test |
76 | 52 | ```
|
77 | 53 |
|
78 |
| -Please commit the changes to `pyproject.toml` and `poetry.lock` files. |
79 |
| - |
80 | 54 | ## Publishing a new version of the connector
|
81 |
| -You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what? |
82 |
| -1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-harness test` |
83 |
| -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)): |
| 55 | + |
| 56 | +If you want to contribute changes to `source-harness`, here's how you can do that: |
| 57 | +1. Make your changes locally, or load the connector's manifest into Connector Builder and make changes there. |
| 58 | +2. Make sure your changes are passing our test suite with `airbyte-ci connectors --name=source-harness test` |
| 59 | +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)): |
84 | 60 | - bump the `dockerImageTag` value in in `metadata.yaml`
|
85 |
| - - bump the `version` value in `pyproject.toml` |
86 |
| -3. Make sure the `metadata.yaml` content is up to date. |
87 | 61 | 4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/harness.md`).
|
88 | 62 | 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).
|
89 | 63 | 6. Pat yourself on the back for being an awesome contributor.
|
|
0 commit comments