Skip to content

fix(cli): keep filters in the next page command - #508

Open
pcbeingused33 wants to merge 2 commits into
hookdeck:mainfrom
pcbeingused33:fix/pagination-hint-keeps-flags
Open

pcbeingused33 wants to merge 2 commits into
hookdeck:mainfrom
pcbeingused33:fix/pagination-hint-keeps-flags

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

The command printed under "To get the next page:" is a fixed string per resource, so it drops everything the user passed. For example:

$ hookdeck gateway attempt list --event-id evt_123
...
To get the next page:
  hookdeck gateway attempt list --next <cursor>

Running the suggestion fails with --event-id is required. On other list commands it runs but silently returns an unfiltered (or differently sorted) next page, and transformation executions list loses its transformation argument.

printPaginationInfo now rebuilds the line from the command that was run: command path, positional arguments and the flags that were set, with --prev/--next replaced by the new cursor. Values that need it are single-quoted for a POSIX shell. Of the global flags only --profile and --hookdeck-config are repeated, since they select the account; the rest are left out so that --api-key/--cli-key are never echoed.

source, destination and connection list do not accept --next on main yet; that is handled separately in #501.

Tests: pkg/cmd/pagination_output_test.go runs the list commands against a stub server and checks the suggested line; all six cases fail without the change. go vet ./pkg/cmd/ and go test ./pkg/cmd/ pass.

This change was prepared with AI assistance.

pcbeingused33 and others added 2 commits November 26, 2026 22:57
The command printed under "To get the next page" was a fixed string, so it dropped the flags and arguments of the command that produced the page. For attempt list that left out the required --event-id.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pcbeingused33

Copy link
Copy Markdown
Contributor Author

Added a test that runs the suggested command and checks that it requests the next page with the same filters. For source, destination and connection list the suggested line also needs #501, which adds --next there; the two branches merge cleanly. The quoting targets POSIX shells, so on cmd.exe quoted values may need adjusting.

This comment was drafted with Claude Code.

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