Skip to content

Can't get all builds for a commit #233

Closed

Description

@rasup

I want to get all builds for a specific commit but using the following code results in an exception:

    gl = gitlab.Gitlab(url, ssl_verify=False, private_token=api_token)
    commit = gl.project_commits.get(sha, project_id)
    builds = commit.builds(all=True)

Exception:

    builds = commit.builds(all=True)
  File "C:\Users\rup\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gitlab\objects.py", line 1354, in builds
    **kwargs)
  File "C:\Users\rup\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gitlab\__init__.py", line 340, in _raw_list
    results.extend(self.list(cls, **args))
  File "C:\Users\rup\AppData\Local\Programs\Python\Python35-32\lib\site-packages\gitlab\__init__.py", line 391, in list
    ", ".join(missing))
gitlab.exceptions.GitlabListError: Missing attribute(s): project_id

Am I doing something wrong?

To get the job done I currently use the following workaround (The commit has less than 1000 builds):

    builds = commit.builds(page=1, per_page=1000)

Activity

  1. gpocentek commented on Mar 17, 2017

    @gpocentek
    Contributor

    Hello,

    I've not been able to reproduce this problem, but it reminds me of a fixed bug;

    Could you give me a bit more information about your setup: python version, operating system, and python-gitlab version?

    Thank you.

  2. rasup commented on Mar 17, 2017

    @rasup
    Author

    Hi,

    Sorry for not providing the info in my first message, but here it is :-):

    OS: Windows 7
    Python: 3.5.2
    python-gitlab: 0.19
    
  3. gpocentek commented on Mar 17, 2017

    @gpocentek
    Contributor

    I needed more builds, I can now reproduce the issue.

  4. locked as resolved and limited conversation to collaborators on Nov 15, 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