From 9cc12dc94c0cc645f003f96c2f148c6ac48cf776 Mon Sep 17 00:00:00 2001 From: Roei Oshry Date: Thu, 19 Jun 2025 18:00:38 +0300 Subject: [PATCH] Add github pr status --- vcsclient/github.go | 1 + vcsclient/github_test.go | 3 +++ vcsclient/vcsclient.go | 1 + 3 files changed, 5 insertions(+) diff --git a/vcsclient/github.go b/vcsclient/github.go index 42612ca..f28281e 100644 --- a/vcsclient/github.go +++ b/vcsclient/github.go @@ -477,6 +477,7 @@ func mapGitHubPullRequestToPullRequestInfo(ghPullRequest *github.PullRequest, wi Repository: targetRepoName, Owner: targetRepoOwner, }, + Status: vcsutils.DefaultIfNotNil(ghPullRequest.State), }, nil } diff --git a/vcsclient/github_test.go b/vcsclient/github_test.go index 65feee5..edbddbc 100644 --- a/vcsclient/github_test.go +++ b/vcsclient/github_test.go @@ -674,6 +674,7 @@ func TestGitHubClient_ListOpenPullRequests(t *testing.T) { Source: BranchInfo{Name: "new-topic", Repository: "Hello-World", Owner: owner}, Target: BranchInfo{Name: "master", Repository: "Hello-World", Owner: owner}, URL: "https://github.com/octocat/Hello-World/pull/1347", + Status: "open", }, result[0]) _, err = createBadGitHubClient(t).ListPullRequestComments(ctx, owner, repo1, 1) @@ -692,6 +693,7 @@ func TestGitHubClient_ListOpenPullRequests(t *testing.T) { Source: BranchInfo{Name: "new-topic", Repository: "Hello-World", Owner: owner}, Target: BranchInfo{Name: "master", Repository: "Hello-World", Owner: owner}, URL: "https://github.com/octocat/Hello-World/pull/1347", + Status: "open", }, result[0]) _, err = createBadGitHubClient(t).ListPullRequestComments(ctx, owner, repo1, 1) @@ -720,6 +722,7 @@ func TestGitHubClient_GetPullRequestByID(t *testing.T) { Target: BranchInfo{Name: "master", Repository: "Hello-World", Owner: forkedOwner}, URL: "https://github.com/octocat/Hello-World/pull/1347", Author: "octocat", + Status: "open", }, result) // Bad Labels diff --git a/vcsclient/vcsclient.go b/vcsclient/vcsclient.go index 71efa4d..a44a12c 100644 --- a/vcsclient/vcsclient.go +++ b/vcsclient/vcsclient.go @@ -409,6 +409,7 @@ type PullRequestInfo struct { Author string Source BranchInfo Target BranchInfo + Status string } type PullRequestReviewDetails struct {