-
Notifications
You must be signed in to change notification settings - Fork 240
feat: new hc webhook fields #337
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
scm/driver/harness/webhook.go
Outdated
Sha: commit.Sha, | ||
Ref: ref.Name, | ||
Author: convertUser(pr.Author), | ||
Head: scm.Reference{ | ||
Name: pr.SourceBranch, | ||
Path: scm.ExpandRef(ref.Name, "refs/heads"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor use either pr.SourceBranch
in both, or ref.Name
in both
@@ -356,15 +358,27 @@ func convertPullReq(pr pullReq, ref ref, commit hookCommit) scm.PullRequest { | |||
return scm.PullRequest{ | |||
Number: pr.Number, | |||
Title: pr.Title, | |||
Body: pr.Description, | |||
Closed: pr.State != "open", | |||
Source: pr.SourceBranch, | |||
Target: pr.TargetBranch, | |||
Merged: pr.State == "merged", | |||
Fork: "fork", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be empty 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go-scm/scm/driver/github/pr.go
Line 78 in ecd9254
Body string `json:"body"` |
Base: scm.Reference{ | ||
Name: pr.TargetBranch, | ||
Path: scm.ExpandRef(pr.TargetBranch, "refs/heads"), | ||
Sha: pr.MergeBaseSHA, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mergebasesha isn't necessarily the sha of the targetbranch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was something i was doubtful about
go-scm/scm/driver/github/pr.go
Line 169 in ecd9254
Sha: from.Base.Sha, |
In github they do this https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request
No description provided.