Skip to content

Provide ProjectJob methods on ProjectPipelineJob? #3324

@lheckemann

Description

@lheckemann

Description of the problem, including code/CLI snippet

Currently, getting the trace from a job obtained through a pipeline requires an extra request. This works, but I don't see any reason for ProjectPipelineJob not to have the trace() method as well, since all it requires is the job's ID.

The same goes for all the other methods on ProjectJob.

Code for current API

import gitlab

g = gitlab.Gitlab("https://gitlab.example.com/")
project = g.projects.get("example/example")
pipeline = project.pipelines.latest()
jobs = pipeline.jobs.list(iterator=True)
job = project.jobs.get(next(jobs).id)
trace = job.trace()

Code for desired API

import gitlab

g = gitlab.Gitlab("https://gitlab.example.com/")
project = g.projects.get("example/example")
pipeline = project.pipelines.latest()
jobs = pipeline.jobs.list(iterator=True)
trace = next(jobs).trace()

Specifications

  • python-gitlab version: 7.1.0
  • Gitlab server version (or gitlab.com): gitlab.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions