From 3c742145d7c983311be76bc460b25894c6fb890a Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 11:42:27 +0100 Subject: [PATCH] View: the pipelines page takes a limit, the newest 20 by default The design gives list a limit with a default of 20; the view asked 20 always and neither the web page nor the terminal view could ask another. The web list takes a limit query parameter and the terminal view a -limit flag; a followed branch's list is read at the default, any other limit is read at the asking. Issue 1983, review round 1 finding 2. Builds: design 47 H2 H-A-467 (1) --- .../cmd/mesh-delivery-cli/main.go | 15 +++++--- .../cmd/mesh-delivery-cli/main_test.go | 19 ++++++++-- .../mesh-delivery-view/integration_test.go | 2 +- .../internal/view/pipelines.go | 38 ++++++++++++------- .../internal/view/pipelines_test.go | 29 ++++++++++---- .../internal/view/pipelinespage.go | 15 ++++++-- .../mesh-delivery-view/internal/view/serve.go | 12 +++--- 7 files changed, 91 insertions(+), 39 deletions(-) diff --git a/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go b/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go index 74959b66a..51404efa5 100644 --- a/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go +++ b/modules/mesh-delivery-view/cmd/mesh-delivery-cli/main.go @@ -37,11 +37,16 @@ func run(args []string, socket string, out, errOut io.Writer) int { asJSON := fs.Bool("json", false, "print the rows as JSON") follow := fs.Bool("follow", false, "pipelines and pipeline: print again at each change the runner's events say, until interrupted") next := fs.String("next", "", "pipeline: the cursor of the next page a pipeline's answer named") + limit := fs.Int("limit", view.DefaultPipelinesLimit, "pipelines: the newest this many pipelines of the branch") if err := fs.Parse(args); err != nil { return 2 } if fs.NArg() > 0 && (fs.Arg(0) == "pipelines" || fs.Arg(0) == "pipeline") { - return pipelines(socket, fs.Args(), *next, *follow, *asJSON, out, errOut) + if *limit < 1 { + fmt.Fprintln(errOut, "mesh-delivery-cli: -limit is a number of at least one") + return 2 + } + return pipelines(socket, fs.Args(), *next, *limit, *follow, *asJSON, out, errOut) } if fs.NArg() > 0 && fs.Arg(0) == "holds" { return holds(socket, *asJSON, out, errOut) @@ -62,7 +67,7 @@ func run(args []string, socket string, out, errOut io.Writer) int { } if fs.NArg() > 0 { if fs.Arg(0) != "answer" || fs.NArg() < 3 { - fmt.Fprintln(errOut, "mesh-delivery-cli shows the rows, or answers: mesh-delivery-cli answer