Skip to content

Commit 1ef0a42

Browse files
authored
Source freshsales: Migrate to manifest-only (#44149)
1 parent c2b16c1 commit 1ef0a42

File tree

13 files changed

+6315
-3685
lines changed

13 files changed

+6315
-3685
lines changed

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

+27-54
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,63 @@
11
# Freshsales source connector
22

3+
This directory contains the manifest-only connector for `source-freshsales`.
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 Freshsales 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/freshsales).
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/freshsales).
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/freshsales)
23-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_freshsales/spec.yaml` file.
24-
25-
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
26-
See `sample_files/sample_config.json` for a sample config file.
27-
28-
29-
### Locally running the connector
30-
```
31-
poetry run source-freshsales spec
32-
poetry run source-freshsales check --config secrets/config.json
33-
poetry run source-freshsales discover --config secrets/config.json
34-
poetry run source-freshsales read --config secrets/config.json --catalog sample_files/configured_catalog.json
35-
```
16+
### Building the docker image
3617

37-
### Running unit tests
38-
To run unit tests locally, from the connector directory run:
39-
```
40-
poetry run pytest unit_tests
41-
```
18+
You can build any manifest-only connector with `airbyte-ci`:
4219

43-
### Building the docker image
4420
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
4521
2. Run the following command to build the docker image:
22+
4623
```bash
4724
airbyte-ci connectors --name=source-freshsales build
4825
```
4926

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

29+
### Creating credentials
30+
31+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/freshsales)
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.
5234

5335
### Running as a docker container
54-
Then run any of the connector commands as follows:
55-
```
36+
37+
Then run any of the standard source connector commands:
38+
39+
```bash
5640
docker run --rm airbyte/source-freshsales:dev spec
5741
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-freshsales:dev check --config /secrets/config.json
5842
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-freshsales:dev discover --config /secrets/config.json
5943
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-freshsales:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
6044
```
6145

62-
### Running our CI test suite
63-
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
64-
```bash
65-
airbyte-ci connectors --name=source-freshsales test
66-
```
46+
### Running the CI test suite
6747

68-
### Customizing acceptance Tests
69-
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.
70-
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):
7149

72-
### Dependency Management
73-
All of your dependencies should be managed via Poetry.
74-
To add a new dependency, run:
7550
```bash
76-
poetry add <package-name>
51+
airbyte-ci connectors --name=source-freshsales test
7752
```
7853

79-
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
80-
8154
## Publishing a new version of the connector
82-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
83-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-freshsales test`
84-
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-freshsales`, 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-freshsales 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)):
8560
- bump the `dockerImageTag` value in in `metadata.yaml`
86-
- bump the `version` value in `pyproject.toml`
87-
3. Make sure the `metadata.yaml` content is up to date.
8861
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/freshsales.md`).
8962
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).
9063
6. Pat yourself on the back for being an awesome contributor.

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

-3
This file was deleted.

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test_strictness_level: high
55
acceptance_tests:
66
spec:
77
tests:
8-
- spec_path: "source_freshsales/spec.yaml"
8+
- spec_path: "manifest.yaml"
99
connection:
1010
tests:
1111
- config_path: "secrets/config.json"
@@ -22,11 +22,17 @@ acceptance_tests:
2222
path: "integration_tests/expected_records.jsonl"
2323
empty_streams:
2424
- name: "sales_accounts_filter"
25-
bypass_reason: "users are not expected to use this stream, it is used as a parent stream of other streams in this connector"
25+
bypass_reason:
26+
"users are not expected to use this stream, it is used as a
27+
parent stream of other streams in this connector"
2628
- name: "deals_filter"
27-
bypass_reason: "users are not expected to use this stream, it is used as a parent stream of other streams in this connector"
29+
bypass_reason:
30+
"users are not expected to use this stream, it is used as a
31+
parent stream of other streams in this connector"
2832
- name: "contacts_filters"
29-
bypass_reason: "users are not expected to use this stream, it is used as a parent stream of other streams in this connector"
33+
bypass_reason:
34+
"users are not expected to use this stream, it is used as a
35+
parent stream of other streams in this connector"
3036
full_refresh:
3137
tests:
3238
- config_path: "secrets/config.json"

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

-8
This file was deleted.

0 commit comments

Comments
 (0)