diff --git a/pkg/cmd/agent-task/capi/sessions.go b/pkg/cmd/agent-task/capi/sessions.go index b553fc932..f53028941 100644 --- a/pkg/cmd/agent-task/capi/sessions.go +++ b/pkg/cmd/agent-task/capi/sessions.go @@ -47,6 +47,7 @@ type sessionPullRequest struct { State string URL string Body string + IsDraft bool CreatedAt time.Time UpdatedAt time.Time @@ -252,6 +253,7 @@ func (c *CAPIClient) hydrateSessionPullRequestsAndUsers(sessions []session) ([]* Number: node.PullRequest.Number, Title: node.PullRequest.Title, State: node.PullRequest.State, + IsDraft: node.PullRequest.IsDraft, URL: node.PullRequest.URL, Body: node.PullRequest.Body, CreatedAt: node.PullRequest.CreatedAt, diff --git a/pkg/cmd/agent-task/capi/sessions_test.go b/pkg/cmd/agent-task/capi/sessions_test.go index 0ff3a46f8..94991fb8b 100644 --- a/pkg/cmd/agent-task/capi/sessions_test.go +++ b/pkg/cmd/agent-task/capi/sessions_test.go @@ -98,6 +98,7 @@ func TestListSessionsForViewer(t *testing.T) { "number": 42, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/42", "body": "", "createdAt": "%[1]s", @@ -141,6 +142,7 @@ func TestListSessionsForViewer(t *testing.T) { Number: 42, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/42", Body: "", CreatedAt: sampleDate, @@ -236,6 +238,7 @@ func TestListSessionsForViewer(t *testing.T) { "number": 42, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/42", "body": "", "createdAt": "%[1]s", @@ -251,6 +254,7 @@ func TestListSessionsForViewer(t *testing.T) { "number": 43, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/43", "body": "", "createdAt": "%[1]s", @@ -293,6 +297,7 @@ func TestListSessionsForViewer(t *testing.T) { Number: 42, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/42", Body: "", CreatedAt: sampleDate, @@ -325,6 +330,7 @@ func TestListSessionsForViewer(t *testing.T) { Number: 43, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/43", Body: "", CreatedAt: sampleDate, @@ -528,6 +534,7 @@ func TestListSessionsForRepo(t *testing.T) { "number": 42, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/42", "body": "", "createdAt": "%[1]s", @@ -570,6 +577,7 @@ func TestListSessionsForRepo(t *testing.T) { Number: 42, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/42", Body: "", CreatedAt: sampleDate, @@ -665,6 +673,7 @@ func TestListSessionsForRepo(t *testing.T) { "number": 42, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/42", "body": "", "createdAt": "%[1]s", @@ -680,6 +689,7 @@ func TestListSessionsForRepo(t *testing.T) { "number": 43, "title": "Improve docs", "state": "OPEN", + "isDraft": true, "url": "https://github.com/OWNER/REPO/pull/43", "body": "", "createdAt": "%[1]s", @@ -722,6 +732,7 @@ func TestListSessionsForRepo(t *testing.T) { Number: 42, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/42", Body: "", CreatedAt: sampleDate, @@ -754,6 +765,7 @@ func TestListSessionsForRepo(t *testing.T) { Number: 43, Title: "Improve docs", State: "OPEN", + IsDraft: true, URL: "https://github.com/OWNER/REPO/pull/43", Body: "", CreatedAt: sampleDate,