Skip to content

Commit ff0e18f

Browse files
topefolorunsooctavia-squidington-iiinatikgadzhi
authored
✨ Source Harness : Migrate to Manifest-only (#46485)
Co-authored-by: Octavia Squidington III <[email protected]> Co-authored-by: Natik Gadzhi <[email protected]>
1 parent 1cf4a45 commit ff0e18f

File tree

15 files changed

+165
-1598
lines changed

15 files changed

+165
-1598
lines changed

airbyte-integrations/connectors/source-harness/README.md

+27-53
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,63 @@
11
# Harness source connector
22

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

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

78
## Local development
89

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!
1213

14+
If you prefer to develop locally, you can follow the instructions below.
1315

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
3517

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`:
4119

42-
### Building the docker image
4320
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
4421
2. Run the following command to build the docker image:
22+
4523
```bash
4624
airbyte-ci connectors --name=source-harness build
4725
```
4826

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

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

5235
### 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
5540
docker run --rm airbyte/source-harness:dev spec
5641
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-harness:dev check --config /secrets/config.json
5742
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-harness:dev discover --config /secrets/config.json
5843
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
5944
```
6045

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
6647

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):
7049

71-
### Dependency Management
72-
All of your dependencies should be managed via Poetry.
73-
To add a new dependency, run:
7450
```bash
75-
poetry add <package-name>
51+
airbyte-ci connectors --name=source-harness test
7652
```
7753

78-
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
79-
8054
## 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)):
8460
- 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.
8761
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/harness.md`).
8862
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).
8963
6. Pat yourself on the back for being an awesome contributor.

airbyte-integrations/connectors/source-harness/__init__.py

-3
This file was deleted.

airbyte-integrations/connectors/source-harness/acceptance-test-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ connector_image: airbyte/source-harness:dev
44
acceptance_tests:
55
spec:
66
tests:
7-
- spec_path: "source_harness/spec.yaml"
7+
- spec_path: "manifest.yaml"
88
connection:
99
tests:
1010
- config_path: "secrets/config.json"

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

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
version: 5.10.2
2+
3+
type: DeclarativeSource
4+
5+
check:
6+
type: CheckStream
7+
stream_names:
8+
- organizations
9+
10+
definitions:
11+
streams:
12+
organizations:
13+
type: DeclarativeStream
14+
name: organizations
15+
retriever:
16+
type: SimpleRetriever
17+
requester:
18+
$ref: "#/definitions/base_requester"
19+
path: /ng/api/organizations
20+
http_method: GET
21+
request_parameters:
22+
accountIdentifier: "{{ config['account_id'] }}"
23+
record_selector:
24+
type: RecordSelector
25+
extractor:
26+
type: DpathExtractor
27+
field_path:
28+
- data
29+
- content
30+
schema_loader:
31+
type: InlineSchemaLoader
32+
schema:
33+
$ref: "#/schemas/organizations"
34+
base_requester:
35+
type: HttpRequester
36+
url_base: "{{ config['api_url'] }}"
37+
authenticator:
38+
type: ApiKeyAuthenticator
39+
api_token: "{{ config[\"api_key\"] }}"
40+
inject_into:
41+
type: RequestOption
42+
field_name: x-api-key
43+
inject_into: header
44+
45+
streams:
46+
- $ref: "#/definitions/streams/organizations"
47+
48+
spec:
49+
type: Spec
50+
connection_specification:
51+
type: object
52+
$schema: http://json-schema.org/draft-07/schema#
53+
required:
54+
- api_key
55+
- account_id
56+
properties:
57+
api_key:
58+
type: string
59+
title: API key
60+
airbyte_secret: true
61+
order: 0
62+
api_url:
63+
type: string
64+
description: The API URL for fetching data from Harness
65+
title: API URL
66+
default: https://app.harness.io
67+
examples:
68+
- https://my-harness-server.example.com
69+
order: 1
70+
account_id:
71+
type: string
72+
description: Harness Account ID
73+
title: Account ID
74+
order: 2
75+
additionalProperties: true
76+
77+
metadata:
78+
autoImportSchema:
79+
organizations: false
80+
testedStreams:
81+
organizations:
82+
streamHash: bae6712300ea469634950aa91730036c13f96e6a
83+
assist: {}
84+
85+
schemas:
86+
organizations:
87+
type:
88+
- object
89+
- "null"
90+
$schema: http://json-schema.org/draft-07/schema#
91+
additionalProperties: true
92+
properties:
93+
createdAt:
94+
type:
95+
- number
96+
- "null"
97+
harnessManaged:
98+
type:
99+
- boolean
100+
- "null"
101+
lastModifiedAt:
102+
type:
103+
- number
104+
- "null"
105+
organization:
106+
type:
107+
- object
108+
- "null"
109+
properties:
110+
description:
111+
type:
112+
- string
113+
- "null"
114+
identifier:
115+
type:
116+
- string
117+
- "null"
118+
name:
119+
type:
120+
- string
121+
- "null"
122+
tags:
123+
type:
124+
- object
125+
- "null"
126+
properties:
127+
identifier:
128+
type:
129+
- string
130+
- "null"

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ data:
44
- api.harness.io
55
remoteRegistries:
66
pypi:
7-
enabled: true
7+
enabled: false
88
packageName: airbyte-source-harness
99
registryOverrides:
1010
oss:
11-
enabled: false
11+
enabled: true
1212
cloud:
13-
enabled: false
13+
enabled: true
1414
connectorSubtype: api
1515
connectorType: source
1616
definitionId: b0e46f61-e143-47cc-a595-4bb73bfa8a15
17-
dockerImageTag: 0.1.10
17+
dockerImageTag: 0.2.0
1818
dockerRepository: airbyte/source-harness
1919
githubIssueLabel: source-harness
2020
icon: harness.svg
@@ -25,8 +25,8 @@ data:
2525
supportLevel: community
2626
documentationUrl: https://docs.airbyte.com/integrations/sources/harness
2727
tags:
28-
- language:python
2928
- cdk:low-code
29+
- language:manifest-only
3030
connectorTestSuitesOptions:
3131
- suite: acceptanceTests
3232
testSecrets:
@@ -86,5 +86,5 @@ data:
8686
type: GSM
8787
alias: airbyte-connector-testing-secret-store
8888
connectorBuildOptions:
89-
baseImage: docker.io/airbyte/python-connector-base:2.0.0@sha256:c44839ba84406116e8ba68722a0f30e8f6e7056c726f447681bb9e9ece8bd916
89+
baseImage: docker.io/airbyte/source-declarative-manifest:5.10.2@sha256:81db4f78a92d199f33c38c17f5b63fc87c56739f14dc10276ddec86c7b707b7a
9090
metadataSpecVersion: "1.0"

0 commit comments

Comments
 (0)