Skip to content

Can't get all builds for a commit #233

@rasup

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)

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