Skip to content

Commit 8a6b694

Browse files
authored
✨Source Quickbooks: Migrate to manifest-only (#55263)
1 parent 5a81d74 commit 8a6b694

File tree

14 files changed

+20989
-9714
lines changed

14 files changed

+20989
-9714
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,65 @@
1-
# Quickbooks Source
1+
# Quickbooks source connector
22

3-
This is the repository for the Quickbooks configuration based source connector.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/quickbooks).
3+
This directory contains the manifest-only connector for `source-quickbooks`.
4+
This _manifest-only_ connector is not a Python package on its own, as it runs inside of the base `source-declarative-manifest` image.
55

6-
## Local development
7-
8-
#### Create credentials
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/quickbooks).
97

10-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/quickbooks)
11-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_quickbooks/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.
8+
## Local development
149

15-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source quickbooks test creds`
16-
and place them into `secrets/config.json`.
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!
1713

18-
### Locally running the connector docker image
14+
If you prefer to develop locally, you can follow the instructions below.
1915

16+
### Building the docker image
2017

18+
You can build any manifest-only connector with `airbyte-ci`:
2119

22-
#### Use `airbyte-ci` to build your connector
23-
The Airbyte way of building this connector is to use our `airbyte-ci` tool.
24-
You can follow install instructions [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md#L1).
25-
Then running the following command will build your connector:
20+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
21+
2. Run the following command to build the docker image:
2622

2723
```bash
28-
airbyte-ci connectors --name source-quickbooks build
29-
```
30-
Once the command is done, you will find your connector image in your local docker registry: `airbyte/source-quickbooks:dev`.
31-
32-
##### Customizing our build process
33-
When contributing on our connector you might need to customize the build process to add a system dependency or set an env var.
34-
You can customize our build process by adding a `build_customization.py` module to your connector.
35-
This module should contain a `pre_connector_install` and `post_connector_install` async function that will mutate the base image and the connector container respectively.
36-
It will be imported at runtime by our build process and the functions will be called if they exist.
37-
38-
Here is an example of a `build_customization.py` module:
39-
```python
40-
from __future__ import annotations
41-
42-
from typing import TYPE_CHECKING
43-
44-
if TYPE_CHECKING:
45-
# Feel free to check the dagger documentation for more information on the Container object and its methods.
46-
# https://dagger-io.readthedocs.io/en/sdk-python-v0.6.4/
47-
from dagger import Container
48-
49-
50-
async def pre_connector_install(base_image_container: Container) -> Container:
51-
return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "my_pre_build_env_var_value")
52-
53-
async def post_connector_install(connector_container: Container) -> Container:
54-
return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "my_post_build_env_var_value")
24+
airbyte-ci connectors --name=source-quickbooks build
5525
```
5626

57-
#### Build your own connector image
58-
This connector is built using our dynamic built process in `airbyte-ci`.
59-
The base image used to build it is defined within the metadata.yaml file under the `connectorBuildOptions`.
60-
The build logic is defined using [Dagger](https://dagger.io/) [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/pipelines/builds/python_connectors.py).
61-
It does not rely on a Dockerfile.
27+
An image will be available on your host with the tag `airbyte/source-quickbooks:dev`.
6228

63-
If you would like to patch our connector and build your own a simple approach would be to:
29+
### Creating credentials
6430

65-
1. Create your own Dockerfile based on the latest version of the connector image.
66-
```Dockerfile
67-
FROM airbyte/source-quickbooks:latest
31+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/quickbooks)
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.
6834

69-
COPY . ./airbyte/integration_code
70-
RUN pip install ./airbyte/integration_code
35+
### Running as a docker container
7136

72-
# The entrypoint and default env vars are already set in the base image
73-
# ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
74-
# ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
75-
```
76-
Please use this as an example. This is not optimized.
37+
Then run any of the standard source connector commands:
7738

78-
2. Build your image:
7939
```bash
80-
docker build -t airbyte/source-quickbooks:dev .
81-
# Running the spec command against your patched connector
82-
docker run airbyte/source-quickbooks:dev spec
83-
```
84-
#### Run
85-
86-
Then run any of the connector commands as follows:
87-
88-
```
8940
docker run --rm airbyte/source-quickbooks:dev spec
9041
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-quickbooks:dev check --config /secrets/config.json
9142
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-quickbooks:dev discover --config /secrets/config.json
9243
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-quickbooks:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
9344
```
9445

95-
## Testing
46+
### Running the CI test suite
9647

9748
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
9849

9950
```bash
10051
airbyte-ci connectors --name=source-quickbooks test
10152
```
10253

103-
### Customizing acceptance Tests
104-
105-
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.
106-
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.
107-
108-
## Dependency Management
109-
110-
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.
111-
We split dependencies between two groups, dependencies that are:
112-
113-
- required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
114-
- required for the testing need to go to `TEST_REQUIREMENTS` list
115-
116-
### Publishing a new version of the connector
117-
118-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
54+
## Publishing a new version of the connector
11955

120-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-quickbooks test`
121-
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).
122-
3. Make sure the `metadata.yaml` content is up to date.
123-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/quickbooks.md`).
56+
If you want to contribute changes to `source-quickbooks`, 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-quickbooks 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)):
60+
- bump the `dockerImageTag` value in in `metadata.yaml`
61+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/quickbooks.md`).
12462
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).
12563
6. Pat yourself on the back for being an awesome contributor.
126-
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
64+
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
65+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.

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

-3
This file was deleted.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test_strictness_level: "low"
55
acceptance_tests:
66
spec:
77
tests:
8-
- spec_path: "source_quickbooks/spec.json"
8+
- spec_path: "manifest.yaml"
99
backward_compatibility_tests_config:
1010
disable_for_version: "1.0.0"
1111
connection:

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

-9
This file was deleted.

0 commit comments

Comments
 (0)