diff --git a/airbyte-integrations/connectors/source-gitlab/Dockerfile b/airbyte-integrations/connectors/source-gitlab/Dockerfile index 8f5a9b3e433..d59b2d2ee78 100644 --- a/airbyte-integrations/connectors/source-gitlab/Dockerfile +++ b/airbyte-integrations/connectors/source-gitlab/Dockerfile @@ -13,5 +13,5 @@ COPY main.py ./ ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=1.4.2 +LABEL io.airbyte.version=1.5.0 LABEL io.airbyte.name=airbyte/source-gitlab diff --git a/airbyte-integrations/connectors/source-gitlab/metadata.yaml b/airbyte-integrations/connectors/source-gitlab/metadata.yaml index e198fc9b315..1165aa7faee 100644 --- a/airbyte-integrations/connectors/source-gitlab/metadata.yaml +++ b/airbyte-integrations/connectors/source-gitlab/metadata.yaml @@ -5,7 +5,7 @@ data: connectorSubtype: api connectorType: source definitionId: 5e6175e5-68e1-4c17-bff9-56103bbb0d80 - dockerImageTag: 1.4.2 + dockerImageTag: 1.5.0 dockerRepository: airbyte/source-gitlab githubIssueLabel: source-gitlab icon: gitlab.svg @@ -16,7 +16,7 @@ data: enabled: true oss: enabled: true - releaseStage: beta + releaseStage: generally_available documentationUrl: https://docs.airbyte.com/integrations/sources/gitlab tags: - language:python diff --git a/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py b/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py index d2528c2ffd1..bad322208f7 100644 --- a/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py +++ b/airbyte-integrations/connectors/source-gitlab/source_gitlab/source.py @@ -91,6 +91,11 @@ class SourceGitlab(AbstractSource): self.__groups_stream: Optional[GitlabStream] = None self.__projects_stream: Optional[GitlabStream] = None + @staticmethod + def _ensure_default_values(config: MutableMapping[str, Any]) -> MutableMapping[str, Any]: + config["api_url"] = config.get("api_url") or "gitlab.com" + return config + def _groups_stream(self, config: MutableMapping[str, Any]) -> Groups: if not self.__groups_stream: auth_params = self._auth_params(config) @@ -136,6 +141,7 @@ class SourceGitlab(AbstractSource): return os.environ.get("DEPLOYMENT_MODE", "").upper() != "CLOUD" def check_connection(self, logger, config) -> Tuple[bool, any]: + config = self._ensure_default_values(config) is_valid, scheme, _ = parse_url(config["api_url"]) if not is_valid: return False, "Invalid API resource locator." @@ -151,6 +157,7 @@ class SourceGitlab(AbstractSource): return False, f"Unable to connect to Gitlab API with the provided credentials - {repr(error)}" def streams(self, config: MutableMapping[str, Any]) -> List[Stream]: + config = self._ensure_default_values(config) auth_params = self._auth_params(config) groups, projects = self._groups_stream(config), self._projects_stream(config) diff --git a/airbyte-integrations/connectors/source-gitlab/source_gitlab/spec.json b/airbyte-integrations/connectors/source-gitlab/source_gitlab/spec.json index e3ec9fa01cd..b843c96dc30 100644 --- a/airbyte-integrations/connectors/source-gitlab/source_gitlab/spec.json +++ b/airbyte-integrations/connectors/source-gitlab/source_gitlab/spec.json @@ -4,7 +4,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Source Gitlab Spec", "type": "object", - "required": ["api_url", "start_date", "credentials"], + "required": ["start_date", "credentials"], "additionalProperties": true, "properties": { "credentials": { @@ -73,23 +73,23 @@ } ] }, - "api_url": { - "type": "string", - "examples": ["gitlab.com", "https://gitlab.com", "https://gitlab.company.org"], - "title": "API URL", - "default": "gitlab.com", - "description": "Please enter your basic URL from GitLab instance.", - "order": 1 - }, "start_date": { "type": "string", "title": "Start Date", "description": "The date from which you'd like to replicate data for GitLab API, in the format YYYY-MM-DDT00:00:00Z. All data generated after this date will be replicated.", "examples": ["2021-03-01T00:00:00Z"], "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$", - "order": 2, + "order": 1, "format": "date-time" }, + "api_url": { + "type": "string", + "examples": ["gitlab.com", "https://gitlab.com", "https://gitlab.company.org"], + "title": "API URL", + "default": "gitlab.com", + "description": "Please enter your basic URL from GitLab instance.", + "order": 2 + }, "groups": { "type": "string", "examples": ["airbyte.io"], diff --git a/docs/integrations/sources/gitlab.md b/docs/integrations/sources/gitlab.md index 99cbac18bd3..e8f422e954b 100644 --- a/docs/integrations/sources/gitlab.md +++ b/docs/integrations/sources/gitlab.md @@ -105,6 +105,7 @@ Gitlab has the [rate limits](https://docs.gitlab.com/ee/user/gitlab_com/index.ht | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------------| +| 1.5.0 | 2023-06-15 | [27392](https://github.com/airbytehq/airbyte/pull/27392) | Make API URL an optional parameter in spec. | | 1.4.2 | 2023-06-15 | [27346](https://github.com/airbytehq/airbyte/pull/27346) | Partially revert changes made in version 1.0.4, disallow http calls in cloud. | | 1.4.1 | 2023-06-13 | [27351](https://github.com/airbytehq/airbyte/pull/27351) | Fix OAuth token expiry date. | | 1.4.0 | 2023-06-12 | [27234](https://github.com/airbytehq/airbyte/pull/27234) | Skip stream slices on 403/404 errors, do not fail syncs. |