Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1af0a0

Browse filesBrowse files
author
Gauvain Pocentek
committed
ProjectPipelineJob objects can only be listed
And they are not directly related to ProjectJob objects. Fixes python-gitlab#531
1 parent ebf822c commit e1af0a0
Copy full SHA for e1af0a0

File tree

Expand file treeCollapse file tree

2 files changed

+15
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-9
lines changed
Open diff view settings
Collapse file

‎docs/gl_objects/builds.rst‎

Copy file name to clipboardExpand all lines: docs/gl_objects/builds.rst
+14-8Lines changed: 14 additions & 8 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,25 @@ List jobs for the project::
238238

239239
jobs = project.jobs.list()
240240

241-
To list builds for a specific pipeline or get a single job within a specific
242-
pipeline, create a
243-
:class:`~gitlab.v4.objects.ProjectPipeline` object and use its
244-
:attr:`~gitlab.v4.objects.ProjectPipeline.jobs` method::
241+
Get a single job::
242+
243+
project.jobs.get(job_id)
244+
245+
List the jobs of a pipeline::
245246

246247
project = gl.projects.get(project_id)
247248
pipeline = project.pipelines.get(pipeline_id)
248-
jobs = pipeline.jobs.list() # gets all jobs in pipeline
249-
job = pipeline.jobs.get(job_id) # gets one job from pipeline
249+
jobs = pipeline.jobs.list()
250250

251-
Get a job::
251+
.. note::
252252

253-
project.jobs.get(job_id)
253+
Job methods (play, cancel, and so on) are not available on
254+
``ProjectPipelineJob`` objects. To use these methods create a ``ProjectJob``
255+
object::
256+
257+
pipeline_job = pipeline.jobs.list()[0]
258+
job = project.jobs.get(pipeline_job.id, lazy=True)
259+
job.retry()
254260

255261
Get the artifacts of a job::
256262

Collapse file

‎gitlab/v4/objects.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ def raw(self, file_path, ref, streamed=False, action=None, chunk_size=1024,
24152415
return utils.response_content(result, streamed, action, chunk_size)
24162416

24172417

2418-
class ProjectPipelineJob(ProjectJob):
2418+
class ProjectPipelineJob(RESTManager):
24192419
pass
24202420

24212421

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.