andygrunwald / go-gerrit

Go client/library for Gerrit Code Review
https://godoc.org/github.com/andygrunwald/go-gerrit
MIT License
96 stars 40 forks source link

Only 500 changes are being pulled #68

Closed udaycoder closed 3 years ago

udaycoder commented 5 years ago

Hi,

I am trying to pull change info from gerrit server. But I see only 500 max changes are coming. Can you please help in how I can pull more than 500 changes at one time. Is there any specific attribute i need to mention in client or querychangeoptions?

udaycoder commented 5 years ago

I would like to update that I tried with the .skip and .start parameters for querychangeoptions and even that gives 400 Bad Requestpanic

andygrunwald commented 5 years ago

hey @udaycoder,

can you post the code you are using here? This would help us to reproduce this issue. Next, is the Gerrit instance you are connecting to, publicly available? Or is it hosted in a private environment?

And which version of Gerrit you are using? Which plugins are installed?

udaycoder commented 5 years ago

Sorry the gerrit instance that I am connecting to wouldn't be publicly available. The code snippet after successfull authentication is ->

 opt := &gerrit.QueryChangeOptions{}
 opt.Limit = 2000
 opt.Skip = 500
 opt.Query = []string{"status:merged"}
 changes, _, err = client.Changes.QueryChanges(opt)

if I don't use opt.Skip or opt.Start everything works fine, and I do know there are more changes as the more changes flag is set to true and also from UI gerrit. The version of gerrit REST is 3.0.1.

udaycoder commented 5 years ago

Update -> Was able to use the skip parameter properly in python, so I guess this is not a server side limitation.

andygrunwald commented 5 years ago

@udaycoder Thanks for the feedback. Right now I have limited time to re-check this issue. Sorry for this.

Would you mind to post the python code here, that we or the community can reproduce this issue and see how this can be solved in Python?

udaycoder commented 5 years ago

I used the python library-> https://github.com/dpursehouse/pygerrit2

andygrunwald commented 5 years ago

Thank you. As I wrote, right now I don't have time to look deeper into this. I keep this issue open and will tackle it in the future when I find the right time.

@Community: If you read this, feel free to tackle the issue. If I can support, write down here and I try to do my best!

andygrunwald commented 3 years ago

Hey @udaycoder, I had a look into it and prepared a fix in https://github.com/andygrunwald/go-gerrit/pull/98

I will wait for feedback on this and merge it soon. Maybe you wanna give this PR a try.

Thanks for reporting. I will close this and we move the discussion to https://github.com/andygrunwald/go-gerrit/pull/98