Skip to content

Commit 4a0c32e

Browse files
committed
fix(agent-task list): show capitalised session state
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent 7643768 commit 4a0c32e

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

pkg/cmd/agent-task/list/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ func listRun(opts *ListOptions) error {
127127

128128
// State
129129
if tp.IsTTY() {
130-
tp.AddField(s.State, tableprinter.WithColor(shared.ColorFuncForSessionState(*s, cs)))
130+
tp.AddField(shared.SessionStateString(s.State), tableprinter.WithColor(shared.ColorFuncForSessionState(*s, cs)))
131131
} else {
132-
tp.AddField(s.State)
132+
tp.AddField(shared.SessionStateString(s.State))
133133
}
134134

135135
// Created

pkg/cmd/agent-task/list/list_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ func Test_listRun(t *testing.T) {
151151
wantOut: heredoc.Doc(`
152152
Showing 1 session
153153
154-
SESSION NAME PULL REQUEST REPO SESSION STATE CREATED
155-
s1 #101 OWNER/REPO completed about 6 hours ago
154+
SESSION NAME PULL REQUEST REPO SESSION STATE CREATED
155+
s1 #101 OWNER/REPO Ready for review about 6 hours ago
156156
`),
157157
},
158158
{
@@ -177,7 +177,7 @@ func Test_listRun(t *testing.T) {
177177
}, nil
178178
}
179179
},
180-
wantOut: "s1\t#101\tOWNER/REPO\tcompleted\t" + sampleDateString + "\n", // header omitted for non-tty
180+
wantOut: "s1\t#101\tOWNER/REPO\tReady for review\t" + sampleDateString + "\n", // header omitted for non-tty
181181
},
182182
{
183183
name: "viewer-scoped many sessions (tty)",
@@ -240,7 +240,7 @@ func Test_listRun(t *testing.T) {
240240
{
241241
ID: "id5",
242242
Name: "s5",
243-
State: "canceled",
243+
State: "cancelled",
244244
CreatedAt: sampleDate,
245245
ResourceType: "pull",
246246
PullRequest: &api.PullRequest{
@@ -269,13 +269,13 @@ func Test_listRun(t *testing.T) {
269269
wantOut: heredoc.Doc(`
270270
Showing 6 sessions
271271
272-
SESSION NAME PULL REQUEST REPO SESSION STATE CREATED
273-
s1 #101 OWNER/REPO completed about 6 hours ago
274-
s2 #102 OWNER/REPO failed about 6 hours ago
275-
s3 #103 OWNER/REPO in_progress about 6 hours ago
276-
s4 #104 OWNER/REPO queued about 6 hours ago
277-
s5 #105 OWNER/REPO canceled about 6 hours ago
278-
s6 #106 OWNER/REPO mystery about 6 hours ago
272+
SESSION NAME PULL REQUEST REPO SESSION STATE CREATED
273+
s1 #101 OWNER/REPO Ready for review about 6 hours ago
274+
s2 #102 OWNER/REPO Failed about 6 hours ago
275+
s3 #103 OWNER/REPO In progress about 6 hours ago
276+
s4 #104 OWNER/REPO Queued about 6 hours ago
277+
s5 #105 OWNER/REPO Cancelled about 6 hours ago
278+
s6 #106 OWNER/REPO mystery about 6 hours ago
279279
`),
280280
},
281281
{

0 commit comments

Comments
 (0)