From 8443e845659935a2216762bdfbb8a08db0c0f0b1 Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Fri, 28 Oct 2022 16:55:03 +0300 Subject: [PATCH 1/4] #16519 source metabase: allow using only https urls --- .../connectors/source-metabase/Dockerfile | 2 +- .../acceptance-test-config.yml | 6 ++++ .../integration_tests/config_http_url.json | 3 ++ .../integration_tests/invalid_config.json | 2 +- .../connectors/source-metabase/setup.py | 2 +- .../source_metabase/schemas/activity.json | 20 +++++++++++- .../source-metabase/source_metabase/spec.yaml | 1 + docs/integrations/sources/metabase.md | 31 ++++++++++--------- 8 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 airbyte-integrations/connectors/source-metabase/integration_tests/config_http_url.json diff --git a/airbyte-integrations/connectors/source-metabase/Dockerfile b/airbyte-integrations/connectors/source-metabase/Dockerfile index 52cc9096794a..03fdb7cf3afc 100644 --- a/airbyte-integrations/connectors/source-metabase/Dockerfile +++ b/airbyte-integrations/connectors/source-metabase/Dockerfile @@ -12,5 +12,5 @@ RUN pip install . ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.0 +LABEL io.airbyte.version=0.2.0 LABEL io.airbyte.name=airbyte/source-metabase diff --git a/airbyte-integrations/connectors/source-metabase/acceptance-test-config.yml b/airbyte-integrations/connectors/source-metabase/acceptance-test-config.yml index 9efa11184e37..c5de84a9b6a6 100644 --- a/airbyte-integrations/connectors/source-metabase/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-metabase/acceptance-test-config.yml @@ -2,13 +2,19 @@ connector_image: airbyte/source-metabase:dev tests: spec: - spec_path: "source_metabase/spec.yaml" + backward_compatibility_tests_config: + disable_for_version: "0.1.0" connection: - config_path: "secrets/config.json" status: "succeed" - config_path: "integration_tests/invalid_config.json" status: "failed" + - config_path: "integration_tests/config_http_url.json" + status: "failed" discovery: - config_path: "secrets/config.json" + backward_compatibility_tests_config: + disable_for_version: "0.1.0" basic_read: - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-metabase/integration_tests/config_http_url.json b/airbyte-integrations/connectors/source-metabase/integration_tests/config_http_url.json new file mode 100644 index 000000000000..1785e4008d5b --- /dev/null +++ b/airbyte-integrations/connectors/source-metabase/integration_tests/config_http_url.json @@ -0,0 +1,3 @@ +{ + "instance_api_url": "http://localhost:3000" +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-metabase/integration_tests/invalid_config.json b/airbyte-integrations/connectors/source-metabase/integration_tests/invalid_config.json index 474f00af911d..bdbbeec1215b 100644 --- a/airbyte-integrations/connectors/source-metabase/integration_tests/invalid_config.json +++ b/airbyte-integrations/connectors/source-metabase/integration_tests/invalid_config.json @@ -1,5 +1,5 @@ { - "instance_api_url": "localhost:3000", + "instance_api_url": "https://localhost:3000", "username": "wrong-account-id", "password": "2020-05-01T00:00:00Z", "session_token": "invalid" diff --git a/airbyte-integrations/connectors/source-metabase/setup.py b/airbyte-integrations/connectors/source-metabase/setup.py index 4ad3f0543eac..df3e834b959a 100644 --- a/airbyte-integrations/connectors/source-metabase/setup.py +++ b/airbyte-integrations/connectors/source-metabase/setup.py @@ -5,7 +5,7 @@ from setuptools import find_packages, setup -MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1", "requests>=2.28.0", "types-requests>=2.27.30"] +MAIN_REQUIREMENTS = ["airbyte-cdk~=0.2", "requests>=2.28.0", "types-requests>=2.27.30"] TEST_REQUIREMENTS = [ "pytest~=6.1", diff --git a/airbyte-integrations/connectors/source-metabase/source_metabase/schemas/activity.json b/airbyte-integrations/connectors/source-metabase/source_metabase/schemas/activity.json index 23619ff7727a..51835b17d056 100644 --- a/airbyte-integrations/connectors/source-metabase/source_metabase/schemas/activity.json +++ b/airbyte-integrations/connectors/source-metabase/source_metabase/schemas/activity.json @@ -5,7 +5,25 @@ "type": ["null", "integer"] }, "table": { - "type": ["null", "string"] + "type": ["null", "object"], + "properties": { + "active": {"type": "boolean"}, + "caveats": {"type": ["null", "string"]}, + "created_at": {"type": ["null", "string"]}, + "db_id": {"type": "integer"}, + "description": {"type": ["null", "string"]}, + "display_name": {"type": ["null", "string"]}, + "entity_type": {"type": ["null", "string"]}, + "field_order": {"type": ["null", "string"]}, + "id": {"type": "integer"}, + "initial_sync_status": {"type": ["null", "string"]}, + "name": {"type": ["null", "string"]}, + "points_of_interest": {"type": ["null", "array"]}, + "schema": {"type": ["null", "string"]}, + "show_in_getting_started": {"type": "boolean"}, + "updated_at": {"type": ["null", "string"]}, + "visibility_type": {"type": ["null", "string"]} + } }, "database_id": { "type": ["null", "integer"] diff --git a/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml b/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml index a094f21d894e..f8ec87f107e7 100644 --- a/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml +++ b/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml @@ -14,6 +14,7 @@ connectionSpecification: URL to your metabase instance API examples: - "http://localhost:3000/api/" + pattern: "https://.+" order: 0 username: type: string diff --git a/docs/integrations/sources/metabase.md b/docs/integrations/sources/metabase.md index 7046db67d243..066a81a42d3b 100644 --- a/docs/integrations/sources/metabase.md +++ b/docs/integrations/sources/metabase.md @@ -16,21 +16,21 @@ This Source is capable of syncing the following Streams: ### Data type mapping -| Integration Type | Airbyte Type | Notes | -| :--- | :--- | :--- | -| `string` | `string` | | -| `integer`, `number` | `number` | | -| `array` | `array` | | -| `object` | `object` | | +| Integration Type | Airbyte Type | Notes | +|:--------------------|:-------------|:------| +| `string` | `string` | | +| `integer`, `number` | `number` | | +| `array` | `array` | | +| `object` | `object` | | ### Features -| Feature | Supported?\(Yes/No\) | Notes | -| :--- | :--- | :--- | -| Full Refresh Sync | Yes | | -| Incremental Sync | No | | -| SSL connection | Yes | -| Namespaces | No | | +| Feature | Supported?\(Yes/No\) | Notes | +|:------------------|:---------------------|:------| +| Full Refresh Sync | Yes | | +| Incremental Sync | No | | +| SSL connection | Yes | +| Namespaces | No | | ## Getting started @@ -68,6 +68,7 @@ authenticated query is running, which might trigger security alerts on the user' ## Changelog -| Version | Date | Pull Request | Subject | -| :--- | :--- | :--- | :--- | -| 0.1.0 | 2022-06-15 | [6975](https://github.com/airbytehq/airbyte/pull/13752) | Initial (alpha) release | +| Version | Date | Pull Request | Subject | +|:--------|:-----------|:---------------------------------------------------------|:---------------------------| +| 0.2.0 | 2022-10-28 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Disallow using `http` URLs | +| 0.1.0 | 2022-06-15 | [6975](https://github.com/airbytehq/airbyte/pull/13752) | Initial (alpha) release | From b9897e5642d95744a538ce2091558044231f11fc Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Fri, 28 Oct 2022 16:56:23 +0300 Subject: [PATCH 2/4] source metabase: upd changelog --- docs/integrations/sources/metabase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/sources/metabase.md b/docs/integrations/sources/metabase.md index 066a81a42d3b..207e242e6a29 100644 --- a/docs/integrations/sources/metabase.md +++ b/docs/integrations/sources/metabase.md @@ -70,5 +70,5 @@ authenticated query is running, which might trigger security alerts on the user' | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:---------------------------| -| 0.2.0 | 2022-10-28 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Disallow using `http` URLs | +| 0.2.0 | 2022-10-28 | [18607](https://github.com/airbytehq/airbyte/pull/18607) | Disallow using `http` URLs | | 0.1.0 | 2022-06-15 | [6975](https://github.com/airbytehq/airbyte/pull/13752) | Initial (alpha) release | From dce6b84ee94ea9e285c27904436018efbd5698de Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Fri, 28 Oct 2022 20:22:14 +0300 Subject: [PATCH 3/4] #16519 fix url regexp --- .../connectors/source-metabase/source_metabase/spec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml b/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml index f8ec87f107e7..0dc3a953cffb 100644 --- a/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml +++ b/airbyte-integrations/connectors/source-metabase/source_metabase/spec.yaml @@ -13,8 +13,8 @@ connectionSpecification: description: >- URL to your metabase instance API examples: - - "http://localhost:3000/api/" - pattern: "https://.+" + - "https://localhost:3000/api/" + pattern: "^https://" order: 0 username: type: string From 3749a2ed5c092635462f308b8c141d3bfa81aa8b Mon Sep 17 00:00:00 2001 From: Octavia Squidington III Date: Mon, 31 Oct 2022 12:23:40 +0000 Subject: [PATCH 4/4] auto-bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- .../init/src/main/resources/seed/source_specs.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 33a126256226..ad7fd4035de1 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -722,7 +722,7 @@ - name: Metabase sourceDefinitionId: c7cb421b-942e-4468-99ee-e369bcabaec5 dockerRepository: airbyte/source-metabase - dockerImageTag: 0.1.0 + dockerImageTag: 0.2.0 documentationUrl: https://docs.airbyte.com/integrations/sources/metabase icon: metabase.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index de2d93a704ed..6d2a85cef455 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -6641,7 +6641,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-metabase:0.1.0" +- dockerImage: "airbyte/source-metabase:0.2.0" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/metabase" connectionSpecification: @@ -6657,7 +6657,8 @@ title: "Metabase Instance API URL" description: "URL to your metabase instance API" examples: - - "http://localhost:3000/api/" + - "https://localhost:3000/api/" + pattern: "^https://" order: 0 username: type: "string"