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.

Uses the published @sentry/api@0.425.0 through #1659. Validation on this head: 45 schema/history tests and 72 CLI/SDK E2E tests passed against a fresh bundle. The migration files pass formatting and lint checks. 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; CI validates the updated stack.

@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 29, 2026 4:37pm UTC

Request Review

@betegon
betegon force-pushed the bt/api-pagination-resume branch from 082354f to 6f2f6e0 Compare October 29, 2026 16:37

This branch was previously deployed

1 inactive deployment
Preview — 6f2f6e03 Deployed Oct 29, 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