Skip to content
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

Can't get all builds for a commit #233

Closed
rasup opened this issue Mar 14, 2017 · 3 comments
Closed

Can't get all builds for a commit #233

rasup opened this issue Mar 14, 2017 · 3 comments

Comments

@rasup
Copy link

rasup commented Mar 14, 2017

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)
@gpocentek
Copy link
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.

@rasup
Copy link
Author

rasup commented Mar 17, 2017

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

@gpocentek
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants