Skip to content

Commit 89c7627

Browse files
authored
Source microsoft-teams: Migrate to manifest-only (#44116)
1 parent 1bfc3ff commit 89c7627

File tree

12 files changed

+86
-1513
lines changed

12 files changed

+86
-1513
lines changed

airbyte-integrations/connectors/source-microsoft-teams/README.md

+25-64
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,22 @@
1-
# Microsoft Teams Source
1+
# Microsoft Teams source connector
22

3-
This is the repository for the Microsoft Teams configuration based source connector.
4-
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/microsoft-teams).
3+
This directory contains the manifest-only connector for `source-microsoft-teams`.
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-
### Prerequisites
9-
10-
- Python (`^3.9`)
11-
- Poetry (`^1.7`) - installation instructions [here](https://python-poetry.org/docs/#installation)
12-
13-
### Installing the connector
14-
15-
From this connector directory, run:
16-
17-
```bash
18-
poetry install --with dev
19-
```
20-
21-
### 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/microsoft-teams).
227

23-
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/microsoft-teams)
24-
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `src/source_microsoft_teams/spec.yaml` file.
25-
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
26-
See `sample_files/sample_config.json` for a sample config file.
27-
28-
### Locally running the connector
29-
30-
```
31-
poetry run source-microsoft-teams spec
32-
poetry run source-microsoft-teams check --config secrets/config.json
33-
poetry run source-microsoft-teams discover --config secrets/config.json
34-
poetry run source-microsoft-teams read --config secrets/config.json --catalog sample_files/configured_catalog.json
35-
```
8+
## Local development
369

37-
### Running tests
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!
3813

39-
To run tests locally, from the connector directory run:
40-
41-
```
42-
poetry run pytest tests
43-
```
14+
If you prefer to develop locally, you can follow the instructions below.
4415

4516
### Building the docker image
4617

18+
You can build any manifest-only connector with `airbyte-ci`:
19+
4720
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
4821
2. Run the following command to build the docker image:
4922

@@ -53,50 +26,38 @@ airbyte-ci connectors --name=source-microsoft-teams build
5326

5427
An image will be available on your host with the tag `airbyte/source-microsoft-teams:dev`.
5528

29+
### Creating credentials
30+
31+
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/microsoft-teams)
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.
34+
5635
### Running as a docker container
5736

58-
Then run any of the connector commands as follows:
37+
Then run any of the standard source connector commands:
5938

60-
```
39+
```bash
6140
docker run --rm airbyte/source-microsoft-teams:dev spec
6241
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-microsoft-teams:dev check --config /secrets/config.json
6342
docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-microsoft-teams:dev discover --config /secrets/config.json
6443
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-microsoft-teams:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
6544
```
6645

67-
### Running our CI test suite
46+
### Running the CI test suite
6847

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

7150
```bash
7251
airbyte-ci connectors --name=source-microsoft-teams test
7352
```
7453

75-
### Customizing acceptance Tests
76-
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.
78-
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.
79-
80-
### Dependency Management
81-
82-
All of your dependencies should be managed via Poetry.
83-
To add a new dependency, run:
84-
85-
```bash
86-
poetry add <package-name>
87-
```
88-
89-
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
90-
9154
## Publishing a new version of the connector
9255

93-
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
94-
95-
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-microsoft-teams test`
96-
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)):
97-
- bump the `dockerImageTag` value in in `metadata.yaml`
98-
- bump the `version` value in `pyproject.toml`
99-
3. Make sure the `metadata.yaml` content is up to date.
56+
If you want to contribute changes to `source-microsoft-teams`, 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-microsoft-teams 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`
10061
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/microsoft-teams.md`).
10162
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).
10263
6. Pat yourself on the back for being an awesome contributor.

airbyte-integrations/connectors/source-microsoft-teams/__init__.py

-3
This file was deleted.

airbyte-integrations/connectors/source-microsoft-teams/acceptance-test-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ connector_image: airbyte/source-microsoft-teams:dev
44
acceptance_tests:
55
spec:
66
tests:
7-
- spec_path: "source_microsoft_teams/spec.yaml"
7+
- spec_path: "manifest.yaml"
88
connection:
99
tests:
1010
- config_path: "secrets/config.json"

airbyte-integrations/connectors/source-microsoft-teams/main.py

-8
This file was deleted.

airbyte-integrations/connectors/source-microsoft-teams/source_microsoft_teams/manifest.yaml airbyte-integrations/connectors/source-microsoft-teams/manifest.yaml

+49-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.44.0
1+
version: 4.3.0
22
type: DeclarativeSource
33
check:
44
type: CheckStream
@@ -403,7 +403,8 @@ streams:
403403
type: HttpRequester
404404
url_base: https://graph.microsoft.com/v1.0/
405405
path: >-
406-
groups/{{ stream_partition.group_id }}/members?$top={{ config.get('page_size', 20) }}
406+
groups/{{ stream_partition.group_id }}/members?$top={{ config.get('page_size',
407+
20) }}
407408
http_method: GET
408409
request_parameters: {}
409410
request_headers: {}
@@ -747,7 +748,8 @@ streams:
747748
type: HttpRequester
748749
url_base: https://graph.microsoft.com/v1.0/
749750
path: >-
750-
groups/{{ stream_partition.group_id }}/owners?$top={{ config.get('page_size', 20) }}
751+
groups/{{ stream_partition.group_id }}/owners?$top={{ config.get('page_size',
752+
20) }}
751753
http_method: GET
752754
request_parameters: {}
753755
request_headers: {}
@@ -1069,7 +1071,8 @@ streams:
10691071
type: HttpRequester
10701072
url_base: https://graph.microsoft.com/v1.0/
10711073
path: >-
1072-
groups/{{ stream_partition.group_id }}/conversations?$top={{ config.get('page_size', 20) }}
1074+
groups/{{ stream_partition.group_id }}/conversations?$top={{ config.get('page_size',
1075+
20) }}
10731076
http_method: GET
10741077
request_parameters: {}
10751078
request_headers: {}
@@ -1738,7 +1741,8 @@ streams:
17381741
url_base: https://graph.microsoft.com/v1.0/
17391742
path: >-
17401743
teams/{{ stream_partition.group_id }}/channels/{{
1741-
stream_partition.channel_id }}/members?$top={{ config.get('page_size', 20) }}
1744+
stream_partition.channel_id }}/members?$top={{ config.get('page_size', 20)
1745+
}}
17421746
http_method: GET
17431747
request_parameters: {}
17441748
request_headers: {}
@@ -2329,7 +2333,9 @@ streams:
23292333
authenticator:
23302334
type: OAuthAuthenticator
23312335
client_id: "{{ config['credentials']['client_id'] }}"
2332-
client_secret: "{{ config['credentials']['client_secret'] }}"
2336+
client_secret:
2337+
"{{ config['credentials']['client_secret']
2338+
}}"
23332339
refresh_request_body:
23342340
scope: https://graph.microsoft.com/.default
23352341
token_refresh_endpoint: >-
@@ -3035,7 +3041,9 @@ streams:
30353041
authenticator:
30363042
type: OAuthAuthenticator
30373043
client_id: "{{ config['credentials']['client_id'] }}"
3038-
client_secret: "{{ config['credentials']['client_secret'] }}"
3044+
client_secret:
3045+
"{{ config['credentials']['client_secret']
3046+
}}"
30393047
refresh_request_body:
30403048
scope: https://graph.microsoft.com/.default
30413049
token_refresh_endpoint: >-
@@ -3122,7 +3130,8 @@ streams:
31223130
url_base: https://graph.microsoft.com/v1.0/
31233131
path: >-
31243132
groups/{{ stream_partition.group_id }}/conversations/{{
3125-
stream_partition.conversation_id }}/threads?$top={{ config.get('page_size', 20) }}
3133+
stream_partition.conversation_id }}/threads?$top={{ config.get('page_size',
3134+
20) }}
31263135
http_method: GET
31273136
request_parameters: {}
31283137
request_headers: {}
@@ -3719,7 +3728,9 @@ streams:
37193728
authenticator:
37203729
type: OAuthAuthenticator
37213730
client_id: "{{ config['credentials']['client_id'] }}"
3722-
client_secret: "{{ config['credentials']['client_secret'] }}"
3731+
client_secret:
3732+
"{{ config['credentials']['client_secret']
3733+
}}"
37233734
refresh_request_body:
37243735
scope: https://graph.microsoft.com/.default
37253736
token_refresh_endpoint: >-
@@ -4466,7 +4477,9 @@ streams:
44664477
authenticator:
44674478
type: OAuthAuthenticator
44684479
client_id: "{{ config['credentials']['client_id'] }}"
4469-
client_secret: "{{ config['credentials']['client_secret'] }}"
4480+
client_secret:
4481+
"{{ config['credentials']['client_secret']
4482+
}}"
44704483
refresh_request_body:
44714484
scope: https://graph.microsoft.com/.default
44724485
token_refresh_endpoint: >-
@@ -4559,7 +4572,8 @@ streams:
45594572
url_base: https://graph.microsoft.com/v1.0/
45604573
path: >-
45614574
groups/{{ stream_partition.group_id }}/conversations/{{
4562-
stream_partition.conversation_id }}/threads?$top={{ config.get('page_size', 20) }}
4575+
stream_partition.conversation_id }}/threads?$top={{ config.get('page_size',
4576+
20) }}
45634577
http_method: GET
45644578
request_parameters: {}
45654579
request_headers: {}
@@ -4819,7 +4833,9 @@ streams:
48194833
authenticator:
48204834
type: OAuthAuthenticator
48214835
client_id: "{{ config['credentials']['client_id'] }}"
4822-
client_secret: "{{ config['credentials']['client_secret'] }}"
4836+
client_secret:
4837+
"{{ config['credentials']['client_secret']
4838+
}}"
48234839
refresh_request_body:
48244840
scope: https://graph.microsoft.com/.default
48254841
token_refresh_endpoint: >-
@@ -4911,7 +4927,9 @@ streams:
49114927
authenticator:
49124928
type: OAuthAuthenticator
49134929
client_id: "{{ config['credentials']['client_id'] }}"
4914-
client_secret: "{{ config['credentials']['client_secret'] }}"
4930+
client_secret:
4931+
"{{ config['credentials']['client_secret']
4932+
}}"
49154933
refresh_request_body:
49164934
scope: https://graph.microsoft.com/.default
49174935
token_refresh_endpoint: >-
@@ -5163,8 +5181,12 @@ streams:
51635181
request_headers: {}
51645182
authenticator:
51655183
type: OAuthAuthenticator
5166-
client_id: "{{ config['credentials']['client_id'] }}"
5167-
client_secret: "{{ config['credentials']['client_secret'] }}"
5184+
client_id:
5185+
"{{ config['credentials']['client_id']
5186+
}}"
5187+
client_secret:
5188+
"{{ config['credentials']['client_secret']
5189+
}}"
51685190
refresh_request_body:
51695191
scope: https://graph.microsoft.com/.default
51705192
token_refresh_endpoint: >-
@@ -5322,7 +5344,8 @@ streams:
53225344
type: HttpRequester
53235345
url_base: https://graph.microsoft.com/v1.0/
53245346
path: >-
5325-
groups/{{ stream_partition.group_id }}/drives?$top={{ config.get('page_size', 20) }}
5347+
groups/{{ stream_partition.group_id }}/drives?$top={{ config.get('page_size',
5348+
20) }}
53265349
http_method: GET
53275350
request_parameters: {}
53285351
request_headers: {}
@@ -5771,11 +5794,11 @@ spec:
57715794
title: Directory (tenant) ID
57725795
type: string
57735796
description:
5774-
"A globally unique identifier (GUID) that is different than
5775-
your organization name or domain. Follow these steps to obtain: open
5776-
one of the Teams where you belong inside the Teams Application -> Click
5777-
on the … next to the Team title -> Click on Get link to team -> Copy
5778-
the link to the team and grab the tenant ID form the URL"
5797+
"A globally unique identifier (GUID) that is different
5798+
than your organization name or domain. Follow these steps to obtain:
5799+
open one of the Teams where you belong inside the Teams Application
5800+
-> Click on the … next to the Team title -> Click on Get link to team
5801+
-> Copy the link to the team and grab the tenant ID form the URL"
57795802
airbyte_secret: true
57805803
client_id:
57815804
title: Client ID
@@ -5809,11 +5832,11 @@ spec:
58095832
title: Directory (tenant) ID
58105833
type: string
58115834
description:
5812-
"A globally unique identifier (GUID) that is different than
5813-
your organization name or domain. Follow these steps to obtain: open
5814-
one of the Teams where you belong inside the Teams Application -> Click
5815-
on the … next to the Team title -> Click on Get link to team -> Copy
5816-
the link to the team and grab the tenant ID form the URL"
5835+
"A globally unique identifier (GUID) that is different
5836+
than your organization name or domain. Follow these steps to obtain:
5837+
open one of the Teams where you belong inside the Teams Application
5838+
-> Click on the … next to the Team title -> Click on Get link to team
5839+
-> Copy the link to the team and grab the tenant ID form the URL"
58175840
airbyte_secret: true
58185841
client_id:
58195842
title: Client ID

airbyte-integrations/connectors/source-microsoft-teams/metadata.yaml

+10-5
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ data:
99
enabled: true
1010
remoteRegistries:
1111
pypi:
12-
enabled: true
12+
enabled: false
1313
packageName: airbyte-source-microsoft-teams
1414
connectorBuildOptions:
1515
# Please update to the latest version of the connector base image.
1616
# https://hub.docker.com/r/airbyte/python-connector-base
1717
# Please use the full address with sha256 hash to guarantee build reproducibility.
18-
baseImage: docker.io/airbyte/python-connector-base:2.0.0@sha256:c44839ba84406116e8ba68722a0f30e8f6e7056c726f447681bb9e9ece8bd916
18+
baseImage: docker.io/airbyte/source-declarative-manifest:4.4.1@sha256:a8c0f0d32782957beef2c65bac98756b04fff2f3ffc4568a6676d3c83a422a5b
1919
connectorSubtype: api
2020
connectorType: source
2121
definitionId: eaf50f04-21dd-4620-913b-2a83f5635227
22-
dockerImageTag: 1.1.11
22+
dockerImageTag: 1.2.0
2323
dockerRepository: airbyte/source-microsoft-teams
2424
githubIssueLabel: source-microsoft-teams
2525
icon: microsoft-teams.svg
@@ -30,13 +30,18 @@ data:
3030
releases:
3131
breakingChanges:
3232
1.0.0:
33-
message: Version 1.0.0 introduces breaking schema changes to all streams. A full schema refresh is required to upgrade to this version. For more details, see our <a href='https://docs.airbyte.io/integrations/sources/microsoft-teams-migrations'>migration guide</a>.
33+
message:
34+
Version 1.0.0 introduces breaking schema changes to all streams.
35+
A full schema refresh is required to upgrade to this version. For more details,
36+
see our <a
37+
href='https://docs.airbyte.io/integrations/sources/microsoft-teams-migrations'>migration
38+
guide</a>.
3439
upgradeDeadline: "2024-01-24"
3540
supportLevel: community
3641
documentationUrl: https://docs.airbyte.com/integrations/sources/microsoft-teams
3742
tags:
38-
- language:python
3943
- cdk:low-code
44+
- language:manifest-only
4045
connectorTestSuitesOptions:
4146
- suite: liveTests
4247
testConnections:

0 commit comments

Comments
 (0)