Skip to content

Comments

fix: display pagination cursors in all list commands#218

Merged
leggetter merged 6 commits intomainfrom
fix/pagination-cursor-display
Feb 24, 2026
Merged

fix: display pagination cursors in all list commands#218
leggetter merged 6 commits intomainfrom
fix/pagination-cursor-display

Conversation

@leggetter
Copy link
Collaborator

Summary

Fixes #216

Previously, pagination cursors (next/prev) were not displayed to users in CLI output, even though they were available in the API responses. This made it impossible to paginate through large result sets (limit of 255 items).

This PR adds pagination cursor display to all list commands in both text and JSON output formats.

Changes

New Helper Functions (pkg/cmd/pagination_output.go)

  • printPaginationInfo() - displays pagination cursors in text output
  • marshalListResponseWithPagination() - includes pagination metadata in JSON output

Updated Commands

Applied pagination display to all 8 list commands:

  • event list
  • request list
  • attempt list
  • transformation list
  • transformation executions
  • connection list
  • source list
  • destination list

JSON Output Changes

  • Before: Empty results returned []
  • After: All responses return {"models": [...], "pagination": {...}}
  • Pagination metadata always included (limit, order_by, dir, next, prev)

Text Output Changes

When pagination cursors exist, displays:

Pagination:
  Next: WzE3NDA2NTU4MTE2OTMsImV2dF...
  
To get the next page:
  hookdeck gateway event list --next WzE3NDA2NTU4MTE2OTMsImV2dF...

Test Updates

  • Updated helper functions to handle new JSON response format
  • Added comprehensive pagination workflow tests:
    • TestEventListPaginationWorkflow
    • TestRequestListPaginationWorkflow
    • TestAttemptListPaginationWorkflow
  • Updated TestEventListJSON to verify pagination metadata

Test Plan

  • All pagination acceptance tests pass
  • Build succeeds with no errors
  • Tests verify:
    • JSON includes pagination metadata
    • Text output shows pagination info
    • Next/prev cursors work correctly
    • Multiple pages contain different items

Previously, pagination cursors (next/prev) were not displayed to users
in CLI output, even though they were available in the API responses.
This made it impossible to paginate through large result sets.

Changes:
- Created pkg/cmd/pagination_output.go with helper functions:
  - printPaginationInfo() for text output
  - marshalListResponseWithPagination() for JSON output
- Updated all 8 list commands to display pagination info:
  - event list
  - request list
  - attempt list
  - transformation list
  - transformation executions
  - connection list
  - source list
  - destination list
- Fixed JSON output to always include pagination metadata
  (previously returned [] for empty results)
- Updated test helper functions to handle new JSON response format
- Added comprehensive pagination acceptance tests for:
  - event list (TestEventListPaginationWorkflow)
  - request list (TestRequestListPaginationWorkflow)
  - attempt list (TestAttemptListPaginationWorkflow)
- Updated TestEventListJSON to verify pagination metadata

Fixes #216
…de/worktrees/

- Update TestRootConnectionAliasWorks to use ConnectionListResponse struct
- Add .gitignore entry for .claude/worktrees/ temporary directories

🤖 Generated with [Claude Code](https://claude.com/claude-code)
With 203 acceptance tests, the suite needs more than 10 minutes to complete.
Increasing timeout to 20m to prevent premature failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Test was expecting old array format [] but transformation list now
returns the new pagination response format with models and pagination.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@leggetter leggetter merged commit e22ecda into main Feb 24, 2026
7 checks passed
@leggetter leggetter deleted the fix/pagination-cursor-display branch February 24, 2026 17:40
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.

Pagination cursors not displayed in list commands

1 participant