Skip to content

Add patrols limit param - #30

Merged
doneill merged 6 commits into
developfrom
task/jdo-50-patrols-pagination
Oct 10, 2026
Merged

doneill merged 6 commits into
developfrom
task/jdo-50-patrols-pagination

Conversation

@doneill

@doneill doneill commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Proposed Changes

  • ersvc
    • Add utility to ensure same host on pagenation requests
  • apipatrols
    • Added support for limit parameter
    • Support limit in page_size
  • patrols
    • Add -l and --limit params on patrols cli command

Expectation:

  • Running default `patrols command returns a max of 25 patrols from last 7 days
    • Command informs user if there is more data they can fetch
  • Using the -l or --limit parameter limits the response count
    • er patrols -l 100: returns up to 100 patrols
    • er patrols --limit 0: returns all patrols from default window, 7 days
    • er patrols -d 30 -l 0: returns all patrols in last 30 days, largest possible request
    • er patrols -s active -l 10: returns up to 10 active patrols
    • er patrols -l -5 returns error value must be 0 (al) or positive (got -5)

Tests Added:

=== RUN   TestPatrolsPagination
=== RUN   TestPatrolsPagination/follows_next_across_pages
=== RUN   TestPatrolsPagination/limit_stops_within_first_page
=== RUN   TestPatrolsPagination/default_limit_sends_page_size_25
=== RUN   TestPatrolsPagination/limit_above_max_page_size_is_capped
=== RUN   TestPatrolsPagination/refuses_next_url_to_another_host
--- PASS: TestPatrolsPagination (0.00s)

@doneill doneill self-assigned this Oct 10, 2026
@doneill
doneill merged commit b46401f into develop Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant