Add manager for jobs within a pipeline. - #413
Conversation
gpocentek
left a comment
There was a problem hiding this comment.
Thanks for this change! Could you have a look at my comments and make the suggested modifications before I merge?
If could could add a couple examples (list and get) in the documentation that would be very nice.
Thanks again 👍
| return CreateMixin.create(self, data, path=path, **kwargs) | ||
|
|
||
|
|
||
| class ProjectPipelineJobManager(RetrieveMixin, RESTManager): |
There was a problem hiding this comment.
Could you use GetWithoutIdMixin instead of RetrieveMixin?
It looks like getting a single job is not possible with the GitLab API, but we can simulate this feature by looping through the list.
|
|
||
| class ProjectPipelineJobManager(RetrieveMixin, RESTManager): | ||
| _path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs' | ||
| _obj_cls = ProjectJob |
There was a problem hiding this comment.
I'd rather use a new ProjectPipelineJob instead of ProjectJob. This is choice I made for other objects and managers, so I'd rather stick to this logic.
Review markup: better to use a distinct ProjectPipelineJob rather than sharing ProjectJob. This is consistent with the other objects and managers.
|
Thanks @gpocentek - I've added some docs, distinguished the classes as you requested (I just made an In principle we could implement Thanks. |
|
Not sure why the Python 2.7 build failed, but it looks like a connection error pulling one of the libraries, not related to my change :-( Edit: it seems to have passed now. |
|
@kw217 Thanks! |
|
Great, thank you! |
|
Hi @gpocentek - when are you likely to spin a new release containing this enhancement? I'd like to use it in a tool I'm writing, and it will be simpler to point people at PyPI than getting them to download master. Thanks. |
|
Super - that would be great. Thanks! |
This PR adds a manager for jobs within a pipeline, so you can say
gl.projects.get(prid).pipelines.get(plid).jobs.list()to list all of the jobs within a single pipeline (in GitLab v4).Please let me know if there are any tests I should add. The existing UTs still pass.