forge: paginate list and resolver commands #205
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!205
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/forge-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?
forgelist and lookup commands now page through the whole result set instead of trusting one request. The server caps a page at 50 rows whatever limit is asked for, which is whyforge issue list -L 500returned exactly 50 issues and silently dropped the rest, and why a label, milestone, or branch past the first page could not be resolved.-L/--limitonissue listandlabel listmeans what it says now, with the same defaults, and commands without a limit fetch everything. Output shape is unchanged. The proof is fixture tests with two-page servers; rollback is a revert of two commits, and nothing is written anywhere.What changes
fetchPagesincmd/forge/paging.go, requestslimit=<size>&page=<n>from page 1 with size 50, or the caller's limit when smaller, and stops on a page shorter than the size, when the limit is reached, or on an empty page. A server that answers every page with the same rows is refused withserver repeated page N; refusing to looprather than looping without bound.pr list,pr find-by-head, branch-name targets forpr close,issue list,label list, label and milestone resolution,milestone list. Resolvers keep their exact-match and refuse-duplicates behavior and simply see every page.-L 010is accepted exactly as before and now means the decimal 10 the server always read it as; only the acceptance rule was ever octal.limit/pageparameters;issue list's limit now follows its filter parameters. Exact-path tests were updated for that and for the resolvers moving fromlimit=100to paged requests of 50.Risk
R2. Behavior change on every list and resolver path, but read-only: the worst credible failure is a request sequence that stops early on a server whose page cap is below 50, which would reproduce today's behavior rather than worsen it. Rollback is a revert.
Validation
gofmt -l .empty;go vetandgo test ./...green untagged and withsite,secret, andsite,secret, run by the overseer in the branch worktree after the final commit.pr find-by-headand apr closebranch target resolved from page 2; a missing label, milestone, and head still missing after both pages, with the request sequence asserted;issue list -L 3sends one request and prints 3 rows,-L 60prints 60 rows over two pages, the default sends onelimit=30request,-L 010prints 10 rows;pr listover two pages prints every row and a short first page sends one request; a server that repeats a full page is refused.Closes allod/tools#89
76022f3f5dtob1495c1852