diff --git a/scm/driver/harness/testdata/webhooks/pull_request_branch_updated.json.golden b/scm/driver/harness/testdata/webhooks/pull_request_branch_updated.json.golden index 9a768dde..6be31bb7 100644 --- a/scm/driver/harness/testdata/webhooks/pull_request_branch_updated.json.golden +++ b/scm/driver/harness/testdata/webhooks/pull_request_branch_updated.json.golden @@ -6,7 +6,7 @@ "Name": "", "Branch": "main", "Private": false, - "Clone": "", + "Clone": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "CloneSSH": "", "Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "Created": "0001-01-01T00:00:00Z", @@ -17,7 +17,7 @@ "Title": "aw", "Body": "", "Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef", - "Ref": "", + "Ref": "refs/heads/b", "Source": "b", "Target": "main", "Fork": "fork", @@ -26,8 +26,8 @@ "Merged": false, "Author": { "Login": "", - "Name": "", - "Email": "", + "Name": "Admin", + "Email": "admin@harness.io", "Avatar": "" }, "Created": "0001-01-01T00:00:00Z", diff --git a/scm/driver/harness/testdata/webhooks/pull_request_opened.json.golden b/scm/driver/harness/testdata/webhooks/pull_request_opened.json.golden index e45f24bc..2928bf6a 100644 --- a/scm/driver/harness/testdata/webhooks/pull_request_opened.json.golden +++ b/scm/driver/harness/testdata/webhooks/pull_request_opened.json.golden @@ -6,7 +6,7 @@ "Name": "", "Branch": "main", "Private": false, - "Clone": "", + "Clone": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "CloneSSH": "", "Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "Created": "0001-01-01T00:00:00Z", @@ -17,7 +17,7 @@ "Title": "aw", "Body": "", "Sha": "d74b1ebfe520ac01b209dd9085f005884cc9f4cd", - "Ref": "", + "Ref": "refs/heads/b", "Source": "b", "Target": "main", "Fork": "fork", @@ -26,8 +26,8 @@ "Merged": false, "Author": { "Login": "", - "Name": "", - "Email": "", + "Name": "Admin", + "Email": "admin@harness.io", "Avatar": "" }, "Created": "0001-01-01T00:00:00Z", diff --git a/scm/driver/harness/testdata/webhooks/pull_request_reopened.json.golden b/scm/driver/harness/testdata/webhooks/pull_request_reopened.json.golden index bbea8055..03f8b54d 100644 --- a/scm/driver/harness/testdata/webhooks/pull_request_reopened.json.golden +++ b/scm/driver/harness/testdata/webhooks/pull_request_reopened.json.golden @@ -6,7 +6,7 @@ "Name": "", "Branch": "main", "Private": false, - "Clone": "", + "Clone": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "CloneSSH": "", "Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git", "Created": "0001-01-01T00:00:00Z", @@ -17,7 +17,7 @@ "Title": "aw", "Body": "", "Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef", - "Ref": "", + "Ref": "refs/heads/b", "Source": "b", "Target": "main", "Fork": "fork", @@ -26,8 +26,8 @@ "Merged": false, "Author": { "Login": "", - "Name": "", - "Email": "", + "Name": "Admin", + "Email": "admin@harness.io", "Avatar": "" }, "Created": "0001-01-01T00:00:00Z", diff --git a/scm/driver/harness/webhook.go b/scm/driver/harness/webhook.go index 1aa2d45f..cc077a6c 100644 --- a/scm/driver/harness/webhook.go +++ b/scm/driver/harness/webhook.go @@ -196,11 +196,17 @@ func convertPullRequestHook(dst *pullRequestHook) *scm.PullRequestHook { Fork: "fork", Link: dst.Ref.Repo.GitURL, Sha: dst.Commit.Sha, + Ref: dst.Ref.Name, + Author: scm.User{ + Name: dst.Commit.Committer.Identity.Name, + Email: dst.Commit.Committer.Identity.Email, + }, }, Repo: scm.Repository{ ID: dst.Repo.UID, Branch: dst.Repo.DefaultBranch, Link: dst.Repo.GitURL, + Clone: dst.Repo.GitURL, }, Sender: scm.User{ Email: dst.Principal.Email,