Skip to content

Commit

Permalink
feat: add more parsed data in harness webhook parsing (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-harness committed Oct 11, 2023
1 parent 166ac92 commit 6982ab8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -17,7 +17,7 @@
"Title": "aw",
"Body": "",
"Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef",
"Ref": "",
"Ref": "refs/heads/b",
"Source": "b",
"Target": "main",
"Fork": "fork",
Expand All @@ -26,8 +26,8 @@
"Merged": false,
"Author": {
"Login": "",
"Name": "",
"Email": "",
"Name": "Admin",
"Email": "admin@harness.io",
"Avatar": ""
},
"Created": "0001-01-01T00:00:00Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -17,7 +17,7 @@
"Title": "aw",
"Body": "",
"Sha": "d74b1ebfe520ac01b209dd9085f005884cc9f4cd",
"Ref": "",
"Ref": "refs/heads/b",
"Source": "b",
"Target": "main",
"Fork": "fork",
Expand All @@ -26,8 +26,8 @@
"Merged": false,
"Author": {
"Login": "",
"Name": "",
"Email": "",
"Name": "Admin",
"Email": "admin@harness.io",
"Avatar": ""
},
"Created": "0001-01-01T00:00:00Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -17,7 +17,7 @@
"Title": "aw",
"Body": "",
"Sha": "f74f3d2a88d1b7cb19ff3bf069aa423763d341ef",
"Ref": "",
"Ref": "refs/heads/b",
"Source": "b",
"Target": "main",
"Fork": "fork",
Expand All @@ -26,8 +26,8 @@
"Merged": false,
"Author": {
"Login": "",
"Name": "",
"Email": "",
"Name": "Admin",
"Email": "admin@harness.io",
"Avatar": ""
},
"Created": "0001-01-01T00:00:00Z",
Expand Down
6 changes: 6 additions & 0 deletions scm/driver/harness/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6982ab8

Please sign in to comment.