Skip to content

feat(service-catalog): add --page-size and --page-number to list - #773

Open
eliebleton-manomano wants to merge 1 commit into
DataDog:mainfrom
eliebleton-manomano:feat/service-catalog-list-pagination
Open

feat(service-catalog): add --page-size and --page-number to list#773
eliebleton-manomano wants to merge 1 commit into
DataDog:mainfrom
eliebleton-manomano:feat/service-catalog-list-pagination

Conversation

@eliebleton-manomano

Copy link
Copy Markdown

Summary

service-catalog list was the one list command with no pagination controls — the underlying ListServiceDefinitionsOptionalParams (datadog-api-client-rust) already supports page_size/page_number, they just weren't wired up. This adds them, following the same per-command pattern used in #449 (users list) and #663 (security rules list).

Changes

  • src/main.rsServiceCatalogActions::List gains --page-size (default 10) and --page-number (default 0)
  • src/commands/service_catalog.rslist() now takes page_size/page_number and passes them to ListServiceDefinitionsOptionalParams

Testing

  • cargo test service_catalog — 3/3 pass (existing test updated with default args, new test covers non-default page size/number)
  • cargo clippy -- -D warnings — clean
  • cargo fmt --check — clean

A note on pagination architecture, for what it's worth

While digging into this we found origin/janis.kirsteins/pagination, an unmerged branch (4607e03 + 2561c7b, 2026-03-31) implementing pagination as a unified mechanism — a shared PaginationInfo/extract_pagination() in formatter.rs normalizing cursor/offset/page-number styles across ~22 commands in one pass, with docs/PAGINATION.md documenting the result. It has no PR history (never opened, best we can tell), and is now 1000+ commits stale.

In the roughly five months since, pagination has instead landed via five separate PRs (#449, #458, #663, #732, #761), each adding flags to one command at a time — this PR continues that pattern rather than reviving the unified branch, since that seemed like the pragmatic call at this point.

Just flagging it in case it's useful signal: the unified approach looks like the right shape for this problem in general (one envelope format instead of five-plus bespoke wire-ups, agent-mode pagination metadata for free), and if there's appetite to revisit it, doing so sooner rather than after more piecemeal PRs land would mean less to reconcile. No opinion asserted on priority — just surfacing what we found.


🤖 Generated with Claude Code

Wires the existing page_size/page_number optional params on
ListServiceDefinitionsOptionalParams through to the CLI, matching the
pattern used for users list (DataDog#449) and security rules list (DataDog#663).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@eliebleton-manomano
eliebleton-manomano requested a review from a team as a code owner August 28, 2026 11:18
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