From ed2c85957392377852b24a94c5d0b02b57db7b9c Mon Sep 17 00:00:00 2001 From: Vincent Rivellino Date: Mon, 29 Jan 2024 16:25:39 -0500 Subject: [PATCH] feat: trigger argo-diff from comment --- README.md | 3 - internal/process_event/code_change.go | 16 ++ internal/server/http_server.go | 8 +- internal/webhook/process.go | 44 ++- internal/webhook/process_test.go | 47 ++++ .../payload-comment-argodiff-created.json | 264 ++++++++++++++++++ .../payload-comment-created.json | 264 ++++++++++++++++++ post-local.sh | 4 +- 8 files changed, 642 insertions(+), 8 deletions(-) create mode 100644 internal/webhook/webhook_testdata/payload-comment-argodiff-created.json create mode 100644 internal/webhook/webhook_testdata/payload-comment-created.json diff --git a/README.md b/README.md index ecda41a..b70eb27 100644 --- a/README.md +++ b/README.md @@ -103,11 +103,8 @@ Below are screenshots of Github Pull Request comments generated by argo-diff. This is still in a proof-of-concept and alpha/beta version state, so there are some known limitations. -- If there's a problem, and the diff comment needs to be regenerated, an admin must redeliver the webhook - event associated with the PR. In the future, argo-diff may be re-initated by a comment on the PR. [#11] - Changes to Secrets are _not_ displayed. A future enhancement could flag that secrets are changing without displaying the contents. [#52] -- Only supports Github Personal Access Tokens at this time. [#14] - When many Argo applications are served by a single repository, performance may be slow. Manifests for eac Argo application are fetched sequentially, so this could result in argo-diff statuses and/or comments taking minutes to complete. diff --git a/internal/process_event/code_change.go b/internal/process_event/code_change.go index a8e96f6..ca9cb54 100644 --- a/internal/process_event/code_change.go +++ b/internal/process_event/code_change.go @@ -34,6 +34,22 @@ func ProcessCodeChange(eventInfo webhook.EventInfo, devMode bool, wg *sync.WaitG defer cancel() isPr := eventInfo.PrNum > 0 + if isPr && eventInfo.Refresh { + pull, err := github.GetPullRequest(ctx, eventInfo.RepoOwner, eventInfo.RepoName, eventInfo.PrNum) + if err != nil { + log.Error().Err(err).Msgf("github.GetPullRequest(%s, %s, %d) failed", eventInfo.RepoOwner, eventInfo.RepoName, eventInfo.PrNum) + return + } + base := pull.GetBase() + head := pull.GetHead() + if base == nil || head == nil { + log.Error().Msgf("Empty branch information when refreshing %s/%s#%d", eventInfo.RepoOwner, eventInfo.RepoName, eventInfo.PrNum) + return + } + eventInfo.Sha = *head.SHA + eventInfo.ChangeRef = *head.Ref + eventInfo.BaseRef = *base.Ref + } // set commit status to PENDING github.Status(ctx, isPr, github.StatusPending, "", eventInfo.RepoOwner, eventInfo.RepoName, eventInfo.Sha, devMode) diff --git a/internal/server/http_server.go b/internal/server/http_server.go index 1027bc5..2b8437a 100644 --- a/internal/server/http_server.go +++ b/internal/server/http_server.go @@ -85,6 +85,12 @@ func (wp *WebhookProcessor) handleWebhook(w http.ResponseWriter, r *http.Request http.Error(w, "Could not process push event data", http.StatusInternalServerError) return } + case "issue_comment": + eventInfo, err = webhook.ProcessComment(payload) + if err != nil { + http.Error(w, "Could not process issue comment data", http.StatusInternalServerError) + return + } default: log.Info().Str("method", r.Method).Str("url", r.URL.String()).Msgf("Ignoring X-GitHub-Event %s", event) _, err := io.WriteString(w, "event ignored\n") @@ -155,7 +161,7 @@ func StartWebhookProcessor(host string, port int, webhook_secret string, devMode wp := WebhookProcessor{ GithubWebhookSecret: webhook_secret, - DevMode: false, + DevMode: devMode, } srv := &http.Server{Addr: addr} diff --git a/internal/webhook/process.go b/internal/webhook/process.go index 8df1c28..478ef0a 100644 --- a/internal/webhook/process.go +++ b/internal/webhook/process.go @@ -20,6 +20,7 @@ type EventInfo struct { PrNum int `json:"pr"` ChangeRef string `json:"change_ref"` BaseRef string `json:"base_ref"` + Refresh bool `json:"ignore"` } func NewEventInfo() EventInfo { @@ -32,6 +33,7 @@ func NewEventInfo() EventInfo { PrNum: -1, ChangeRef: "", BaseRef: "", + Refresh: false, } } @@ -45,10 +47,10 @@ func validateEventInfo(e EventInfo) error { if e.RepoDefaultRef == "" { return errors.New("missing default ref in event info object") } - if e.Sha == "" { + if !e.Refresh && e.Sha == "" { return errors.New("missing SHA in event info object") } - if e.ChangeRef == "" { + if !e.Refresh && e.ChangeRef == "" { return errors.New("missing change ref in event info object") } return nil @@ -113,3 +115,41 @@ func ProcessPush(payload []byte) (EventInfo, error) { log.Debug().Msgf("Returning EventInfo: %+v", pushInfo) return pushInfo, validateEventInfo(pushInfo) } + +// Processes a comment created event received from github +func ProcessComment(payload []byte) (EventInfo, error) { + prInfo := NewEventInfo() + var commentEvent github.IssueCommentEvent + if err := json.Unmarshal(payload, &commentEvent); err != nil { + log.Error().Err(err).Msg("Error decoding JSON payload") + return prInfo, err + } + if action := commentEvent.GetAction(); action != "created" { + log.Info().Msgf("Ignoring issue comment event with action %s", action) + return prInfo, nil + } + issue := commentEvent.GetIssue() + issueComment := commentEvent.GetComment() + repo := commentEvent.GetRepo() + if issue == nil || issueComment == nil || repo == nil { + log.Warn().Msg("Ignoring issue comment event with missing field(s)") + return prInfo, nil + } + if issue.PullRequestLinks == nil { + log.Info().Msg("Ignoring non-pull issue comment") + return prInfo, nil + } + prInfo.PrNum = *issue.Number + prInfo.RepoOwner = *repo.Owner.Login + prInfo.RepoName = *repo.Name + prInfo.RepoDefaultRef = *repo.DefaultBranch + // TODO ToLower() and look at context string + if issueComment.Body == nil || strings.TrimSpace(*issueComment.Body) != "argo diff" { + log.Info().Msg("Ignoring pull request comment") + return prInfo, nil + } + prInfo.Ignore = false + prInfo.Refresh = true + log.Debug().Msgf("Returning EventInfo: %+v", prInfo) + return prInfo, validateEventInfo(prInfo) +} diff --git a/internal/webhook/process_test.go b/internal/webhook/process_test.go index c817f9f..198229b 100644 --- a/internal/webhook/process_test.go +++ b/internal/webhook/process_test.go @@ -17,6 +17,8 @@ const payloadPushBranchDelete = "payload-push-branch-delete.json" const payloadPushBranchDev = "payload-push-branch-dev.json" const payloadPushBranchMain = "payload-push-branch-main.json" const payloadPushTag = "payload-push-tag.json" +const payloadCommentCreated = "payload-comment-created.json" +const payloadCommentCreatedArgoDiff = "payload-comment-argodiff-created.json" func readFileToByteArray(fileName string) ([]byte, string, error) { workingDir, err := os.Getwd() @@ -60,6 +62,9 @@ func TestLoadPullRequestEvents(t *testing.T) { if result.RepoDefaultRef == result.ChangeRef { t.Errorf("ProcessPullRequest() ChangeRef is the same as DefaultRef") } + if result.Refresh { + t.Errorf("ProcessPullRequest() Expected to NOT set refresh flag. Payload %s", filePath) + } } } } @@ -107,6 +112,9 @@ func TestLoadPushEvents(t *testing.T) { t.Errorf("ProcessPushRequest() Result has at least one empty value: %+v; Payload %s", result, filePath) } } + if result.Refresh { + t.Errorf("ProcessPushRequest() Expected to NOT set refresh flag. Payload %s", filePath) + } } } @@ -124,3 +132,42 @@ func TestLoadNotAPushEvent(t *testing.T) { t.Errorf("ProcessPushRequest() Bad event %s should have been ignored", filePath) } } + +func TestLoadCommentEvent(t *testing.T) { + var result EventInfo + // const payloadCommentCreated = "payload-comment-created.json" + // const payloadCommentCreatedArgoDiff = "payload-comment-argodiff-created.json" + payloadFiles := []string{payloadCommentCreated, payloadCommentCreatedArgoDiff} + for _, payloadFile := range payloadFiles { + payload, filePath, err := readFileToByteArray(payloadFile) + if err != nil { + t.Errorf("Failed to read %s: %v", payloadFile, err) + } + if err != nil { + t.Errorf("Failed to read %s: %v", payloadCommentCreated, err) + } + result, err = ProcessComment(payload) + if err != nil { + t.Errorf("Failed to load payload from %s: %v", filePath, err) + } + if result.RepoOwner == "" || result.RepoName == "" || result.RepoDefaultRef == "" || result.PrNum < 1 { + t.Errorf("ProcessComment() Result has at least one empty value: %+v; Payload %s", result, filePath) + } + if payloadFile == payloadCommentCreated { + if !result.Ignore { + t.Errorf("ProcessComment() Expected to ignore this event. Payload %s", filePath) + } + if result.Refresh { + t.Errorf("ProcessComment() Expected to NOT set refresh flag. Payload %s", filePath) + } + } + if payloadFile == payloadCommentCreatedArgoDiff { + if result.Ignore { + t.Errorf("ProcessComment() Expected to NOT ignore this event. Payload %s", filePath) + } + if !result.Refresh { + t.Errorf("ProcessComment() Expected to set refresh flag. Payload %s", filePath) + } + } + } +} diff --git a/internal/webhook/webhook_testdata/payload-comment-argodiff-created.json b/internal/webhook/webhook_testdata/payload-comment-argodiff-created.json new file mode 100644 index 0000000..3958504 --- /dev/null +++ b/internal/webhook/webhook_testdata/payload-comment-argodiff-created.json @@ -0,0 +1,264 @@ +{ + "action": "created", + "issue": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2", + "repository_url": "https://api.github.com/repos/vince-riv/argo-diff", + "labels_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/comments", + "events_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/events", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2", + "id": 2104330119, + "node_id": "PR_kwDOKoDcU85lQ5yq", + "number": 2, + "title": "feat: support installation via Github app", + "user": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [ + + ], + "milestone": null, + "comments": 2, + "created_at": "2024-01-28T20:13:20Z", + "updated_at": "2024-01-29T19:45:39Z", + "closed_at": null, + "author_association": "CONTRIBUTOR", + "active_lock_reason": null, + "draft": false, + "pull_request": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/pulls/2", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2", + "diff_url": "https://github.com/vince-riv/argo-diff/pull/2.diff", + "patch_url": "https://github.com/vince-riv/argo-diff/pull/2.patch", + "merged_at": null + }, + "body": "Test PR", + "reactions": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments/1915439564", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2#issuecomment-1915439564", + "issue_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2", + "id": 1915439564, + "node_id": "IC_kwDOKoDcU85yK0nM", + "user": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2024-01-29T19:45:38Z", + "updated_at": "2024-01-29T19:45:38Z", + "author_association": "CONTRIBUTOR", + "body": "argo diff", + "reactions": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments/1915439564/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + "repository": { + "id": 713088083, + "node_id": "R_kgDOKoDcUw", + "name": "argo-diff", + "full_name": "vince-riv/argo-diff", + "private": false, + "owner": { + "login": "vince-riv", + "id": 133395678, + "node_id": "O_kgDOB_N03g", + "avatar_url": "https://avatars.githubusercontent.com/u/133395678?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vince-riv", + "html_url": "https://github.com/vince-riv", + "followers_url": "https://api.github.com/users/vince-riv/followers", + "following_url": "https://api.github.com/users/vince-riv/following{/other_user}", + "gists_url": "https://api.github.com/users/vince-riv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vince-riv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vince-riv/subscriptions", + "organizations_url": "https://api.github.com/users/vince-riv/orgs", + "repos_url": "https://api.github.com/users/vince-riv/repos", + "events_url": "https://api.github.com/users/vince-riv/events{/privacy}", + "received_events_url": "https://api.github.com/users/vince-riv/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/vince-riv/argo-diff", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/vince-riv/argo-diff", + "forks_url": "https://api.github.com/repos/vince-riv/argo-diff/forks", + "keys_url": "https://api.github.com/repos/vince-riv/argo-diff/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/vince-riv/argo-diff/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/vince-riv/argo-diff/teams", + "hooks_url": "https://api.github.com/repos/vince-riv/argo-diff/hooks", + "issue_events_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/events{/number}", + "events_url": "https://api.github.com/repos/vince-riv/argo-diff/events", + "assignees_url": "https://api.github.com/repos/vince-riv/argo-diff/assignees{/user}", + "branches_url": "https://api.github.com/repos/vince-riv/argo-diff/branches{/branch}", + "tags_url": "https://api.github.com/repos/vince-riv/argo-diff/tags", + "blobs_url": "https://api.github.com/repos/vince-riv/argo-diff/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/vince-riv/argo-diff/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/vince-riv/argo-diff/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/vince-riv/argo-diff/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/vince-riv/argo-diff/statuses/{sha}", + "languages_url": "https://api.github.com/repos/vince-riv/argo-diff/languages", + "stargazers_url": "https://api.github.com/repos/vince-riv/argo-diff/stargazers", + "contributors_url": "https://api.github.com/repos/vince-riv/argo-diff/contributors", + "subscribers_url": "https://api.github.com/repos/vince-riv/argo-diff/subscribers", + "subscription_url": "https://api.github.com/repos/vince-riv/argo-diff/subscription", + "commits_url": "https://api.github.com/repos/vince-riv/argo-diff/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/vince-riv/argo-diff/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/vince-riv/argo-diff/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/vince-riv/argo-diff/contents/{+path}", + "compare_url": "https://api.github.com/repos/vince-riv/argo-diff/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/vince-riv/argo-diff/merges", + "archive_url": "https://api.github.com/repos/vince-riv/argo-diff/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/vince-riv/argo-diff/downloads", + "issues_url": "https://api.github.com/repos/vince-riv/argo-diff/issues{/number}", + "pulls_url": "https://api.github.com/repos/vince-riv/argo-diff/pulls{/number}", + "milestones_url": "https://api.github.com/repos/vince-riv/argo-diff/milestones{/number}", + "notifications_url": "https://api.github.com/repos/vince-riv/argo-diff/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/vince-riv/argo-diff/labels{/name}", + "releases_url": "https://api.github.com/repos/vince-riv/argo-diff/releases{/id}", + "deployments_url": "https://api.github.com/repos/vince-riv/argo-diff/deployments", + "created_at": "2023-11-01T20:14:12Z", + "updated_at": "2023-12-22T23:36:07Z", + "pushed_at": "2024-01-29T19:30:48Z", + "git_url": "git://github.com/vince-riv/argo-diff.git", + "ssh_url": "git@github.com:vince-riv/argo-diff.git", + "clone_url": "https://github.com/vince-riv/argo-diff.git", + "svn_url": "https://github.com/vince-riv/argo-diff", + "homepage": null, + "size": 875, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + + ], + "visibility": "public", + "forks": 1, + "open_issues": 8, + "watchers": 1, + "default_branch": "main", + "custom_properties": { + + } + }, + "organization": { + "login": "vince-riv", + "id": 133395678, + "node_id": "O_kgDOB_N03g", + "url": "https://api.github.com/orgs/vince-riv", + "repos_url": "https://api.github.com/orgs/vince-riv/repos", + "events_url": "https://api.github.com/orgs/vince-riv/events", + "hooks_url": "https://api.github.com/orgs/vince-riv/hooks", + "issues_url": "https://api.github.com/orgs/vince-riv/issues", + "members_url": "https://api.github.com/orgs/vince-riv/members{/member}", + "public_members_url": "https://api.github.com/orgs/vince-riv/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/133395678?v=4", + "description": "" + }, + "sender": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/internal/webhook/webhook_testdata/payload-comment-created.json b/internal/webhook/webhook_testdata/payload-comment-created.json new file mode 100644 index 0000000..b6c524c --- /dev/null +++ b/internal/webhook/webhook_testdata/payload-comment-created.json @@ -0,0 +1,264 @@ +{ + "action": "created", + "issue": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2", + "repository_url": "https://api.github.com/repos/vince-riv/argo-diff", + "labels_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/labels{/name}", + "comments_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/comments", + "events_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/events", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2", + "id": 2104330119, + "node_id": "PR_kwDOKoDcU85lQ5yq", + "number": 2, + "title": "feat: support installation via Github app", + "user": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + }, + "labels": [ + + ], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [ + + ], + "milestone": null, + "comments": 2, + "created_at": "2024-01-28T20:13:20Z", + "updated_at": "2024-01-29T19:45:39Z", + "closed_at": null, + "author_association": "CONTRIBUTOR", + "active_lock_reason": null, + "draft": false, + "pull_request": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/pulls/2", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2", + "diff_url": "https://github.com/vince-riv/argo-diff/pull/2.diff", + "patch_url": "https://github.com/vince-riv/argo-diff/pull/2.patch", + "merged_at": null + }, + "body": "Test PR", + "reactions": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "timeline_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2/timeline", + "performed_via_github_app": null, + "state_reason": null + }, + "comment": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments/1915439564", + "html_url": "https://github.com/vince-riv/argo-diff/pull/2#issuecomment-1915439564", + "issue_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/2", + "id": 1915439564, + "node_id": "IC_kwDOKoDcU85yK0nM", + "user": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + }, + "created_at": "2024-01-29T19:45:38Z", + "updated_at": "2024-01-29T19:45:38Z", + "author_association": "CONTRIBUTOR", + "body": "Test comment", + "reactions": { + "url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments/1915439564/reactions", + "total_count": 0, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 0, + "rocket": 0, + "eyes": 0 + }, + "performed_via_github_app": null + }, + "repository": { + "id": 713088083, + "node_id": "R_kgDOKoDcUw", + "name": "argo-diff", + "full_name": "vince-riv/argo-diff", + "private": false, + "owner": { + "login": "vince-riv", + "id": 133395678, + "node_id": "O_kgDOB_N03g", + "avatar_url": "https://avatars.githubusercontent.com/u/133395678?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vince-riv", + "html_url": "https://github.com/vince-riv", + "followers_url": "https://api.github.com/users/vince-riv/followers", + "following_url": "https://api.github.com/users/vince-riv/following{/other_user}", + "gists_url": "https://api.github.com/users/vince-riv/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vince-riv/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vince-riv/subscriptions", + "organizations_url": "https://api.github.com/users/vince-riv/orgs", + "repos_url": "https://api.github.com/users/vince-riv/repos", + "events_url": "https://api.github.com/users/vince-riv/events{/privacy}", + "received_events_url": "https://api.github.com/users/vince-riv/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/vince-riv/argo-diff", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/vince-riv/argo-diff", + "forks_url": "https://api.github.com/repos/vince-riv/argo-diff/forks", + "keys_url": "https://api.github.com/repos/vince-riv/argo-diff/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/vince-riv/argo-diff/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/vince-riv/argo-diff/teams", + "hooks_url": "https://api.github.com/repos/vince-riv/argo-diff/hooks", + "issue_events_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/events{/number}", + "events_url": "https://api.github.com/repos/vince-riv/argo-diff/events", + "assignees_url": "https://api.github.com/repos/vince-riv/argo-diff/assignees{/user}", + "branches_url": "https://api.github.com/repos/vince-riv/argo-diff/branches{/branch}", + "tags_url": "https://api.github.com/repos/vince-riv/argo-diff/tags", + "blobs_url": "https://api.github.com/repos/vince-riv/argo-diff/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/vince-riv/argo-diff/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/vince-riv/argo-diff/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/vince-riv/argo-diff/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/vince-riv/argo-diff/statuses/{sha}", + "languages_url": "https://api.github.com/repos/vince-riv/argo-diff/languages", + "stargazers_url": "https://api.github.com/repos/vince-riv/argo-diff/stargazers", + "contributors_url": "https://api.github.com/repos/vince-riv/argo-diff/contributors", + "subscribers_url": "https://api.github.com/repos/vince-riv/argo-diff/subscribers", + "subscription_url": "https://api.github.com/repos/vince-riv/argo-diff/subscription", + "commits_url": "https://api.github.com/repos/vince-riv/argo-diff/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/vince-riv/argo-diff/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/vince-riv/argo-diff/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/vince-riv/argo-diff/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/vince-riv/argo-diff/contents/{+path}", + "compare_url": "https://api.github.com/repos/vince-riv/argo-diff/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/vince-riv/argo-diff/merges", + "archive_url": "https://api.github.com/repos/vince-riv/argo-diff/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/vince-riv/argo-diff/downloads", + "issues_url": "https://api.github.com/repos/vince-riv/argo-diff/issues{/number}", + "pulls_url": "https://api.github.com/repos/vince-riv/argo-diff/pulls{/number}", + "milestones_url": "https://api.github.com/repos/vince-riv/argo-diff/milestones{/number}", + "notifications_url": "https://api.github.com/repos/vince-riv/argo-diff/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/vince-riv/argo-diff/labels{/name}", + "releases_url": "https://api.github.com/repos/vince-riv/argo-diff/releases{/id}", + "deployments_url": "https://api.github.com/repos/vince-riv/argo-diff/deployments", + "created_at": "2023-11-01T20:14:12Z", + "updated_at": "2023-12-22T23:36:07Z", + "pushed_at": "2024-01-29T19:30:48Z", + "git_url": "git://github.com/vince-riv/argo-diff.git", + "ssh_url": "git@github.com:vince-riv/argo-diff.git", + "clone_url": "https://github.com/vince-riv/argo-diff.git", + "svn_url": "https://github.com/vince-riv/argo-diff", + "homepage": null, + "size": 875, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Go", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 8, + "license": { + "key": "apache-2.0", + "name": "Apache License 2.0", + "spdx_id": "Apache-2.0", + "url": "https://api.github.com/licenses/apache-2.0", + "node_id": "MDc6TGljZW5zZTI=" + }, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [ + + ], + "visibility": "public", + "forks": 1, + "open_issues": 8, + "watchers": 1, + "default_branch": "main", + "custom_properties": { + + } + }, + "organization": { + "login": "vince-riv", + "id": 133395678, + "node_id": "O_kgDOB_N03g", + "url": "https://api.github.com/orgs/vince-riv", + "repos_url": "https://api.github.com/orgs/vince-riv/repos", + "events_url": "https://api.github.com/orgs/vince-riv/events", + "hooks_url": "https://api.github.com/orgs/vince-riv/hooks", + "issues_url": "https://api.github.com/orgs/vince-riv/issues", + "members_url": "https://api.github.com/orgs/vince-riv/members{/member}", + "public_members_url": "https://api.github.com/orgs/vince-riv/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/133395678?v=4", + "description": "" + }, + "sender": { + "login": "vrivellino", + "id": 1489368, + "node_id": "MDQ6VXNlcjE0ODkzNjg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1489368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vrivellino", + "html_url": "https://github.com/vrivellino", + "followers_url": "https://api.github.com/users/vrivellino/followers", + "following_url": "https://api.github.com/users/vrivellino/following{/other_user}", + "gists_url": "https://api.github.com/users/vrivellino/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vrivellino/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vrivellino/subscriptions", + "organizations_url": "https://api.github.com/users/vrivellino/orgs", + "repos_url": "https://api.github.com/users/vrivellino/repos", + "events_url": "https://api.github.com/users/vrivellino/events{/privacy}", + "received_events_url": "https://api.github.com/users/vrivellino/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/post-local.sh b/post-local.sh index 88c0f43..a902edd 100755 --- a/post-local.sh +++ b/post-local.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash curl -v -X POST \ - --header @temp/curl-headers.txt \ - --data @temp/curl-payload.json \ + --header @temp/curl-comment-headers.txt \ + --data @temp/curl-comment-payload.json \ http://127.0.0.1:8080/webhook