Skip to content

Commit

Permalink
Update codegen template READMEs (airbytehq#2873)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherifnada authored Apr 13, 2021
1 parent 1294e41 commit 2d2d017
Show file tree
Hide file tree
Showing 41 changed files with 90 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Success!
Your ${connectorName} connector has been created at ${path.resolve(outputPath)}.
Follow instructions in NEW_SOURCE_CHECKLIST.md to finish your connector.
Follow the TODOs in the generated module to implement your connector.
Questions, comments, or concerns? Let us know at:
Slack: https://slack.airbyte.io
Github: https://github.com/airbytehq/airbyte
We're always happy to provide you with any support :)
We're always happy to provide any support!
${additionalMessage || ""}
`
Expand Down Expand Up @@ -68,7 +68,7 @@ module.exports = function (plop) {
{type: 'input', name: 'name', message: 'Source name, without the "source-" prefix e.g: "google-analytics"', filter: function (name) {
return name.endsWith('-singer') ? name.replace(/-singer$/, '') : name;
}},
{type: 'input', name: 'tap_name', message: 'Singer tap package'},
{type: 'input', name: 'tap_name', message: 'Singer tap package e.g "tap-mixpanel"'},
],
actions: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/{{dashCase name}}:dev
docker build . -t airbyte/source-{{dashCase name}}:dev
```

You can also build the connector image via Gradle:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/{{dashCase name}}-singer:dev
docker build . -t airbyte/source-{{dashCase name}}-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/appsflyer-singer:dev
docker build . -t airbyte/source-appsflyer-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/appstore-singer:dev
docker build . -t airbyte/source-appstore-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/braintree-singer:dev
docker build . -t airbyte/source-braintree-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
11 changes: 1 addition & 10 deletions airbyte-integrations/connectors/source-drift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/drift:dev
docker build . -t airbyte/source-drift:dev
```

You can also build the connector image via Gradle:
Expand All @@ -86,15 +86,6 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files
1. To run additional integration tests, place your integration tests in a new directory `integration_tests` and run them with `python -m pytest -s integration_tests`.
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.

#### Populating your Drift account with seed data

The following will create 120 accounts and conversations
```bash
export DRIFT_TOKEN=<PUT_YOUR_TOKEN_HERE>
cd airbyte-integrations/connectors/source-drift/source_drift/
python -m client.fixture
```

## Dependency Management
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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/exchangeratesapi-singer:dev
docker build . -t airbyte/source-exchangeratesapi-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/facebook-marketing:dev
docker build . -t airbyte/source-facebook-marketing:dev
```

You can also build the connector image via Gradle:
Expand Down
3 changes: 2 additions & 1 deletion airbyte-integrations/connectors/source-file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ In order to run integrations tests in this connector, you need:
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source file test creds`
and place them into `secrets/config.json`.
### Locally running the connector
```
python main_dev.py spec
Expand All @@ -91,7 +92,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/file:dev
docker build . -t airbyte/source-file:dev
```
You can also build the connector image via Gradle:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-freshdesk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/freshdesk:dev
docker build . -t airbyte/source-freshdesk:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/github-singer:dev
docker build . -t airbyte/source-github-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/gitlab-singer:dev
docker build . -t airbyte/source-gitlab-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/google-adwords-singer:dev
docker build . -t airbyte/source-google-adwords-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/google-directory:dev
docker build . -t airbyte/source-google-directory:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/google-sheets:dev
docker build . -t airbyte/source-google-sheets:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/google-workspace-admin-reports:dev
docker build . -t airbyte/source-google-workspace-admin-reports:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/googleanalytics-singer:dev
docker build . -t airbyte/source-googleanalytics-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/greenhouse:dev
docker build . -t airbyte/source-greenhouse:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/http-request:dev
docker build . -t airbyte/source-http-request:dev
```

You can also build the connector image via Gradle:
Expand Down
62 changes: 48 additions & 14 deletions airbyte-integrations/connectors/source-hubspot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,38 @@ For information about how to use this connector within Airbyte, see [the documen
### Prerequisites
**To iterate on this connector, make sure to complete this prerequisites section.**

#### Build & Activate Virtual Environment
First, build the module by running the following from the `airbyte` project root directory:
#### Build & Activate Virtual Environment and install dependencies
From this connector directory, create a virtual environment:
```
./gradlew :airbyte-integrations:connectors:source-hubspot:build
python -m venv .venv
```

This will generate a virtualenv for this module in `source-hubspot/.venv`. Make sure this venv is active in your
development environment of choice. To activate the venv from the terminal, run:
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
development environment of choice. To activate it from the terminal, run:
```
cd airbyte-integrations/connectors/source-hubspot # cd into the connector directory
source .venv/bin/activate
pip install -r requirements.txt
```
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.

Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
should work as you expect.

#### Building via Gradle
From the Airbyte repository root, run:
```
./gradlew :airbyte-integrations:connectors:source-hubspot:build
```

#### Create credentials
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/hubspot)
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_hubspot/spec.json` file.
Note that the `secrets` directory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
See `sample_files/sample_config.json` for a sample config file.

**If you are an Airbyte core member**, copy the credentials in RPass under the secret name `source-hubspot-integration-test-config`
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source hubspot test creds`
and place them into `secrets/config.json`.


Expand All @@ -42,23 +54,45 @@ python main_dev.py read --config secrets/config.json --catalog sample_files/conf
### Unit Tests
To run unit tests locally, from the connector directory run:
```
pytest unit_tests
python -m pytest unit_tests
```

### Locally running the connector docker image

#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/source-hubspot:dev
```

You can also build the connector image via Gradle:
```
# in airbyte root directory
./gradlew :airbyte-integrations:connectors:source-hubspot:airbyteDocker
```
When building via Gradle, the docker image name and tag, respectively, are the values of the `io.airbyte.name` and `io.airbyte.version` `LABEL`s in
the Dockerfile.

#### Run
Then run any of the connector commands as follows:
```
docker run --rm airbyte/source-hubspot:dev spec
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-hubspot/secrets:/secrets airbyte/source-hubspot:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-hubspot/secrets:/secrets airbyte/source-hubspot:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/airbyte-integrations/connectors/source-hubspot/secrets:/secrets -v $(pwd)/airbyte-integrations/connectors/source-hubspot/sample_files:/sample_files airbyte/source-hubspot:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-hubspot:dev check --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-hubspot:dev discover --config /secrets/config.json
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files airbyte/source-hubspot:dev read --config /secrets/config.json --catalog /sample_files/configured_catalog.json
```

### Integration Tests
1. From the airbyte project root, run `./gradlew :airbyte-integrations:connectors:source-hubspot:standardSourceTestPython` to run the standard integration test suite.
1. To run additional integration tests, place your integration tests in a new directory `integration_tests` and run them with `pytest integration_tests`.
1. From the airbyte project root, run `./gradlew :airbyte-integrations:connectors:source-hubspot:integrationTest` to run the standard integration test suite.
1. To run additional integration tests, place your integration tests in a new directory `integration_tests` and run them with `python -m pytest -s integration_tests`.
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.

## Dependency Management
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.

### Publishing a new version of the connector
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
1. Make sure your changes are passing unit and integration tests
1. Bump the connector version in `Dockerfile` -- just increment the value of the `LABEL io.airbyte.version` appropriately (we use SemVer).
1. Create a Pull Request
1. Pat yourself on the back for being an awesome contributor
1. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-instagram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/instagram:dev
docker build . -t airbyte/source-instagram:dev
```

You can also build the connector image via Gradle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/intercom-singer:dev
docker build . -t airbyte/source-intercom-singer:dev
```

You can also build the connector image via Gradle:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-jira/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/jira:dev
docker build . -t airbyte/source-jira:dev
```

You can also build the connector image via Gradle:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-looker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ python -m pytest unit_tests
#### Build
First, make sure you build the latest Docker image:
```
docker build . -t airbyte/looker:dev
docker build . -t airbyte/source-looker:dev
```

You can also build the connector image via Gradle:
Expand Down
Loading

0 comments on commit 2d2d017

Please sign in to comment.