Skip to content

add "list pipeline jobs" handler #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

akaWolf
Copy link

@akaWolf akaWolf commented Nov 17, 2017

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
Copy link
Contributor

@gpocentek gpocentek left a comment

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?

@@ -1764,6 +1768,12 @@ def create(self, data, **kwargs):
return CreateMixin.create(self, data, path=path, **kwargs)


class PipelineJobManager(ListMixin, RESTManager):
Copy link
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.

@@ -1764,6 +1768,12 @@ def create(self, data, **kwargs):
return CreateMixin.create(self, data, path=path, **kwargs)


class PipelineJobManager(ListMixin, RESTManager):
_path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs'
_obj_cls = ProjectJob
Copy link
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
Copy link

ahsobhi commented Dec 13, 2017

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
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