Skip to content

Commit 715bdae

Browse files
authored
✨Source Lever Hiring: migrate to low-code (#36262)
1 parent 5ebae63 commit 715bdae

25 files changed

+2663
-983
lines changed

airbyte-integrations/connectors/source-lever-hiring/.dockerignore

-6
This file was deleted.

airbyte-integrations/connectors/source-lever-hiring/Dockerfile

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,59 @@
11
# Lever Hiring Source
22

3-
This is the repository for the Lever Hiring source connector, written in Python.
3+
This is the repository for the Lever Hiring configuration based source connector.
4+
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/lever-hiring).
45

56
## Local development
67

78
### Prerequisites
89

9-
**To iterate on this connector, make sure to complete this prerequisites section.**
10+
* Python (`^3.9`)
11+
* Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)
1012

11-
#### Minimum Python version required `= 3.7.0`
13+
### Installing the connector
1214

13-
#### Build & Activate Virtual Environment and install dependencies
14-
15-
From this connector directory, create a virtual environment:
16-
17-
```
18-
python -m venv .venv
19-
```
20-
21-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
22-
development environment of choice. To activate it from the terminal, run:
23-
24-
```
25-
source .venv/bin/activate
26-
pip install -r requirements.txt
15+
From this connector directory, run:
16+
```bash
17+
poetry install --with dev
2718
```
2819

29-
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
30-
31-
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
32-
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
33-
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
34-
should work as you expect.
20+
### Create credentials
3521

36-
#### Create credentials
22+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/lever-hiring)
23+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_lever_hiring/spec.yaml` file.
3724

38-
**If you are a community contributor**, get the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_lever_hiring/spec.json` file.
3925
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
40-
See `integration_tests/sample_config.json` for a sample config file.
41-
42-
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source lever-hiring test creds`
43-
and place them into `secrets/config.json`.
26+
See `sample_files/sample_config.json` for a sample config file.
4427

4528
### Locally running the connector
4629

4730
```
48-
python main.py spec
49-
python main.py check --config secrets/config.json
50-
python main.py discover --config secrets/config.json
51-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
31+
poetry run source-lever-hiring spec
32+
poetry run source-lever-hiring check --config secrets/config.json
33+
poetry run source-lever-hiring discover --config secrets/config.json
34+
poetry run source-lever-hiring read --config secrets/config.json --catalog integration_tests/configured_catalog.json
5235
```
5336

54-
### Locally running the connector docker image
55-
56-
#### Build
37+
### Running tests
5738

58-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
39+
To run tests locally, from the connector directory run:
5940

60-
```bash
61-
airbyte-ci connectors --name=source-lever-hiring build
41+
```
42+
poetry run pytest tests
6243
```
6344

64-
An image will be built with the tag `airbyte/source-lever-hiring:dev`.
45+
### Building the docker image
6546

66-
**Via `docker build`:**
47+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
48+
2. Run the following command to build the docker image:
6749

6850
```bash
69-
docker build -t airbyte/source-lever-hiring:dev .
51+
airbyte-ci connectors --name=source-lever-hiring build
7052
```
7153

72-
#### Run
54+
An image will be available on your host with the tag `airbyte/source-lever-hiring:dev`.
55+
56+
### Running as a docker container
7357

7458
Then run any of the connector commands as follows:
7559

@@ -80,7 +64,7 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-lever-hiring:dev disco
8064
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-lever-hiring:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
8165
```
8266

83-
## Testing
67+
### Running our CI test suite
8468

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

@@ -90,25 +74,30 @@ airbyte-ci connectors --name=source-lever-hiring test
9074

9175
### Customizing acceptance Tests
9276

93-
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.
77+
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.
9478
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.
9579

96-
## Dependency Management
80+
### Dependency Management
9781

98-
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.
99-
We split dependencies between two groups, dependencies that are:
82+
All of your dependencies should be managed via Poetry.
83+
To add a new dependency, run:
84+
```bash
85+
poetry add <package-name>
86+
```
10087

101-
- required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
102-
- required for the testing need to go to `TEST_REQUIREMENTS` list
88+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
10389

104-
### Publishing a new version of the connector
90+
## Publishing a new version of the connector
10591

10692
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
10793

10894
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-lever-hiring test`
109-
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).
95+
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)):
96+
- bump the `dockerImageTag` value in in `metadata.yaml`
97+
- bump the `version` value in `pyproject.toml`
11098
3. Make sure the `metadata.yaml` content is up to date.
111-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/lever-hiring.md`).
99+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/lever-hiring.md`).
112100
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).
113101
6. Pat yourself on the back for being an awesome contributor.
114102
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
103+
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#
2+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3+
#
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference)
22
# for more information about how to configure these tests
33
connector_image: airbyte/source-lever-hiring:dev
4-
tests:
4+
acceptance_tests:
55
spec:
6-
- spec_path: "source_lever_hiring/spec.json"
6+
tests:
7+
- spec_path: "source_lever_hiring/spec.yaml"
78
connection:
8-
- config_path: "secrets/config.json"
9-
status: "succeed"
10-
- config_path: "integration_tests/invalid_config.json"
11-
status: "failed"
9+
tests:
10+
- config_path: "secrets/config.json"
11+
status: "succeed"
12+
- config_path: "integration_tests/invalid_config.json"
13+
status: "failed"
1214
discovery:
13-
- config_path: "secrets/config.json"
15+
tests:
16+
- config_path: "secrets/config.json"
1417
basic_read:
15-
- config_path: "secrets/config.json"
16-
configured_catalog_path: "integration_tests/configured_catalog.json"
17-
empty_streams: []
18+
tests:
19+
- config_path: "secrets/config.json"
20+
configured_catalog_path: "integration_tests/configured_catalog.json"
21+
empty_streams: []
22+
expect_records:
23+
path: "integration_tests/expected_records.jsonl"
1824
incremental:
19-
- config_path: "secrets/config.json"
20-
configured_catalog_path: "integration_tests/configured_catalog.json"
21-
future_state_path: "integration_tests/abnormal_state.json"
25+
tests:
26+
- config_path: "secrets/config.json"
27+
configured_catalog_path: "integration_tests/configured_catalog.json"
2228
full_refresh:
23-
- config_path: "secrets/config.json"
24-
configured_catalog_path: "integration_tests/configured_catalog.json"
29+
tests:
30+
- config_path: "secrets/config.json"
31+
configured_catalog_path: "integration_tests/configured_catalog.json"
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
#
2-
# MIT License
3-
#
4-
# Copyright (c) 2020 Airbyte
5-
#
6-
# Permission is hereby granted, free of charge, to any person obtaining a copy
7-
# of this software and associated documentation files (the "Software"), to deal
8-
# in the Software without restriction, including without limitation the rights
9-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
# copies of the Software, and to permit persons to whom the Software is
11-
# furnished to do so, subject to the following conditions:
12-
#
13-
# The above copyright notice and this permission notice shall be included in all
14-
# copies or substantial portions of the Software.
15-
#
16-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
# SOFTWARE.
2+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
233
#

0 commit comments

Comments
 (0)