Skip to content

Commit

Permalink
🐛 Source Slack: Join to the channels while read instead of `discove…
Browse files Browse the repository at this point in the history
…ry` (#35131)
  • Loading branch information
bazarnov authored and xiaohansong committed Feb 13, 2024
1 parent 8b53a06 commit 77f0a37
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 120 deletions.
20 changes: 10 additions & 10 deletions airbyte-integrations/connectors/source-slack/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Orbit Source

This is the repository for the Orbit configuration based source connector.
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/orbit).
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.com/integrations/sources/slack).

## Local development

#### Create credentials
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/orbit)
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/slack)
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_orbit/spec.yaml` file.
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
See `integration_tests/sample_config.json` for a sample config file.

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

### Locally running the connector docker image
Expand All @@ -20,23 +20,23 @@ and place them into `secrets/config.json`.
#### Build
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
```bash
airbyte-ci connectors --name source-orbit build
airbyte-ci connectors --name source-slack build
```

An image will be built with the tag `airbyte/source-orbit:dev`.
An image will be built with the tag `airbyte/source-slack:dev`.

**Via `docker build`:**
```bash
docker build -t airbyte/source-orbit:dev .
docker build -t airbyte/source-slack:dev .
```

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

## Testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ acceptance_tests:
expect_records:
path: "integration_tests/expected_records.jsonl"
timeout_seconds: 4800
ignored_fields:
channels:
- name: updated
bypass_reason: Value can change while interacting with data
full_refresh:
tests:
- config_path: "secrets/config.json"
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-slack/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: c2281cee-86f9-4a86-bb48-d23286b4c7bd
dockerImageTag: 0.3.7
dockerImageTag: 0.3.8
dockerRepository: airbyte/source-slack
documentationUrl: https://docs.airbyte.com/integrations/sources/slack
githubIssueLabel: source-slack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@
"properties": {
"type": {
"type": ["null", "string"]
},
"block_id": {
"type": ["null", "string"]
},
"elements": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {
"elements": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {
"text": {
"type": ["null", "string"]
},
"type": {
"type": ["null", "string"]
}
}
}
},
"type": {
"type": ["null", "string"]
}
}
}
}
},
"type": ["null", "object"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,39 @@
"properties": {
"type": {
"type": ["null", "string"]
},
"block_id": {
"type": ["null", "string"]
},
"elements": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {
"elements": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {
"text": {
"type": ["null", "string"]
},
"type": {
"type": ["null", "string"]
},
"user_id": {
"type": ["null", "string"]
}
}
}
},
"type": {
"type": ["null", "string"]
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"type": "object",
"additionalProperties": true,
"properties": {
"always_active": {
"type": ["null", "boolean"]
},
"avatar_hash": {
"type": "string"
},
Expand All @@ -34,6 +37,13 @@
"email": {
"type": "string"
},
"fields": {
"type": ["null", "object"],
"additionalProperties": true
},
"huddle_state": {
"type": "string"
},
"image_24": {
"type": "string"
},
Expand Down Expand Up @@ -75,6 +85,18 @@
},
"skype": {
"type": "string"
},
"status_emoji_display_info": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
},
"status_expiration": {
"type": ["null", "integer"]
},
"status_text_canonical": {
"type": ["null", "string"]
}
}
},
Expand Down
Loading

0 comments on commit 77f0a37

Please sign in to comment.