Skip to content

Commit 3a0ebb3

Browse files
authored
source-opsgenie: ensure inline schemas, updated cdk, poetry (where possible) (#37210)
1 parent 39eda24 commit 3a0ebb3

File tree

17 files changed

+1873
-635
lines changed

17 files changed

+1873
-635
lines changed

airbyte-integrations/connectors/source-opsgenie/Dockerfile

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
1-
# Opsgenie Source
1+
# Opsgenie source connector
22

3-
This is the repository for the Opsgenie source connector, written in low-code configuration based source connector.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/opsgenie).
3+
4+
This is the repository for the Opsgenie 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/opsgenie).
56

67
## Local development
78

8-
#### Building via Gradle
9-
You can also build the connector in Gradle. This is typically used in CI and not needed for your development workflow.
9+
### Prerequisites
10+
* Python (~=3.9)
11+
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
1012

11-
To build using Gradle, from the Airbyte repository root, run:
12-
```
13-
./gradlew :airbyte-integrations:connectors:source-opsgenie:build
13+
14+
### Installing the connector
15+
From this connector directory, run:
16+
```bash
17+
poetry install --with dev
1418
```
1519

16-
#### Create credentials
17-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/opsgenie)
20+
21+
### Create credentials
22+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/opsgenie)
1823
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_opsgenie/spec.yaml` file.
1924
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
20-
See `integration_tests/sample_config.json` for a sample config file.
25+
See `sample_files/sample_config.json` for a sample config file.
2126

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

2528
### Locally running the connector
2629
```
27-
python main.py spec
28-
python main.py check --config secrets/config.json
29-
python main.py discover --config secrets/config.json
30-
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
30+
poetry run source-opsgenie spec
31+
poetry run source-opsgenie check --config secrets/config.json
32+
poetry run source-opsgenie discover --config secrets/config.json
33+
poetry run source-opsgenie read --config secrets/config.json --catalog sample_files/configured_catalog.json
3134
```
3235

33-
### Locally running the connector docker image
34-
36+
### Running unit tests
37+
To run unit tests locally, from the connector directory run:
38+
```
39+
poetry run pytest unit_tests
40+
```
3541

36-
#### Build
37-
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
42+
### Building the docker image
43+
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
44+
2. Run the following command to build the docker image:
3845
```bash
3946
airbyte-ci connectors --name=source-opsgenie build
4047
```
4148

42-
An image will be built with the tag `airbyte/source-opsgenie:dev`.
49+
An image will be available on your host with the tag `airbyte/source-opsgenie:dev`.
4350

44-
**Via `docker build`:**
45-
```bash
46-
docker build -t airbyte/source-opsgenie:dev .
47-
```
4851

49-
#### Run
52+
### Running as a docker container
5053
Then run any of the connector commands as follows:
5154
```
5255
docker run --rm airbyte/source-opsgenie:dev spec
@@ -55,29 +58,34 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-opsgenie:dev discover
5558
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-opsgenie:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
5659
```
5760

58-
## Testing
61+
### Running our CI test suite
5962
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
6063
```bash
6164
airbyte-ci connectors --name=source-opsgenie test
6265
```
6366

6467
### Customizing acceptance Tests
65-
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.
68+
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.
6669
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.
6770

68-
## Dependency Management
69-
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.
70-
We split dependencies between two groups, dependencies that are:
71-
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
72-
* required for the testing need to go to `TEST_REQUIREMENTS` list
71+
### Dependency Management
72+
All of your dependencies should be managed via Poetry.
73+
To add a new dependency, run:
74+
```bash
75+
poetry add <package-name>
76+
```
77+
78+
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
7379

74-
### Publishing a new version of the connector
80+
## Publishing a new version of the connector
7581
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
7682
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-opsgenie test`
77-
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).
83+
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)):
84+
- bump the `dockerImageTag` value in in `metadata.yaml`
85+
- bump the `version` value in `pyproject.toml`
7886
3. Make sure the `metadata.yaml` content is up to date.
79-
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/opsgenie.md`).
87+
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/opsgenie.md`).
8088
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).
8189
6. Pat yourself on the back for being an awesome contributor.
8290
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
83-
91+
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
@@ -1,28 +1,30 @@
11
data:
2+
ab_internal:
3+
ql: 100
4+
sl: 100
5+
connectorBuildOptions:
6+
baseImage: docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9
27
connectorSubtype: api
38
connectorType: source
49
definitionId: 06bdb480-2598-40b8-8b0f-fc2e2d2abdda
5-
dockerImageTag: 0.3.1
10+
dockerImageTag: 0.3.5
611
dockerRepository: airbyte/source-opsgenie
12+
documentationUrl: https://docs.airbyte.com/integrations/sources/opsgenie
713
githubIssueLabel: source-opsgenie
814
license: MIT
915
name: Opsgenie
10-
remoteRegistries:
11-
pypi:
12-
enabled: true
13-
packageName: airbyte-source-opsgenie
1416
registries:
1517
cloud:
1618
enabled: false
1719
oss:
1820
enabled: true
1921
releaseStage: alpha
20-
documentationUrl: https://docs.airbyte.com/integrations/sources/opsgenie
22+
remoteRegistries:
23+
pypi:
24+
enabled: true
25+
packageName: airbyte-source-opsgenie
26+
supportLevel: community
2127
tags:
2228
- language:python
2329
- cdk:low-code
24-
ab_internal:
25-
sl: 100
26-
ql: 100
27-
supportLevel: community
2830
metadataSpecVersion: "1.0"

0 commit comments

Comments
 (0)