Skip to content

Commit 2cdefe0

Browse files
author
Alex Zirka
committed
Added support for pipeline bridges
1 parent 40ec2f5 commit 2cdefe0

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

docs/gl_objects/pipelines_and_jobs.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,27 @@ Play (trigger) a job::
302302
Erase a job (artifacts and trace)::
303303

304304
build_or_job.erase()
305+
306+
307+
List pipeline bridges
308+
=====================
309+
310+
Get a list of bridge jobs (child pipelines) for a pipeline.
311+
312+
Reference
313+
---------
314+
315+
* v4 API
316+
317+
+ :class:`gitlab.v4.objects.ProjectBridge`
318+
+ :class:`gitlab.v4.objects.ProjectBridgeManager`
319+
+ :attr:`gitlab.v4.objects.Project.bridges`
320+
321+
* GitLab API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-bridges
322+
323+
Examples
324+
--------
325+
326+
List bridges for the pipeline::
327+
328+
bridges = pipeline.bridges.list()

gitlab/v4/objects/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,6 +3770,8 @@ def blame(self, file_path, ref, **kwargs):
37703770
class ProjectPipelineJob(RESTObject):
37713771
pass
37723772

3773+
class ProjectPipelineBridge(RESTObject):
3774+
pass
37733775

37743776
class ProjectPipelineJobManager(ListMixin, RESTManager):
37753777
_path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs"
@@ -3778,6 +3780,12 @@ class ProjectPipelineJobManager(ListMixin, RESTManager):
37783780
_list_filters = ("scope",)
37793781

37803782

3783+
class ProjectPipelineBridgeManager(ListMixin, RESTManager):
3784+
_path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/bridges"
3785+
_obj_cls = ProjectPipelineBridge
3786+
_from_parent_attrs = {"project_id": "project_id", "pipeline_id": "id"}
3787+
_list_filters = ("scope",)
3788+
37813789
class ProjectPipelineVariable(RESTObject):
37823790
_id_attr = "key"
37833791

@@ -3791,6 +3799,7 @@ class ProjectPipelineVariableManager(ListMixin, RESTManager):
37913799
class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):
37923800
_managers = (
37933801
("jobs", "ProjectPipelineJobManager"),
3802+
("bridges", "ProjectPipelineBridgeManager"),
37943803
("variables", "ProjectPipelineVariableManager"),
37953804
)
37963805

0 commit comments

Comments
 (0)