Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abhinav-harness
Copy link
Collaborator

No description provided.

Sha: commit.Sha,
Ref: ref.Name,
Author: convertUser(pr.Author),
Head: scm.Reference{
Name: pr.SourceBranch,
Path: scm.ExpandRef(ref.Name, "refs/heads"),
Copy link
Contributor

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",
Copy link
Contributor

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 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Body string `json:"body"`

Base: scm.Reference{
Name: pr.TargetBranch,
Path: scm.ExpandRef(pr.TargetBranch, "refs/heads"),
Sha: pr.MergeBaseSHA,
Copy link
Contributor

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

Copy link
Collaborator Author

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

Sha: from.Base.Sha,

In github they do this https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=opened#pull_request

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants