Story #5324
closedAs a Pulp3 user, I have Limit/Offset style pagination as my default
100%
Description
Currently the default is PageId pagination. This was discussed some on this mailing list thread: https://www.redhat.com/archives/pulp-dev/2019-August/msg00025.html
Design¶
In the settings.py switch the default to LimitOffsetPagination.
Details¶
1. Remove IDPagination
2. Update the DEFAULT_PAGINATION_CLASSdefault in settings.py to the LimitOffsetPagination example from the DRF docs
Updated by daviddavis over 5 years ago
A few questions. Should the pagination style be configurable? I'd say no for now (but we can address when a stakeholder needs it to be).
Should limit and offset be required and if not what should the default values be? For default values, of course 0 makes sense for offset.
For limit, I think we should go as small as possible because some resources might be quite large. Also, API users probably want smaller sizes while integrated apps (galaxy, katello, etc) prefer larger sizes. Since it's easier for machines to specify a limit, I think a smaller limit makes sense. I'd say 20 or 50.
Updated by bmbouter over 5 years ago
- Description updated (diff)
daviddavis wrote:
A few questions. Should the pagination style be configurable? I'd say no for now (but we can address when a stakeholder needs it to be).
It would be challenging for Pulp to prevent this configuration in the sense that DRF looks for its settings in the django file and we couldn't stop users from customizing it. We could manually override this on every model, or through the ancestor classes and then the default wouldn't apply, but I'm not in favor of that.
I see it as a good thing that users can configure this because it reinforces the idea that "Pulp is just plain DRF". I think we need to communicate to users that changing these would break the published bindings and they could rebuild them locally.
Should limit and offset be required and if not what should the default values be? For default values of course 0 makes sense for offset. For limit, I think we should go as small as possible because some resources might be quite large. Also, API users probably want smaller sizes while integrated apps (galaxy, katello, etc) prefer larger and since it's easier for machines to specify a limit. I think a smaller limit makes sense, I'd say 20 or 50.
I agree. At least one integrator wanted a default page size limit so I'm +1 on that. https://www.redhat.com/archives/pulp-dev/2019-August/msg00030.html
I think offset=0 by default so we can probably not specify that one. We currently have a page size of 100 here
Do we want to change the page size?
Updated by daviddavis over 5 years ago
Keeping the page size at 100 is fine with me.
Updated by daviddavis over 5 years ago
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
Updated by bmbouter over 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
With no objects raised on the mailing list, and the need to switch this soon, I'm taking as assigned.
Added by bmbouter over 5 years ago
Updated by bmbouter over 5 years ago
- Status changed from ASSIGNED to POST
PR available at: https://github.com/pulp/pulpcore/pull/275
Updated by bmbouter about 5 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|d34076e6f9ac47e0f4074f35fa1f746ae7fe6962.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Switch Pagination default to LimitOffset Style
The previous pagination was Page ID style and used a custom class from Pulp to do so. This switches the default pagination class to a limit offset style by default instead.
https://pulp.plan.io/issues/5324 closes #5324