Skip to content

Make "Walker" pagination configurable #129

@aik099

Description

@aik099

The Walker class provides the way to iterate over large issue count without consuming too much memory in the process. It does so by using so called paginated query concept, where:

  1. an Api::search call is made to get first 50 issues
  2. when user have iterated over these issues, then an Api::search call is made to get next 50 issues
  3. above steps are repeated until no more issues is found

This is perfectly fine from user point of view, but a nightmare from tester point of view (mine), because to test this we need to generate at least 100 fake issue responses to see if paginated query works as expected.

To make things more testable I'm proposing to add optional $per_page parameter to Walker class constructor (this is constructor parameter and not a setter method to avoid mess with changing per page in the middle of issue iteration), that:

  • will be null by default
  • when specified the value is used
  • when not specified the default 50 is used

I can't imagine any another reasons for making per page configurable except for testing though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions