From 3d81eecbab03ed489e6b6887740eb4ece0ea2398 Mon Sep 17 00:00:00 2001 From: btkcodedev Date: Sun, 12 May 2024 19:40:21 +0530 Subject: [PATCH 1/4] make connector compatable with the builder --- .../connectors/source-k6-cloud/metadata.yaml | 2 +- .../connectors/source-k6-cloud/pyproject.toml | 2 +- .../source-k6-cloud/requirements.txt | 1 - .../source_k6_cloud/manifest.yaml | 428 ++++++++++-------- .../source-k6-cloud/source_k6_cloud/spec.yaml | 17 - docs/integrations/sources/k6-cloud.md | 1 + 6 files changed, 239 insertions(+), 212 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-k6-cloud/requirements.txt delete mode 100644 airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/spec.yaml diff --git a/airbyte-integrations/connectors/source-k6-cloud/metadata.yaml b/airbyte-integrations/connectors/source-k6-cloud/metadata.yaml index 881fedb81655..ed51905b1428 100644 --- a/airbyte-integrations/connectors/source-k6-cloud/metadata.yaml +++ b/airbyte-integrations/connectors/source-k6-cloud/metadata.yaml @@ -7,7 +7,7 @@ data: connectorSubtype: api connectorType: source definitionId: e300ece7-b073-43a3-852e-8aff36a57f13 - dockerImageTag: 0.1.3 + dockerImageTag: 0.1.4 dockerRepository: airbyte/source-k6-cloud documentationUrl: https://docs.airbyte.com/integrations/sources/k6-cloud githubIssueLabel: source-k6-cloud diff --git a/airbyte-integrations/connectors/source-k6-cloud/pyproject.toml b/airbyte-integrations/connectors/source-k6-cloud/pyproject.toml index 4c08a4e83a4b..c468851c1912 100644 --- a/airbyte-integrations/connectors/source-k6-cloud/pyproject.toml +++ b/airbyte-integrations/connectors/source-k6-cloud/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "0.1.3" +version = "0.1.4" name = "source-k6-cloud" description = "Source implementation for K6 Cloud." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-k6-cloud/requirements.txt b/airbyte-integrations/connectors/source-k6-cloud/requirements.txt deleted file mode 100644 index d6e1198b1ab1..000000000000 --- a/airbyte-integrations/connectors/source-k6-cloud/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e . diff --git a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml b/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml index 0fe0f661efd6..374fdda0b101 100644 --- a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml +++ b/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml @@ -1,199 +1,243 @@ -version: "0.29.0" +version: 0.78.5 + +type: DeclarativeSource + +check: + type: CheckStream + stream_names: + - organizations definitions: - selector: - extractor: - field_path: - - "{{ parameters['name'] }}" - requester: - url_base: "https://api.k6.io" - http_method: "GET" + streams: + organizations: + type: DeclarativeStream + name: organizations + primary_key: + - id + retriever: + type: SimpleRetriever + requester: + $ref: '#/definitions/base_requester' + path: /v3/organizations + http_method: GET + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: + - organizations + schema_loader: + type: InlineSchemaLoader + schema: + $ref: '#/schemas/organizations' + projects: + type: DeclarativeStream + name: projects + retriever: + type: SimpleRetriever + requester: + $ref: '#/definitions/base_requester' + path: /v3/organizations/{{ stream_slice.id }}/projects + http_method: GET + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: + - projects + paginator: + type: DefaultPaginator + page_token_option: + type: RequestOption + inject_into: request_parameter + field_name: page + page_size_option: + type: RequestOption + inject_into: body_data + field_name: page_size + pagination_strategy: + type: PageIncrement + page_size: 32 + partition_router: + - type: SubstreamPartitionRouter + parent_stream_configs: + - type: ParentStreamConfig + parent_key: id + partition_field: id + stream: + $ref: '#/definitions/streams/organizations' + schema_loader: + type: InlineSchemaLoader + schema: + $ref: '#/schemas/projects' + k6-tests: + type: DeclarativeStream + name: k6-tests + primary_key: + - id + retriever: + type: SimpleRetriever + requester: + $ref: '#/definitions/base_requester' + path: loadtests/v2/tests + http_method: GET + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: + - k6-tests + paginator: + type: DefaultPaginator + page_token_option: + type: RequestOption + inject_into: request_parameter + field_name: page + page_size_option: + type: RequestOption + inject_into: body_data + field_name: page_size + pagination_strategy: + type: PageIncrement + page_size: 32 + schema_loader: + type: InlineSchemaLoader + schema: + $ref: '#/schemas/k6-tests' + base_requester: + type: HttpRequester + url_base: https://api.k6.io authenticator: type: BearerAuthenticator - api_token: "{{ config['api_token'] }}" - - increment_paginator: - type: "DefaultPaginator" - pagination_strategy: - type: "PageIncrement" - page_size: 32 - page_token_option: - type: RequestOption - inject_into: "request_parameter" - field_name: "page" - page_size_option: - inject_into: "body_data" - field_name: "page_size" - retriever: - record_selector: - $ref: "#/definitions/selector" - paginator: - $ref: "#/definitions/increment_paginator" - requester: - $ref: "#/definitions/requester" - base_stream: - retriever: - $ref: "#/definitions/retriever" - organizations_stream: - $ref: "#/definitions/base_stream" - retriever: - record_selector: - $ref: "#/definitions/selector" - paginator: - type: NoPagination - requester: - $ref: "#/definitions/requester" - $parameters: - name: "organizations" - primary_key: "id" - path: "/v3/organizations" - schema_loader: - type: InlineSchemaLoader - schema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - id: - description: The unique identifier for the organization. - type: integer - name: - description: The name of the organization. - type: string - owner_id: - description: The user ID of the owner or creator of the organization. - type: integer - description: - description: A textual description or details about the organization. - type: string - billing_address: - description: The billing address of the organization. - type: string - billing_country: - description: The country associated with the billing address of the organization. - type: string - billing_email: - description: The billing email address for the organization. - type: string - vat_number: - description: Value-added tax (VAT) number for the organization. - type: string - created: - description: The timestamp when the organization was created. - type: string - updated: - description: The timestamp when the organization data was last updated. - type: string - is_default: - description: Indicates if the organization is set as the default organization. - type: boolean - is_saml_org: - description: Flag showing if the organization uses SAML for authentication. - type: boolean - organizations_partition_router: - type: SubstreamPartitionRouter - parent_stream_configs: - - stream: "#/definitions/organizations_stream" - parent_key: id - partition_field: id - projects_stream: - $ref: "#/definitions/base_stream" - type: DeclarativeStream - $parameters: - name: "projects" - retriever: - $ref: "#/definitions/retriever" - requester: - $ref: "#/definitions/requester" - path: "/v3/organizations/{{ stream_slice.id }}/projects" - partition_router: - $ref: "#/definitions/organizations_partition_router" - record_selector: - $ref: "#/definitions/selector" - schema_loader: - type: InlineSchemaLoader - schema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - id: - description: The unique identifier for the project - type: integer - name: - description: The name of the project - type: string - description: - description: A short description of the project - type: string - organization_id: - description: - The unique identifier of the organization the project belongs - to - type: integer - created: - description: The timestamp when the project was created - type: string - updated: - description: The timestamp when the project was last updated - type: string - is_default: - description: A flag indicating if the project is the default one - type: boolean - tests_stream: - $ref: "#/definitions/base_stream" - retriever: - record_selector: - $ref: "#/definitions/selector" - paginator: - $ref: "#/definitions/increment_paginator" - requester: - $ref: "#/definitions/requester" - $parameters: - name: "k6-tests" - primary_key: "id" - path: "loadtests/v2/tests" + api_token: '{{ config[''api_token''] }}' - schema_loader: - type: InlineSchemaLoader - schema: - $schema: http://json-schema.org/draft-07/schema# - type: object - properties: - id: - description: Unique identifier for the k6 test. - type: integer - project_id: - description: Identifier for the project to which this k6 test belongs. - type: integer - user_id: - description: Identifier of the user who owns this k6 test. - type: integer - name: - description: Name of the k6 test. - type: string - created: - description: Date and time when the k6 test was created. - type: string - updated: - description: Date and time when the k6 test was last updated. - type: string - last_test_run_id: - description: - Identifier for the last test run associated with this k6 - test. - type: string - test_run_ids: - description: - List of identifiers for all test runs associated with this - k6 test. - type: array - script: - description: The script content of the k6 test. - type: string streams: - - "#/definitions/organizations_stream" - - "#/definitions/projects_stream" - - "#/definitions/tests_stream" + - $ref: '#/definitions/streams/organizations' + - $ref: '#/definitions/streams/projects' + - $ref: '#/definitions/streams/k6-tests' -check: - stream_names: - - "organizations" +spec: + type: Spec + connection_specification: + type: object + $schema: http://json-schema.org/draft-07/schema# + required: + - api_token + properties: + api_token: + type: string + title: Api Token + description: >- + Your API Token. See here. The key + is case sensitive. + airbyte_secret: true + order: 0 + additionalProperties: true + +metadata: + autoImportSchema: + organizations: false + projects: false + k6-tests: false + +schemas: + organizations: + type: object + $schema: http://json-schema.org/draft-07/schema# + properties: + billing_address: + type: string + description: The billing address of the organization. + billing_country: + type: string + description: The country associated with the billing address of the organization. + billing_email: + type: string + description: The billing email address for the organization. + created: + type: string + description: The timestamp when the organization was created. + description: + type: string + description: A textual description or details about the organization. + id: + type: integer + description: The unique identifier for the organization. + is_default: + type: boolean + description: Indicates if the organization is set as the default organization. + is_saml_org: + type: boolean + description: Flag showing if the organization uses SAML for authentication. + name: + type: string + description: The name of the organization. + owner_id: + type: integer + description: The user ID of the owner or creator of the organization. + updated: + type: string + description: The timestamp when the organization data was last updated. + vat_number: + type: string + description: Value-added tax (VAT) number for the organization. + additionalProperties: true + projects: + type: object + $schema: http://json-schema.org/draft-07/schema# + properties: + created: + type: string + description: The timestamp when the project was created + description: + type: string + description: A short description of the project + id: + type: integer + description: The unique identifier for the project + is_default: + type: boolean + description: A flag indicating if the project is the default one + name: + type: string + description: The name of the project + organization_id: + type: integer + description: The unique identifier of the organization the project belongs to + updated: + type: string + description: The timestamp when the project was last updated + additionalProperties: true + k6-tests: + type: object + $schema: http://json-schema.org/draft-07/schema# + properties: + created: + type: string + description: Date and time when the k6 test was created. + id: + type: integer + description: Unique identifier for the k6 test. + last_test_run_id: + type: string + description: Identifier for the last test run associated with this k6 test. + name: + type: string + description: Name of the k6 test. + project_id: + type: integer + description: Identifier for the project to which this k6 test belongs. + script: + type: string + description: The script content of the k6 test. + test_run_ids: + type: array + description: List of identifiers for all test runs associated with this k6 test. + updated: + type: string + description: Date and time when the k6 test was last updated. + user_id: + type: integer + description: Identifier of the user who owns this k6 test. + additionalProperties: true diff --git a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/spec.yaml b/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/spec.yaml deleted file mode 100644 index f626cb7532d0..000000000000 --- a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/spec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -documentationUrl: https://docs.airbyte.com/integrations/sources/k6-cloud -connectionSpecification: - $schema: http://json-schema.org/draft-07/schema# - title: K6 Cloud Spec - type: object - required: - - api_token - additionalProperties: true - properties: - api_token: - title: Api Token - type: string - description: >- - Your API Token. See here. The key is - case sensitive. - airbyte_secret: true diff --git a/docs/integrations/sources/k6-cloud.md b/docs/integrations/sources/k6-cloud.md index 48a14a238dc5..ace248872b4f 100644 --- a/docs/integrations/sources/k6-cloud.md +++ b/docs/integrations/sources/k6-cloud.md @@ -29,6 +29,7 @@ This source can sync data from the [K6 Cloud API](https://developers.k6.io). At | Version | Date | Pull Request | Subject | | :------ | :--------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------ | +| 0.1.4 | 2024-05-30 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Make connector compatable with the builder | | 0.1.3 | 2024-04-19 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Upgrade to CDK 0.80.0 and manage dependencies with Poetry. | | 0.1.2 | 2024-04-15 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Base image migration: remove Dockerfile and use the python-connector-base image | | 0.1.1 | 2024-04-12 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | schema descriptions | From eae1757cbeb2dfaed1ad781e50c128193010ebf0 Mon Sep 17 00:00:00 2001 From: btkcodedev Date: Sun, 12 May 2024 19:42:21 +0530 Subject: [PATCH 2/4] chore: format --- .../source_k6_cloud/manifest.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml b/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml index 374fdda0b101..6ad81b272455 100644 --- a/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml +++ b/airbyte-integrations/connectors/source-k6-cloud/source_k6_cloud/manifest.yaml @@ -17,7 +17,7 @@ definitions: retriever: type: SimpleRetriever requester: - $ref: '#/definitions/base_requester' + $ref: "#/definitions/base_requester" path: /v3/organizations http_method: GET record_selector: @@ -29,14 +29,14 @@ definitions: schema_loader: type: InlineSchemaLoader schema: - $ref: '#/schemas/organizations' + $ref: "#/schemas/organizations" projects: type: DeclarativeStream name: projects retriever: type: SimpleRetriever requester: - $ref: '#/definitions/base_requester' + $ref: "#/definitions/base_requester" path: /v3/organizations/{{ stream_slice.id }}/projects http_method: GET record_selector: @@ -65,11 +65,11 @@ definitions: parent_key: id partition_field: id stream: - $ref: '#/definitions/streams/organizations' + $ref: "#/definitions/streams/organizations" schema_loader: type: InlineSchemaLoader schema: - $ref: '#/schemas/projects' + $ref: "#/schemas/projects" k6-tests: type: DeclarativeStream name: k6-tests @@ -78,7 +78,7 @@ definitions: retriever: type: SimpleRetriever requester: - $ref: '#/definitions/base_requester' + $ref: "#/definitions/base_requester" path: loadtests/v2/tests http_method: GET record_selector: @@ -103,18 +103,18 @@ definitions: schema_loader: type: InlineSchemaLoader schema: - $ref: '#/schemas/k6-tests' + $ref: "#/schemas/k6-tests" base_requester: type: HttpRequester url_base: https://api.k6.io authenticator: type: BearerAuthenticator - api_token: '{{ config[''api_token''] }}' + api_token: "{{ config['api_token'] }}" streams: - - $ref: '#/definitions/streams/organizations' - - $ref: '#/definitions/streams/projects' - - $ref: '#/definitions/streams/k6-tests' + - $ref: "#/definitions/streams/organizations" + - $ref: "#/definitions/streams/projects" + - $ref: "#/definitions/streams/k6-tests" spec: type: Spec From 80befbb0ff33e95d718208f01942ebabfada197a Mon Sep 17 00:00:00 2001 From: btkcodedev Date: Sun, 12 May 2024 19:43:39 +0530 Subject: [PATCH 3/4] update docs --- docs/integrations/sources/k6-cloud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/sources/k6-cloud.md b/docs/integrations/sources/k6-cloud.md index ace248872b4f..45f513585f7d 100644 --- a/docs/integrations/sources/k6-cloud.md +++ b/docs/integrations/sources/k6-cloud.md @@ -29,7 +29,7 @@ This source can sync data from the [K6 Cloud API](https://developers.k6.io). At | Version | Date | Pull Request | Subject | | :------ | :--------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------ | -| 0.1.4 | 2024-05-30 | [00000](https://github.com/airbytehq/airbyte/pull/00000) | Make connector compatable with the builder | +| 0.1.4 | 2024-05-30 | [38150](https://github.com/airbytehq/airbyte/pull/38150) | Make connector compatable with the builder | | 0.1.3 | 2024-04-19 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Upgrade to CDK 0.80.0 and manage dependencies with Poetry. | | 0.1.2 | 2024-04-15 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Base image migration: remove Dockerfile and use the python-connector-base image | | 0.1.1 | 2024-04-12 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | schema descriptions | From b2a760fa94f8f460ce3550b8683387efac75f4d8 Mon Sep 17 00:00:00 2001 From: btkcodedev Date: Wed, 15 May 2024 18:01:15 +0530 Subject: [PATCH 4/4] update dates --- docs/integrations/sources/k6-cloud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/sources/k6-cloud.md b/docs/integrations/sources/k6-cloud.md index 45f513585f7d..95059fbbe543 100644 --- a/docs/integrations/sources/k6-cloud.md +++ b/docs/integrations/sources/k6-cloud.md @@ -29,7 +29,7 @@ This source can sync data from the [K6 Cloud API](https://developers.k6.io). At | Version | Date | Pull Request | Subject | | :------ | :--------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------ | -| 0.1.4 | 2024-05-30 | [38150](https://github.com/airbytehq/airbyte/pull/38150) | Make connector compatable with the builder | +| 0.1.4 | 2024-05-15 | [38150](https://github.com/airbytehq/airbyte/pull/38150) | Make connector compatable with the builder | | 0.1.3 | 2024-04-19 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Upgrade to CDK 0.80.0 and manage dependencies with Poetry. | | 0.1.2 | 2024-04-15 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | Base image migration: remove Dockerfile and use the python-connector-base image | | 0.1.1 | 2024-04-12 | [37181](https://github.com/airbytehq/airbyte/pull/37181) | schema descriptions |