feat(list): auto-paginate by default #34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/list-auto-paginate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the user-visible symptom that prompted this PR:
yt list --assignee mereturning a short table (or appearing empty) on an instance that has more issues than YouTrack's default page size (~42), with no warning or error.Why
The default
fetch_issuespath sent oneGET /api/issues?query=...request with no$top. YouTrack applies its server-side default page size (around 42) and silently drops the rest of the matches. From the user's seat that looks identical to a working query returning zero hits.What changes
--top/--skip, the CLI loopsfetch_issues_pagewith$top=100and rising$skipuntil a short page comes back.--topand--skipstill opt in to single-page mode (useful for cursoring or capping huge result sets).--allis preserved as a hidden no-op alias so existing scripts keep working.tracing::info!(skip / page_size / page_len) plus a final total.yt -v listmakes pagination visible when debugging "I expected more results than appeared."Separate fix in the same path
fetch_issues_pagepreviously dropped sprint sub-fetch errors withif let Ok(...)and emitted nothing. Now matches the existingfetch_issuespattern:tracing::warn!with the issue id and error message, so a 401/403/timeout on/api/issues/<id>/sprintsshows up under-vinstead of disappearing. The sprint column stays empty when a sub-fetch fails (unchanged).Test plan
cargo fmt --allcargo clippy --all-targets --all-features -- --deny warningscargo test --all-targets(204 passed; was 202)list_paginates_by_default: 100-item full page plus a 1-item tail, asserts both pages are fetched (mocks$skip=0and$skip=100separately)list_with_top_disables_auto_pagination:--top 5triggers a single requestyt list --assignee menow returns every issue rather than a truncated tableyt -v list --assignee meprints page boundaries and a final total