Skip to content

Commit

Permalink
feat: add pr link as coming from new webhook (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-harness authored Dec 20, 2023
1 parent 2877ffa commit 93042b7
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "user",
"created": 1675390885380,
"updated": 1675390885380
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Source": "b",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": false,
"Merged": false,
"Author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"type": "user",
"created": 1696332021613,
"updated": 1696332021613
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Source": "asdxsa",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/codeowners/asdsad.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": true,
"Merged": false,
"Author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "user",
"created": 1675390885380,
"updated": 1675390885380
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Source": "pr2",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/asd/demo.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": false,
"Merged": false,
"Author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "user",
"created": 1696332021613,
"updated": 1696332021613
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Source": "xas",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/codeowners/asdsad.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": true,
"Merged": true,
"Author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "user",
"created": 1675390885380,
"updated": 1675390885380
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Source": "b",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": false,
"Merged": false,
"Author": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "user",
"created": 1675390885380,
"updated": 1675390885380
}
},
"pr_url": "http://localhost:3000/codeowners/asdsad/pulls/14"
},
"target_ref": {
"name": "refs/heads/main",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Source": "b",
"Target": "main",
"Fork": "fork",
"Link": "http://localhost:3000/git/kmpySmUISimoRrJL6NL73w/myOrg/myProject/aba.git",
"Link": "http://localhost:3000/codeowners/asdsad/pulls/14",
"Closed": false,
"Merged": false,
"Author": {
Expand Down
3 changes: 2 additions & 1 deletion scm/driver/harness/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type (
TargetBranch string `json:"target_branch"`
MergeStrategy interface{} `json:"merge_strategy"`
Author principal `json:"author"`
PrURL string `json:"pr_url"`
}
targetRef struct {
Name string `json:"name"`
Expand Down Expand Up @@ -277,7 +278,7 @@ func convertPullReq(pr pullReq, ref ref, commit hookCommit) scm.PullRequest {
Target: pr.TargetBranch,
Merged: pr.State == "merged",
Fork: "fork",
Link: ref.Repo.GitURL,
Link: pr.PrURL,
Sha: commit.Sha,
Ref: ref.Name,
Author: convertUser(pr.Author),
Expand Down

0 comments on commit 93042b7

Please sign in to comment.