Skip to content

feat(cli): resume api pagination without repeating arguments - #1691

Draft
betegon wants to merge 1 commit into
bt/api-pagination-cursorfrom
bt/api-pagination-resume
Draft

betegon wants to merge 1 commit into
bt/api-pagination-cursorfrom
bt/api-pagination-resume

Conversation

@betegon

@betegon betegon commented Oct 28, 2026

Copy link
Copy Markdown
Member

Continuing an API query currently requires copying its endpoint and every request argument. This adds sentry api --cursor next, prev, and first without an endpoint when there is one recent paginated query in the current working directory, configured host, and authenticated identity.

Stacked on #1659. Merge #1659 first, then retarget this PR to main.

Before

sentry api organizations/ -f per_page=2 --json
sentry api organizations/ -f per_page=2 --cursor next --json
sentry api organizations/ -f per_page=2 --cursor prev --json

After

sentry api organizations/ -f per_page=2 --json
sentry api --cursor next --json
sentry api --cursor prev --json

The saved request URL shares the existing cursor stack and five-minute expiry. It retains the original query parameters, including repeated parameters and the context needed for custom cursors. Presentation options apply to the current invocation.

If multiple paginated queries are saved, the command asks for an explicit endpoint and filters. Exhausted queries and requests requiring explicit headers or a body still count, so navigation cannot silently switch to another query. Header/body values are not saved; configured headers are re-read and checked against the original request. Detail requests without pagination do not replace a saved query. Dry-runs and failed requests do not advance it.

Validated with root pnpm run tsc, pnpm run lint, and pnpm run test, plus 72 CLI/SDK E2E tests against a fresh bundle. Flow coverage includes next/prev/first, repeated parameters, custom cursors, dry-run and error recovery, ambiguous/concurrent queries, and identity/host/directory/header isolation. Persistence tests cover migration, expiry, and logout cleanup. Review and cleanup completed.

@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 28, 2026 11:23am UTC

Request Review

This branch was previously deployed

1 inactive deployment
Preview — 082354f7 Deployed Oct 28, 2026 by vercel[bot]
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