The way how we handle pagination is not optimal, partially broken, and sometimes even inconsistent with the current (v3.4.1) Gerrit REST API docs.
Not optimal
Parameters are defined as strings in some Options.
It should be an integer.
Partially broken
In some calls, you can set a Skip and Start parameters.
On Gerrit Server Side this is causing a (we assume) undefined behavior.
However, the call with both parameters s and start set will not succeed.
Inconsistent with the current (v3.4.1) Gerrit REST API docs
In the Gerrit docs, the setting is sometimes named Start. Sometimes Skip.
On go-gerrit side, we use kinda both and something the other version per call.
This Pull Request is ...
Fixing and unifying the Start/Skip behavior
Being consistent with the Gerrit REST API docs
Adding examples on how to use the functionality
Breaking change
This PR is introducing a breaking change.
I believe it is worth doing it, because
We aim to provide a Migration path
Pagination is a common and important functionality, especially on bigger instances
The breaking change doesn't require a huge amount of modification
The way how we handle pagination is not optimal, partially broken, and sometimes even inconsistent with the current (v3.4.1) Gerrit REST API docs.
Not optimal Parameters are defined as strings in some Options. It should be an integer.
Partially broken In some calls, you can set a
Skip
andStart
parameters. On Gerrit Server Side this is causing a (we assume) undefined behavior. However, the call with both parameterss
andstart
set will not succeed.Inconsistent with the current (v3.4.1) Gerrit REST API docs In the Gerrit docs, the setting is sometimes named Start. Sometimes Skip. On go-gerrit side, we use kinda both and something the other version per call.
This Pull Request is ...
Breaking change
This PR is introducing a breaking change. I believe it is worth doing it, because
Special notice
This PR is a follow-up from the work of @michaeldorner in https://github.com/andygrunwald/go-gerrit/pull/48.
After the merge
I aim to create a new library release including a migration guide for people who are adopting this library.