Skip to content

add "list pipeline jobs" handler - #378

Closed
akaWolf wants to merge 1 commit into
python-gitlab:masterfrom
akaWolf:add_pipeline_jobs_list
Closed

add "list pipeline jobs" handler#378
akaWolf wants to merge 1 commit into
python-gitlab:masterfrom
akaWolf:add_pipeline_jobs_list

Conversation

@akaWolf

@akaWolf akaWolf commented Nov 17, 2017

Copy link
Copy Markdown

as described here:
https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-jobs

example:
jobs = pipeline.jobs.list()

@akaWolf
akaWolf force-pushed the add_pipeline_jobs_list branch from c4b595b to 2848455 Compare November 17, 2017 15:43

@gpocentek gpocentek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnk you for this MR!

Could you have a look at the comments?

Comment thread gitlab/v4/objects.py
return CreateMixin.create(self, data, path=path, **kwargs)


class PipelineJobManager(ListMixin, RESTManager):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you can list and get jobs, you should use a RetrieveMixin here.

Comment thread gitlab/v4/objects.py

class PipelineJobManager(ListMixin, RESTManager):
_path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs'
_obj_cls = ProjectJob

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this seems to be a good idea to use a ProjectJob, things get a bit more complicated than expected when using the CLI. To avoid bad surprises I try to stick to the upstream API logic: we are requesting a different URL so we get a different object class.

Could you create and use a PipelineJob object class instead?

@ahsobhi

ahsobhi commented Dec 13, 2017

Copy link
Copy Markdown

i was just going to create a pull request for such handler, and it is very useful as well. Thanks to @akaWolf and @gpocentek

@gpocentek

Copy link
Copy Markdown
Contributor

I'm closing this MR since there's been no update, and #413 implements the feature.

@gpocentek gpocentek closed this Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants