Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(cli): drop "Showing N comments." stderr preamble on issue comment list (#3341)
Bohan Jiang668fe99cceb5
diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.goindex c0b8b43451..f49c7ddf1a 100644--- a/server/cmd/multica/cmd_issue.go+++ b/server/cmd/multica/cmd_issue.go@@ -1002,7 +1002,6 @@ func runIssueCommentList(cmd *cobra.Command, args []string) error {if err != nil {return fmt.Errorf("list comments: %w", err)}- fmt.Fprintf(os.Stderr, "Showing %d comments.\n", len(comments))// The server emits the next-page cursor in headers when there is likely// an older page. Surface it on stderr so an operator (and the agent// prompt update that follows this PR) can scroll deeper without havingdiff --git a/server/cmd/multica/cmd_issue_test.go b/server/cmd/multica/cmd_issue_test.goindex 2b38568916..e02cca3aee 100644--- a/server/cmd/multica/cmd_issue_test.go+++ b/server/cmd/multica/cmd_issue_test.go@@ -1780,6 +1780,44 @@ func TestRunIssueCommentList_RecentStillLabelsCursorAsThread(t *testing.T) {}}+// TestRunIssueCommentList_DoesNotPrintShowingPreamble locks in the removal of+// the "Showing N comments." stderr preamble. The line was the only+// `list --output json` subcommand that emitted a human-readable count, which+// polluted stdout/stderr-merged consumers (agent harnesses, CI `2>&1`).+// Tracks GitHub issue #3303.+func TestRunIssueCommentList_DoesNotPrintShowingPreamble(t *testing.T) {+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.Method == http.MethodGet && strings.HasPrefix(r.URL.Path, "/api/issues/") && !strings.Contains(r.URL.Path, "/comments") {+ json.NewEncoder(w).Encode(map[string]any{+ "id": "issue-1",+ "identifier": "MUL-1",+ })+ return+ }+ w.Write([]byte(`[{"id":"c1"},{"id":"c2"}]`))+ }))+ defer srv.Close()++ t.Setenv("MULTICA_SERVER_URL", srv.URL)+ t.Setenv("MULTICA_WORKSPACE_ID", "ws-1")+ t.Setenv("MULTICA_TOKEN", "test-token")++ stderr := captureStderr(t)+ defer stderr.restore()++ cmd := newIssueCommentListTestCmd()+ if err := cmd.Flags().Set("output", "json"); err != nil {+ t.Fatalf("set output: %v", err)+ }+ if err := runIssueCommentList(cmd, []string{"MUL-1"}); err != nil {+ t.Fatalf("runIssueCommentList: %v", err)+ }++ if got := stderr.read(); strings.Contains(got, "Showing") {+ t.Errorf("stderr must not contain a 'Showing ...' preamble, got: %q", got)+ }+}+func TestValidIssueStatuses(t *testing.T) {expected := map[string]bool{"backlog": true,