Skip to content

ProjectPipelineJob seems to be broken in 1.5.0 #537

Closed

Description

@rokroskar

Description of the problem, including code/CLI snippet

pipeline = proj.pipelines.list()[0]
for job in pipeline.jobs.list(): print(job.attributes)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-32-527712123652> in <module>()
----> 1 for job in pipeline.jobs.list(): print(job.attributes)

AttributeError: 'ProjectPipelineJob' object has no attribute 'attributes'

Expected Behavior

To get the attributes of the pipeline job. This is the behavior in 1.4.0.

Actual Behavior

--> AttributeError
In fact, none of the expected class instance members are there.

Specifications

  • python-gitlab version: 1.5.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 10.8.3 (564c342)

Activity

  1. gpocentek commented on Jun 23, 2018

    @gpocentek
    Contributor

    Hi @rokroskar

    Thanks for reporting this problem. I'll push a 1.5.1 very soon with the fix.

  2. rokroskar commented on Jun 24, 2018

    @rokroskar
    Author

    thanks for the quick fix @gpocentek!

  3. donbowman commented on Aug 8, 2018

    @donbowman

    I'm still seeing this w/ python-gitlab (1.5.1) (from pypi). I double-checked, I have the change referenced in 4cf8118

    Maybe related... Its a group project:
    (Pdb) p project

    (Pdb) p project.pipelines
    *** AttributeError: pipelines

      File "/usr/local/lib/python3.6/dist-packages/gitlab/base.py", line 56, in __getattr__
        return self.__dict__['_updated_attrs'][name]
    KeyError: 'pipelines'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/gitlab/base.py", line 59, in __getattr__
        value = self.__dict__['_attrs'][name]
    KeyError: 'pipelines'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/dist-packages/gitlab/base.py", line 79, in __getattr__
        return self.__dict__['_parent_attrs'][name]
    KeyError: 'pipelines'
    
  4. donbowman commented on Aug 8, 2018

    @donbowman

    Confirmed. As a workaround, get the 'Project' from the 'GroupProject.id'

        projects = group.projects.list()
        for project in projects:
            proj = gl.projects.get(project.id)
            pipelines = proj.pipelines.list()
    
  5. locked as resolved and limited conversation to collaborators on Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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