Skip to content

Commit cd93561

Browse files
pabloescodergirardatolik0
authored
✨Source Okta: migrate to low-code (#36509)
Co-authored-by: Alexandre Girard <[email protected]> Co-authored-by: Anatolii Yatsuk <[email protected]>
1 parent 0d7bf96 commit cd93561

40 files changed

+3880
-2459
lines changed

airbyte-integrations/connectors/source-okta/.dockerignore

-7
This file was deleted.

airbyte-integrations/connectors/source-okta/CHANGELOG.md

-3
This file was deleted.

airbyte-integrations/connectors/source-okta/Dockerfile

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,72 @@
11
# Okta Source
22

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

66
## Local development
77

88
### Prerequisites
99

10-
**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)
1112

12-
#### Build & Activate Virtual Environment and install dependencies
1313

14-
From this connector directory, create a virtual environment:
1514

16-
```shell
17-
python -m venv .venv
18-
```
19-
20-
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
21-
development environment of choice. To activate it from the terminal, run:
15+
### Installing the connector
2216

23-
```shell
24-
source .venv/bin/activate
25-
pip install -r requirements.txt
17+
From this connector directory, run:
18+
```bash
19+
poetry install --with dev
2620
```
2721

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

35-
#### Create credentials
23+
### Create credentials
3624

37-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/okta)
38-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_okta/spec.json` file.
25+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/okta)
26+
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_okta/spec.yaml` file.
3927
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.
28+
See `sample_files/config.json` for a sample config file.
4129

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

4531
### Locally running the connector
4632

47-
```shell
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
5233
```
34+
poetry run source-okta spec
35+
poetry run source-okta check --config secrets/config.json
36+
poetry run source-okta discover --config secrets/config.json
37+
poetry run source-okta read --config secrets/config.json --catalog integration_tests/configured_catalog.json
38+
```
39+
40+
### Running tests
5341

54-
### Locally running the connector docker image
42+
To run tests locally, from the connector directory run:
5543

56-
#### Build
44+
```
45+
poetry run pytest tests
46+
```
5747

58-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
48+
### Building the docker image
5949

50+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
51+
2. Run the following command to build the docker image:
6052
```bash
6153
airbyte-ci connectors --name=source-okta build
6254
```
6355

64-
An image will be built with the tag `airbyte/source-okta:dev`.
56+
An image will be available on your host with the tag `airbyte/source-okta:dev`.
6557

66-
**Via `docker build`:**
6758

68-
```bash
69-
docker build -t airbyte/source-okta:dev .
70-
```
71-
72-
#### Run
59+
### Running as a docker container
7360

7461
Then run any of the connector commands as follows:
75-
76-
```shell
62+
```
7763
docker run --rm airbyte/source-okta:dev spec
7864
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-okta:dev check --config /secrets/config.json
7965
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-okta:dev discover --config /secrets/config.json
8066
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-okta:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
8167
```
8268

83-
## Testing
69+
### Running our CI test suite
8470

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

@@ -90,25 +76,30 @@ airbyte-ci connectors --name=source-okta test
9076

9177
### Customizing acceptance Tests
9278

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.
79+
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.
9480
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.
9581

96-
## Dependency Management
82+
### Dependency Management
9783

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:
84+
All of your dependencies should be managed via Poetry.
85+
To add a new dependency, run:
86+
```bash
87+
poetry add <package-name>
88+
```
10089

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
90+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
10391

104-
### Publishing a new version of the connector
92+
## Publishing a new version of the connector
10593

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

10896
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-okta 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).
97+
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)):
98+
- bump the `dockerImageTag` value in in `metadata.yaml`
99+
- bump the `version` value in `pyproject.toml`
110100
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/okta.md`).
101+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/okta.md`).
112102
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).
113103
6. Pat yourself on the back for being an awesome contributor.
114104
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
105+
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) 2024 Airbyte, Inc., all rights reserved.
3+
#

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test_strictness_level: high
33
acceptance_tests:
44
spec:
55
tests:
6-
- spec_path: "source_okta/spec.json"
6+
- spec_path: "source_okta/spec.yaml"
77
connection:
88
tests:
99
- config_path: "secrets/config.json"

0 commit comments

Comments
 (0)