airbyte-source-gitlab 3.0.0.dev202403062351__tar.gz → 4.0.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/PKG-INFO +3 -3
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/README.md +1 -1
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/pyproject.toml +2 -2
- airbyte_source_gitlab-4.0.0/source_gitlab/components/partition_routers.py +43 -0
- airbyte_source_gitlab-4.0.0/source_gitlab/manifest.yaml +614 -0
- airbyte_source_gitlab-4.0.0/source_gitlab/source.py +30 -0
- airbyte_source_gitlab-3.0.0.dev202403062351/source_gitlab/source.py +0 -245
- airbyte_source_gitlab-3.0.0.dev202403062351/source_gitlab/streams.py +0 -431
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/__init__.py +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/config_migrations.py +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/run.py +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/branches.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/commits.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/deployments.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/epic_issues.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/epics.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/group_issue_boards.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/group_labels.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/group_members.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/group_milestones.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/groups.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/issues.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/jobs.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/merge_request_commits.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/merge_requests.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/pipelines.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/pipelines_extended.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/project_labels.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/project_members.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/project_milestones.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/projects.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/releases.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/tags.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/schemas/users.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/spec.json +0 -0
- {airbyte_source_gitlab-3.0.0.dev202403062351 → airbyte_source_gitlab-4.0.0}/source_gitlab/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: airbyte-source-gitlab
|
3
|
-
Version:
|
3
|
+
Version: 4.0.0
|
4
4
|
Summary: Source implementation for GitLab.
|
5
5
|
Home-page: https://airbyte.com
|
6
6
|
License: MIT
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
15
|
-
Requires-Dist: airbyte-cdk (
|
15
|
+
Requires-Dist: airbyte-cdk (>=0,<1)
|
16
16
|
Requires-Dist: vcrpy (==4.1.1)
|
17
17
|
Project-URL: Documentation, https://docs.airbyte.com/integrations/sources/gitlab
|
18
18
|
Project-URL: Repository, https://github.com/airbytehq/airbyte
|
@@ -50,7 +50,7 @@ See `sample_files/sample_config.json` for a sample config file.
|
|
50
50
|
poetry run source-gitlab spec
|
51
51
|
poetry run source-gitlab check --config secrets/config.json
|
52
52
|
poetry run source-gitlab discover --config secrets/config.json
|
53
|
-
poetry run source-gitlab read --config secrets/config.json --catalog
|
53
|
+
poetry run source-gitlab read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
54
54
|
```
|
55
55
|
|
56
56
|
### Running unit tests
|
@@ -30,7 +30,7 @@ See `sample_files/sample_config.json` for a sample config file.
|
|
30
30
|
poetry run source-gitlab spec
|
31
31
|
poetry run source-gitlab check --config secrets/config.json
|
32
32
|
poetry run source-gitlab discover --config secrets/config.json
|
33
|
-
poetry run source-gitlab read --config secrets/config.json --catalog
|
33
|
+
poetry run source-gitlab read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
34
34
|
```
|
35
35
|
|
36
36
|
### Running unit tests
|
@@ -5,7 +5,7 @@ requires = [
|
|
5
5
|
build-backend = "poetry.core.masonry.api"
|
6
6
|
|
7
7
|
[tool.poetry]
|
8
|
-
version = "
|
8
|
+
version = "4.0.0"
|
9
9
|
name = "airbyte-source-gitlab"
|
10
10
|
description = "Source implementation for GitLab."
|
11
11
|
authors = [
|
@@ -22,7 +22,7 @@ packages = [
|
|
22
22
|
|
23
23
|
[tool.poetry.dependencies]
|
24
24
|
python = "^3.9,<3.12"
|
25
|
-
airbyte-cdk = "
|
25
|
+
airbyte-cdk = "^0"
|
26
26
|
vcrpy = "==4.1.1"
|
27
27
|
|
28
28
|
[tool.poetry.scripts]
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
|
3
|
+
#
|
4
|
+
|
5
|
+
|
6
|
+
from dataclasses import dataclass
|
7
|
+
from typing import Iterable
|
8
|
+
|
9
|
+
from airbyte_cdk.models import SyncMode
|
10
|
+
from airbyte_cdk.sources.declarative.partition_routers.substream_partition_router import SubstreamPartitionRouter
|
11
|
+
from airbyte_cdk.sources.declarative.types import StreamSlice
|
12
|
+
|
13
|
+
|
14
|
+
@dataclass
|
15
|
+
class GroupStreamsPartitionRouter(SubstreamPartitionRouter):
|
16
|
+
def stream_slices(self) -> Iterable[StreamSlice]:
|
17
|
+
parent_streams = {stream.stream.name: stream.stream for stream in self.parent_stream_configs}
|
18
|
+
groups_list = self.config.get("groups_list")
|
19
|
+
selected_parent = parent_streams["include_descendant_groups"] if groups_list else parent_streams["groups_list"]
|
20
|
+
|
21
|
+
for stream_slice in selected_parent.stream_slices(sync_mode=SyncMode.full_refresh):
|
22
|
+
for record in selected_parent.read_records(sync_mode=SyncMode.full_refresh, stream_slice=stream_slice):
|
23
|
+
yield StreamSlice(partition={"id": record["id"]}, cursor_slice={})
|
24
|
+
|
25
|
+
|
26
|
+
@dataclass
|
27
|
+
class ProjectStreamsPartitionRouter(SubstreamPartitionRouter):
|
28
|
+
def stream_slices(self) -> Iterable[StreamSlice]:
|
29
|
+
parent_stream = self.parent_stream_configs[0].stream
|
30
|
+
projects_list = self.config.get("projects_list", [])
|
31
|
+
|
32
|
+
group_project_ids = []
|
33
|
+
for stream_slice in parent_stream.stream_slices(sync_mode=SyncMode.full_refresh):
|
34
|
+
for record in parent_stream.read_records(sync_mode=SyncMode.full_refresh, stream_slice=stream_slice):
|
35
|
+
group_project_ids.extend([i["path_with_namespace"] for i in record["projects"]])
|
36
|
+
|
37
|
+
if group_project_ids:
|
38
|
+
for project_id in group_project_ids:
|
39
|
+
if not projects_list or projects_list and project_id in projects_list:
|
40
|
+
yield StreamSlice(partition={"id": project_id.replace("/", "%2F")}, cursor_slice={})
|
41
|
+
else:
|
42
|
+
for project_id in projects_list:
|
43
|
+
yield StreamSlice(partition={"id": project_id.replace("/", "%2F")}, cursor_slice={})
|