From 463105d648a916b12e710fa03279610c6e97044c Mon Sep 17 00:00:00 2001 From: Uday R <82779467+uday-rana@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:33:08 -0500 Subject: [PATCH 1/3] fix: list branches in square brackets in gh run view (#10038) --- pkg/cmd/run/shared/shared.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/run/shared/shared.go b/pkg/cmd/run/shared/shared.go index 90ab5a7fe..51eb547bc 100644 --- a/pkg/cmd/run/shared/shared.go +++ b/pkg/cmd/run/shared/shared.go @@ -508,7 +508,7 @@ func SelectRun(p Prompter, cs *iostreams.ColorScheme, runs []Run) (string, error symbol, _ := Symbol(cs, run.Status, run.Conclusion) candidates = append(candidates, // TODO truncate commit message, long ones look terrible - fmt.Sprintf("%s %s, %s (%s) %s", symbol, run.Title(), run.WorkflowName(), run.HeadBranch, preciseAgo(now, run.StartedTime()))) + fmt.Sprintf("%s %s, %s [%s] %s", symbol, run.Title(), run.WorkflowName(), run.HeadBranch, preciseAgo(now, run.StartedTime()))) } selected, err := p.Select("Select a workflow run", "", candidates) From 8afb434e5910eb1cf25b3091b16bb41a6eea3075 Mon Sep 17 00:00:00 2001 From: Uday R <82779467+uday-rana@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:45:36 -0500 Subject: [PATCH 2/3] test(gh run): assert branch names are enclosed in square brackets --- pkg/cmd/run/cancel/cancel_test.go | 4 ++-- pkg/cmd/run/delete/delete_test.go | 2 +- pkg/cmd/run/rerun/rerun_test.go | 2 +- pkg/cmd/run/view/view_test.go | 30 +++++++++++++++--------------- pkg/cmd/run/watch/watch_test.go | 8 ++++---- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pkg/cmd/run/cancel/cancel_test.go b/pkg/cmd/run/cancel/cancel_test.go index d3f580870..c894f4812 100644 --- a/pkg/cmd/run/cancel/cancel_test.go +++ b/pkg/cmd/run/cancel/cancel_test.go @@ -196,9 +196,9 @@ func TestRunCancel(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"* cool commit, CI (trunk) Feb 23, 2021"}, + []string{"* cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "* cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "* cool commit, CI [trunk] Feb 23, 2021") }) }, wantOut: "✓ Request to cancel workflow 1234 submitted.\n", diff --git a/pkg/cmd/run/delete/delete_test.go b/pkg/cmd/run/delete/delete_test.go index 5df69aa60..b9ed2f6a0 100644 --- a/pkg/cmd/run/delete/delete_test.go +++ b/pkg/cmd/run/delete/delete_test.go @@ -132,7 +132,7 @@ func TestRunDelete(t *testing.T) { }, prompterStubs: func(pm *prompter.PrompterMock) { pm.SelectFunc = func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") } }, httpStubs: func(reg *httpmock.Registry) { diff --git a/pkg/cmd/run/rerun/rerun_test.go b/pkg/cmd/run/rerun/rerun_test.go index aac5c0797..0dc74129e 100644 --- a/pkg/cmd/run/rerun/rerun_test.go +++ b/pkg/cmd/run/rerun/rerun_test.go @@ -341,7 +341,7 @@ func TestRerun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { return 2, nil }) diff --git a/pkg/cmd/run/view/view_test.go b/pkg/cmd/run/view/view_test.go index 05eb25754..3a04fb186 100644 --- a/pkg/cmd/run/view/view_test.go +++ b/pkg/cmd/run/view/view_test.go @@ -543,9 +543,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) }, opts: &ViewOptions{ @@ -593,9 +593,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) pm.RegisterSelect("View a specific job in this run?", []string{"View all jobs in this run", "✓ cool job", "X sad job"}, @@ -646,9 +646,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) pm.RegisterSelect("View a specific job in this run?", []string{"View all jobs in this run", "✓ cool job", "X sad job"}, @@ -743,9 +743,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) pm.RegisterSelect("View a specific job in this run?", []string{"View all jobs in this run", "✓ cool job", "X sad job"}, @@ -823,7 +823,7 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { return 4, nil }) @@ -876,7 +876,7 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { return 4, nil }) @@ -950,7 +950,7 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { return 4, nil }) @@ -1104,9 +1104,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) pm.RegisterSelect("View a specific job in this run?", []string{"View all jobs in this run", "✓ cool job", "X sad job"}, @@ -1155,9 +1155,9 @@ func TestViewRun(t *testing.T) { }, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"X cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "✓ cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "- cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "* cool commit, CI (trunk) Feb 23, 2021", "X cool commit, CI (trunk) Feb 23, 2021"}, + []string{"X cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "✓ cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "- cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "* cool commit, CI [trunk] Feb 23, 2021", "X cool commit, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "✓ cool commit, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "✓ cool commit, CI [trunk] Feb 23, 2021") }) pm.RegisterSelect("View a specific job in this run?", []string{"View all jobs in this run", "✓ cool job", "X sad job"}, diff --git a/pkg/cmd/run/watch/watch_test.go b/pkg/cmd/run/watch/watch_test.go index 442ef4252..d42e8d3d8 100644 --- a/pkg/cmd/run/watch/watch_test.go +++ b/pkg/cmd/run/watch/watch_test.go @@ -272,9 +272,9 @@ func TestWatchRun(t *testing.T) { httpStubs: successfulRunStubs, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"* commit1, CI (trunk) Feb 23, 2021", "* commit2, CI (trunk) Feb 23, 2021"}, + []string{"* commit1, CI [trunk] Feb 23, 2021", "* commit2, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "* commit2, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "* commit2, CI [trunk] Feb 23, 2021") }) }, wantOut: "\x1b[?1049h\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk CI · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\x1b[?1049l✓ trunk CI · 2\nTriggered via push about 59 minutes ago\n\nJOBS\n✓ cool job in 4m34s (ID 10)\n ✓ fob the barz\n ✓ barz the fob\n\n✓ Run CI (2) completed with 'success'\n", @@ -290,9 +290,9 @@ func TestWatchRun(t *testing.T) { httpStubs: failedRunStubs, promptStubs: func(pm *prompter.MockPrompter) { pm.RegisterSelect("Select a workflow run", - []string{"* commit1, CI (trunk) Feb 23, 2021", "* commit2, CI (trunk) Feb 23, 2021"}, + []string{"* commit1, CI [trunk] Feb 23, 2021", "* commit2, CI [trunk] Feb 23, 2021"}, func(_, _ string, opts []string) (int, error) { - return prompter.IndexFor(opts, "* commit2, CI (trunk) Feb 23, 2021") + return prompter.IndexFor(opts, "* commit2, CI [trunk] Feb 23, 2021") }) }, wantOut: "\x1b[?1049h\x1b[0;0H\x1b[JRefreshing run status every 0 seconds. Press Ctrl+C to quit.\n\n* trunk CI · 2\nTriggered via push about 59 minutes ago\n\n\x1b[?1049lX trunk CI · 2\nTriggered via push about 59 minutes ago\n\nJOBS\nX sad job in 4m34s (ID 20)\n ✓ barf the quux\n X quux the barf\n\nANNOTATIONS\nX the job is sad\nsad job: blaze.py#420\n\n\nX Run CI (2) completed with 'failure'\n", From 40beb82e0cc191828463300832067fbc50cde384 Mon Sep 17 00:00:00 2001 From: Uday R <82779467+uday-rana@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:19:30 -0500 Subject: [PATCH 3/3] fix: list branches in square brackets in gh codespace --- pkg/cmd/codespace/common.go | 2 +- pkg/cmd/codespace/common_test.go | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/cmd/codespace/common.go b/pkg/cmd/codespace/common.go index fc70febee..e56e6c0b8 100644 --- a/pkg/cmd/codespace/common.go +++ b/pkg/cmd/codespace/common.go @@ -198,7 +198,7 @@ func (c codespace) displayName(includeOwner bool) string { displayName = c.Name } - description := fmt.Sprintf("%s (%s): %s", c.Repository.FullName, branch, displayName) + description := fmt.Sprintf("%s [%s]: %s", c.Repository.FullName, branch, displayName) if includeOwner { description = fmt.Sprintf("%-15s %s", c.Owner.Login, description) diff --git a/pkg/cmd/codespace/common_test.go b/pkg/cmd/codespace/common_test.go index 717bbb69b..62fd02f9b 100644 --- a/pkg/cmd/codespace/common_test.go +++ b/pkg/cmd/codespace/common_test.go @@ -34,7 +34,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "cli/cli (trunk): scuba steve", + want: "cli/cli [trunk]: scuba steve", }, { name: "No included name - included gitstatus - no unsaved changes", @@ -50,7 +50,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "cli/cli (trunk): scuba steve", + want: "cli/cli [trunk]: scuba steve", }, { name: "No included name - included gitstatus - unsaved changes", @@ -67,7 +67,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "cli/cli (trunk*): scuba steve", + want: "cli/cli [trunk*]: scuba steve", }, { name: "Included name - included gitstatus - unsaved changes", @@ -84,7 +84,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "cli/cli (trunk*): scuba steve", + want: "cli/cli [trunk*]: scuba steve", }, { name: "Included name - included gitstatus - no unsaved changes", @@ -101,7 +101,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "cli/cli (trunk): scuba steve", + want: "cli/cli [trunk]: scuba steve", }, { name: "with includeOwner true, prefixes the codespace owner", @@ -123,7 +123,7 @@ func Test_codespace_displayName(t *testing.T) { DisplayName: "scuba steve", }, }, - want: "jimmy cli/cli (trunk): scuba steve", + want: "jimmy cli/cli [trunk]: scuba steve", }, } for _, tt := range tests { @@ -163,7 +163,7 @@ func Test_formatCodespacesForSelect(t *testing.T) { }, }, wantCodespacesNames: []string{ - "cli/cli (trunk): scuba steve", + "cli/cli [trunk]: scuba steve", }, }, { @@ -191,8 +191,8 @@ func Test_formatCodespacesForSelect(t *testing.T) { }, }, wantCodespacesNames: []string{ - "cli/cli (trunk): scuba steve", - "cli/cli (trunk): flappy bird", + "cli/cli [trunk]: scuba steve", + "cli/cli [trunk]: flappy bird", }, }, { @@ -220,8 +220,8 @@ func Test_formatCodespacesForSelect(t *testing.T) { }, }, wantCodespacesNames: []string{ - "cli/cli (trunk): scuba steve", - "cli/cli (feature): flappy bird", + "cli/cli [trunk]: scuba steve", + "cli/cli [feature]: flappy bird", }, }, { @@ -249,8 +249,8 @@ func Test_formatCodespacesForSelect(t *testing.T) { }, }, wantCodespacesNames: []string{ - "github/cli (trunk): scuba steve", - "cli/cli (trunk): flappy bird", + "github/cli [trunk]: scuba steve", + "cli/cli [trunk]: flappy bird", }, }, { @@ -279,8 +279,8 @@ func Test_formatCodespacesForSelect(t *testing.T) { }, }, wantCodespacesNames: []string{ - "cli/cli (trunk): scuba steve", - "cli/cli (trunk*): flappy bird", + "cli/cli [trunk]: scuba steve", + "cli/cli [trunk*]: flappy bird", }, }, }