airbyte-source-gitlab 3.0.0.dev202403072311__tar.gz → 4.0.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/PKG-INFO +3 -3
  2. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/README.md +1 -1
  3. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/pyproject.toml +2 -2
  4. airbyte_source_gitlab-4.0.1/source_gitlab/components/partition_routers.py +43 -0
  5. airbyte_source_gitlab-4.0.1/source_gitlab/manifest.yaml +613 -0
  6. airbyte_source_gitlab-4.0.1/source_gitlab/source.py +30 -0
  7. airbyte_source_gitlab-3.0.0.dev202403072311/source_gitlab/source.py +0 -245
  8. airbyte_source_gitlab-3.0.0.dev202403072311/source_gitlab/streams.py +0 -431
  9. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/__init__.py +0 -0
  10. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/config_migrations.py +0 -0
  11. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/run.py +0 -0
  12. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/branches.json +0 -0
  13. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/commits.json +0 -0
  14. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/deployments.json +0 -0
  15. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/epic_issues.json +0 -0
  16. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/epics.json +0 -0
  17. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/group_issue_boards.json +0 -0
  18. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/group_labels.json +0 -0
  19. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/group_members.json +0 -0
  20. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/group_milestones.json +0 -0
  21. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/groups.json +0 -0
  22. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/issues.json +0 -0
  23. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/jobs.json +0 -0
  24. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/merge_request_commits.json +0 -0
  25. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/merge_requests.json +0 -0
  26. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/pipelines.json +0 -0
  27. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/pipelines_extended.json +0 -0
  28. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/project_labels.json +0 -0
  29. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/project_members.json +0 -0
  30. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/project_milestones.json +0 -0
  31. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/projects.json +0 -0
  32. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/releases.json +0 -0
  33. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/tags.json +0 -0
  34. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/schemas/users.json +0 -0
  35. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/source_gitlab/spec.json +0 -0
  36. {airbyte_source_gitlab-3.0.0.dev202403072311 → airbyte_source_gitlab-4.0.1}/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.0.0.dev202403072311
3
+ Version: 4.0.1
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 (==0.58.8)
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 sample_files/configured_catalog.json
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 sample_files/configured_catalog.json
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 = "3.0.0.dev202403072311"
8
+ version = "4.0.1"
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 = "==0.58.8"
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={})