Compare commits

...

41 Commits

Author SHA1 Message Date
Anton Krivenko 59fb74817c Update README.md 2021-01-05 02:33:20 +03:00
Anton Krivenko aa941874be Merge pull request #115 from yinxulai/v5
Add changes field in to IssuesPayload and  IssueCommentPayload of Github
2021-01-05 02:31:45 +03:00
Anton Krivenko bfd950a988 Merge branch 'v5' into v5 2021-01-04 22:39:52 +03:00
Anton Krivenko 9d685f3a73 Merge pull request #106 from wrewolf/patch-1
Added support draft pull request for github
2021-01-04 22:37:19 +03:00
Anton Krivenko 1f42c84783 Merge pull request #122 from DrMagPie/v5
Added missing field
2021-01-04 22:36:10 +03:00
Aleksey Andreyanov ee81f21da7 Add correct X-Hub-Signature for PullRequestEvent test 2020-12-08 14:49:12 +03:00
Dr.MagPie 03cee75fc3 Updated Signature 2020-12-08 00:23:31 +02:00
Dr.MagPie 86c24d8570 added missing field 2020-12-07 23:56:48 +02:00
Anton Krivenko 30fb8f885f Merge pull request #114 from takirala/tga/add-labels-support
gitlab: Add labels array in MergeRequestEventPayload
2020-11-10 23:20:39 +03:00
Anton Krivenko 957d07ee07 Update .travis.yml (#120) 2020-11-10 08:54:38 +03:00
yinxulai a5ce17cac3 format .travis.yaml 2020-07-23 11:29:49 +08:00
yinxulai efae47c3b9 add changes field in to IssuesPayload and IssueCommentPayload of GitHub. 2020-07-23 10:15:12 +08:00
Anton Krivenko b616136c50 Merge pull request #111 from aritas1/v5
handle gitlab system hook inconsistencies
2020-07-17 19:00:12 +03:00
Anton Krivenko 303483bff4 Merge pull request #112 from chhsia0/bitbucketserver-pr-from-ref-updated
Bitbucket Server: Add support for `pr:from_ref_updated` event.
2020-07-17 18:59:46 +03:00
Tarun Gupta Akirala 4156f32687 gitlab: Add labels array in MergeRequestEventPayload 2020-07-14 20:50:27 -07:00
aritas1 b03dc868a0 update system hooks to handle event_name fields 2020-05-31 01:37:42 +02:00
Daniel 9f0c3ac5d7 add system hook example data for merge request 2020-05-31 01:13:00 +02:00
Daniel f4ad678f8e add a system tag push example 2020-05-31 01:11:22 +02:00
Daniel a23062206a add a system push example 2020-05-31 01:10:33 +02:00
chhsia0 7c046447e2 Added support for Bitbucket server pr:from_ref_updated event. 2020-05-27 19:55:08 -07:00
Anton Krivenko 7a4edfce55 Merge pull request #108 from yinxulai/v5
add changes field in to PullRequestPayload of GitHub.
2020-05-02 17:14:57 +03:00
Anton Krivenko bb49f714ae Merge pull request #103 from spacelift-io/v5
Add missing ID for Project
2020-05-02 17:13:22 +03:00
yinxulai 260e9b3afd restructuring 2020-04-28 09:57:19 +08:00
yinxulai e01b0fd664 supplementary annotation 2020-04-28 09:54:53 +08:00
yinxulai ef305446ee add changes field in to GitHub PullRequestPayload. 2020-04-28 09:47:11 +08:00
Grzegorz Korzeniowski 743f78a93d Add missing UserUsername in TagEventPayload 2020-04-15 15:23:23 +02:00
Grzegorz Korzeniowski a4dc35a54d Add missing UserUsername in PushEventPayload 2020-04-09 15:14:43 +02:00
Aleksey Andreyanov 9a9f42e1b8 Added support draft pull request for github 2020-04-05 20:19:13 +03:00
Marcin Wyszynski cc63869891 Add missing ID for Project 2020-03-30 14:52:52 +02:00
Dean Karn cb4aa3d145 Merge pull request #96 from chhsia0/github-pr-comment
Added supported for GitHub pull request comments.
2019-11-11 12:54:33 -08:00
Dean Karn 334436bcc5 Merge pull request #97 from Toshik1978/v5
Fixed pipeline hook for GitLab >= 12.3
2019-11-11 12:53:47 -08:00
chhsia0 3007a7f5c2 Added supported for GitHub pull request comments. 2019-10-26 10:00:18 -07:00
Anton Krivenko f248671aae Fixed pipeline hook for GitLab >= 12.3 2019-09-28 23:17:57 +03:00
Dean Karn 2845fba51e Update README.md 2019-08-24 09:41:18 -07:00
Dean Karn e1f5ba4c3a Merge pull request #88 from luca-moser/github-meta-event
Adds GitHub meta event/payload
2019-08-24 09:31:05 -07:00
Dean Karn ef903a2448 Merge branch 'v5' into github-meta-event 2019-08-24 09:22:16 -07:00
Dean Karn 115b7e49a5 Merge pull request #87 from pavelgnom/v5
Add `Installation` to the `ReleasePayload`
2019-08-24 09:10:12 -07:00
Dean Karn 9ce6db7e53 Merge pull request #86 from BlizzTom/v5
Adding support for github event integration_installation_repositories
2019-08-24 09:00:14 -07:00
Luca Moser dc7efa3fa7 adds GitHub meta event/payload 2019-08-24 11:28:48 +02:00
Pavel Herasimau c3faee81c0 add installation to release payload 2019-08-21 17:41:58 +03:00
Tom Anderson 26af15f0e6 Adding support for event integration_installation_repositories 2019-08-01 14:15:31 -07:00
17 changed files with 802 additions and 84 deletions
+8 -8
View File
@@ -1,16 +1,16 @@
language: go language: go
go: go:
- 1.12.1 - 1.13.15
- tip - tip
matrix: matrix:
allow_failures: allow_failures:
- go: tip - go: tip
notifications: notifications:
email: email:
recipients: dean.karn@gmail.com recipients: dean.karn@gmail.com
on_success: change on_success: change
on_failure: always on_failure: always
before_install: before_install:
- go get -u github.com/go-playground/overalls - go get -u github.com/go-playground/overalls
@@ -26,9 +26,9 @@ before_script:
- go get -t ./... - go get -t ./...
script: script:
- make test - make test
after_success: | after_success: |
[ $TRAVIS_GO_VERSION = 1.11.2 ] && [ $TRAVIS_GO_VERSION = 1.13.15 ] &&
overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,_examples,testdata -debug && overalls -project="github.com/go-playground/webhooks" -covermode=count -ignore=.git,_examples,testdata -debug &&
goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN goveralls -coverprofile=overalls.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
+1 -1
View File
@@ -1,6 +1,6 @@
Library webhooks Library webhooks
================ ================
<img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">![Project status](https://img.shields.io/badge/version-5.12.0-green.svg) <img align="right" src="https://raw.githubusercontent.com/go-playground/webhooks/v5/logo.png">![Project status](https://img.shields.io/badge/version-5.17.0-green.svg)
[![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v5)](https://travis-ci.org/go-playground/webhooks) [![Build Status](https://travis-ci.org/go-playground/webhooks.svg?branch=v5)](https://travis-ci.org/go-playground/webhooks)
[![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v5&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v5) [![Coverage Status](https://coveralls.io/repos/go-playground/webhooks/badge.svg?branch=v5&service=github)](https://coveralls.io/github/go-playground/webhooks?branch=v5)
[![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks) [![Go Report Card](https://goreportcard.com/badge/go-playground/webhooks)](https://goreportcard.com/report/go-playground/webhooks)
+10 -5
View File
@@ -32,11 +32,12 @@ const (
RepositoryCommentEditedEvent Event = "repo:comment:edited" RepositoryCommentEditedEvent Event = "repo:comment:edited"
RepositoryCommentDeletedEvent Event = "repo:comment:deleted" RepositoryCommentDeletedEvent Event = "repo:comment:deleted"
PullRequestOpenedEvent Event = "pr:opened" PullRequestOpenedEvent Event = "pr:opened"
PullRequestModifiedEvent Event = "pr:modified" PullRequestFromReferenceUpdatedEvent Event = "pr:from_ref_updated"
PullRequestMergedEvent Event = "pr:merged" PullRequestModifiedEvent Event = "pr:modified"
PullRequestDeclinedEvent Event = "pr:declined" PullRequestMergedEvent Event = "pr:merged"
PullRequestDeletedEvent Event = "pr:deleted" PullRequestDeclinedEvent Event = "pr:declined"
PullRequestDeletedEvent Event = "pr:deleted"
PullRequestReviewerUpdatedEvent Event = "pr:reviewer:updated" PullRequestReviewerUpdatedEvent Event = "pr:reviewer:updated"
PullRequestReviewerApprovedEvent Event = "pr:reviewer:approved" PullRequestReviewerApprovedEvent Event = "pr:reviewer:approved"
@@ -168,6 +169,10 @@ func (hook *Webhook) Parse(r *http.Request, events ...Event) (interface{}, error
var pl PullRequestOpenedPayload var pl PullRequestOpenedPayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
return pl, err return pl, err
case PullRequestFromReferenceUpdatedEvent:
var pl PullRequestFromReferenceUpdatedPayload
err = json.Unmarshal([]byte(payload), &pl)
return pl, err
case PullRequestModifiedEvent: case PullRequestModifiedEvent:
var pl PullRequestModifiedPayload var pl PullRequestModifiedPayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
+8
View File
@@ -66,6 +66,14 @@ type PullRequestOpenedPayload struct {
PullRequest PullRequest `json:"pullRequest"` PullRequest PullRequest `json:"pullRequest"`
} }
type PullRequestFromReferenceUpdatedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
PreviousFromHash string `json:"previousFromHash"`
}
type PullRequestModifiedPayload struct { type PullRequestModifiedPayload struct {
Date Date `json:"date"` Date Date `json:"date"`
EventKey Event `json:"eventKey"` EventKey Event `json:"eventKey"`
+45 -39
View File
@@ -28,44 +28,46 @@ type Event string
// GitHub hook types // GitHub hook types
const ( const (
CheckRunEvent Event = "check_run" CheckRunEvent Event = "check_run"
CheckSuiteEvent Event = "check_suite" CheckSuiteEvent Event = "check_suite"
CommitCommentEvent Event = "commit_comment" CommitCommentEvent Event = "commit_comment"
CreateEvent Event = "create" CreateEvent Event = "create"
DeleteEvent Event = "delete" DeleteEvent Event = "delete"
DeploymentEvent Event = "deployment" DeploymentEvent Event = "deployment"
DeploymentStatusEvent Event = "deployment_status" DeploymentStatusEvent Event = "deployment_status"
ForkEvent Event = "fork" ForkEvent Event = "fork"
GollumEvent Event = "gollum" GollumEvent Event = "gollum"
InstallationEvent Event = "installation" InstallationEvent Event = "installation"
InstallationRepositoriesEvent Event = "installation_repositories" InstallationRepositoriesEvent Event = "installation_repositories"
IntegrationInstallationEvent Event = "integration_installation" IntegrationInstallationEvent Event = "integration_installation"
IssueCommentEvent Event = "issue_comment" IntegrationInstallationRepositoriesEvent Event = "integration_installation_repositories"
IssuesEvent Event = "issues" IssueCommentEvent Event = "issue_comment"
LabelEvent Event = "label" IssuesEvent Event = "issues"
MemberEvent Event = "member" LabelEvent Event = "label"
MembershipEvent Event = "membership" MemberEvent Event = "member"
MilestoneEvent Event = "milestone" MembershipEvent Event = "membership"
OrganizationEvent Event = "organization" MilestoneEvent Event = "milestone"
OrgBlockEvent Event = "org_block" MetaEvent Event = "meta"
PageBuildEvent Event = "page_build" OrganizationEvent Event = "organization"
PingEvent Event = "ping" OrgBlockEvent Event = "org_block"
ProjectCardEvent Event = "project_card" PageBuildEvent Event = "page_build"
ProjectColumnEvent Event = "project_column" PingEvent Event = "ping"
ProjectEvent Event = "project" ProjectCardEvent Event = "project_card"
PublicEvent Event = "public" ProjectColumnEvent Event = "project_column"
PullRequestEvent Event = "pull_request" ProjectEvent Event = "project"
PullRequestReviewEvent Event = "pull_request_review" PublicEvent Event = "public"
PullRequestReviewCommentEvent Event = "pull_request_review_comment" PullRequestEvent Event = "pull_request"
PushEvent Event = "push" PullRequestReviewEvent Event = "pull_request_review"
ReleaseEvent Event = "release" PullRequestReviewCommentEvent Event = "pull_request_review_comment"
RepositoryEvent Event = "repository" PushEvent Event = "push"
RepositoryVulnerabilityAlertEvent Event = "repository_vulnerability_alert" ReleaseEvent Event = "release"
SecurityAdvisoryEvent Event = "security_advisory" RepositoryEvent Event = "repository"
StatusEvent Event = "status" RepositoryVulnerabilityAlertEvent Event = "repository_vulnerability_alert"
TeamEvent Event = "team" SecurityAdvisoryEvent Event = "security_advisory"
TeamAddEvent Event = "team_add" StatusEvent Event = "status"
WatchEvent Event = "watch" TeamEvent Event = "team"
TeamAddEvent Event = "team_add"
WatchEvent Event = "watch"
) )
// EventSubtype defines a GitHub Hook Event subtype // EventSubtype defines a GitHub Hook Event subtype
@@ -206,7 +208,7 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
var pl InstallationPayload var pl InstallationPayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
return pl, err return pl, err
case InstallationRepositoriesEvent: case InstallationRepositoriesEvent, IntegrationInstallationRepositoriesEvent:
var pl InstallationRepositoriesPayload var pl InstallationRepositoriesPayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
return pl, err return pl, err
@@ -230,6 +232,10 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
var pl MembershipPayload var pl MembershipPayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
return pl, err return pl, err
case MetaEvent:
var pl MetaPayload
err = json.Unmarshal([]byte(payload), &pl)
return pl, err
case MilestoneEvent: case MilestoneEvent:
var pl MilestonePayload var pl MilestonePayload
err = json.Unmarshal([]byte(payload), &pl) err = json.Unmarshal([]byte(payload), &pl)
+22 -2
View File
@@ -253,6 +253,16 @@ func TestWebhooks(t *testing.T) {
"X-Hub-Signature": []string{"sha1=bb2769f05f1a11af3a1edf8f9fac11bae7402a1e"}, "X-Hub-Signature": []string{"sha1=bb2769f05f1a11af3a1edf8f9fac11bae7402a1e"},
}, },
}, },
{
name: "IntegrationInstallationRepositoriesEvent",
event: IntegrationInstallationRepositoriesEvent,
typ: InstallationRepositoriesPayload{},
filename: "../testdata/github/integration-installation-repositories.json",
headers: http.Header{
"X-Github-Event": []string{"integration_installation_repositories"},
"X-Hub-Signature": []string{"sha1=2f00a982574188342c2894eb9d1b1e93434687fb"},
},
},
{ {
name: "IssueCommentEvent", name: "IssueCommentEvent",
event: IssueCommentEvent, event: IssueCommentEvent,
@@ -263,6 +273,16 @@ func TestWebhooks(t *testing.T) {
"X-Hub-Signature": []string{"sha1=e724c9f811fcf5f511aac32e4251b08ab1a0fd87"}, "X-Hub-Signature": []string{"sha1=e724c9f811fcf5f511aac32e4251b08ab1a0fd87"},
}, },
}, },
{
name: "PullRequestIssueCommentEvent",
event: IssueCommentEvent,
typ: IssueCommentPayload{},
filename: "../testdata/github/pull-request-issue-comment.json",
headers: http.Header{
"X-Github-Event": []string{"issue_comment"},
"X-Hub-Signature": []string{"sha1=6c969b99ef881b5c98b2dbfc66a34465fcf0e7d4"},
},
},
{ {
name: "IssuesEvent", name: "IssuesEvent",
event: IssuesEvent, event: IssuesEvent,
@@ -360,7 +380,7 @@ func TestWebhooks(t *testing.T) {
filename: "../testdata/github/project-card.json", filename: "../testdata/github/project-card.json",
headers: http.Header{ headers: http.Header{
"X-Github-Event": []string{"project_card"}, "X-Github-Event": []string{"project_card"},
"X-Hub-Signature": []string{"sha1=495dec0d6449d16b71f2ddcd37d595cb9b04b1d8"}, "X-Hub-Signature": []string{"sha1=f5ed1572b04f0e03c8d5f5e3f7fa63737bef76d7"},
}, },
}, },
{ {
@@ -400,7 +420,7 @@ func TestWebhooks(t *testing.T) {
filename: "../testdata/github/pull-request.json", filename: "../testdata/github/pull-request.json",
headers: http.Header{ headers: http.Header{
"X-Github-Event": []string{"pull_request"}, "X-Github-Event": []string{"pull_request"},
"X-Hub-Signature": []string{"sha1=35712c8d2bc197b7d07621dcf20d2fb44620508f"}, "X-Hub-Signature": []string{"sha1=88972f972db301178aa13dafaf112d26416a15e6"},
}, },
}, },
{ {
+180 -17
View File
@@ -1614,16 +1614,22 @@ type IssueCommentPayload struct {
Color string `json:"color"` Color string `json:"color"`
Default bool `json:"default"` Default bool `json:"default"`
} `json:"labels"` } `json:"labels"`
State string `json:"state"` State string `json:"state"`
Locked bool `json:"locked"` Locked bool `json:"locked"`
Assignee *Assignee `json:"assignee"` Assignee *Assignee `json:"assignee"`
Assignees []*Assignee `json:"assignees"` Assignees []*Assignee `json:"assignees"`
Milestone *Milestone `json:"milestone"` Milestone *Milestone `json:"milestone"`
Comments int64 `json:"comments"` Comments int64 `json:"comments"`
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"` UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at"` ClosedAt *time.Time `json:"closed_at"`
Body string `json:"body"` PullRequest *struct {
URL string `json:"url"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
} `json:"pull_request"`
Body string `json:"body"`
} `json:"issue"` } `json:"issue"`
Comment struct { Comment struct {
URL string `json:"url"` URL string `json:"url"`
@@ -1656,6 +1662,11 @@ type IssueCommentPayload struct {
Body string `json:"body"` Body string `json:"body"`
AuthorAssociation string `json:"author_association"` AuthorAssociation string `json:"author_association"`
} `json:"comment"` } `json:"comment"`
Changes *struct {
Body *struct {
From string `json:"from"`
} `json:"body"`
} `json:"changes"`
Repository struct { Repository struct {
ID int64 `json:"id"` ID int64 `json:"id"`
NodeID string `json:"node_id"` NodeID string `json:"node_id"`
@@ -1820,6 +1831,14 @@ type IssuesPayload struct {
ClosedAt *time.Time `json:"closed_at"` ClosedAt *time.Time `json:"closed_at"`
Body string `json:"body"` Body string `json:"body"`
} `json:"issue"` } `json:"issue"`
Changes *struct {
Title *struct {
From string `json:"from"`
} `json:"title"`
Body *struct {
From string `json:"from"`
} `json:"body"`
} `json:"changes"`
Repository struct { Repository struct {
ID int64 `json:"id"` ID int64 `json:"id"`
NodeID string `json:"node_id"` NodeID string `json:"node_id"`
@@ -2271,6 +2290,137 @@ type MembershipPayload struct {
} `json:"organization"` } `json:"organization"`
} }
// MetaPayload contains the information for GitHub's meta hook event
type MetaPayload struct {
HookID int `json:"hook_id"`
Hook struct {
Type string `json:"type"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Name string `json:"name"`
Active bool `json:"active"`
Events []string `json:"events"`
AppID int `json:"app_id"`
Config struct {
ContentType string `json:"content_type"`
InsecureSSL string `json:"insecure_ssl"`
Secret string `json:"secret"`
URL string `json:"url"`
} `json:"config"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
} `json:"hook"`
Repository struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
Name string `json:"name"`
FullName string `json:"full_name"`
Owner struct {
Login string `json:"login"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
GravatarID string `json:"gravatar_id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
} `json:"owner"`
Private bool `json:"private"`
HTMLURL string `json:"html_url"`
Description string `json:"description"`
Fork bool `json:"fork"`
URL string `json:"url"`
ForksURL string `json:"forks_url"`
KeysURL string `json:"keys_url"`
CollaboratorsURL string `json:"collaborators_url"`
TeamsURL string `json:"teams_url"`
HooksURL string `json:"hooks_url"`
IssueEventsURL string `json:"issue_events_url"`
EventsURL string `json:"events_url"`
AssigneesURL string `json:"assignees_url"`
BranchesURL string `json:"branches_url"`
TagsURL string `json:"tags_url"`
BlobsURL string `json:"blobs_url"`
GitTagsURL string `json:"git_tags_url"`
GitRefsURL string `json:"git_refs_url"`
TreesURL string `json:"trees_url"`
StatusesURL string `json:"statuses_url"`
LanguagesURL string `json:"languages_url"`
StargazersURL string `json:"stargazers_url"`
ContributorsURL string `json:"contributors_url"`
SubscribersURL string `json:"subscribers_url"`
SubscriptionURL string `json:"subscription_url"`
CommitsURL string `json:"commits_url"`
GitCommitsURL string `json:"git_commits_url"`
CommentsURL string `json:"comments_url"`
IssueCommentURL string `json:"issue_comment_url"`
ContentsURL string `json:"contents_url"`
CompareURL string `json:"compare_url"`
MergesURL string `json:"merges_url"`
ArchiveURL string `json:"archive_url"`
DownloadsURL string `json:"downloads_url"`
IssuesURL string `json:"issues_url"`
PullsURL string `json:"pulls_url"`
MilestonesURL string `json:"milestones_url"`
NotificationsURL string `json:"notifications_url"`
LabelsURL string `json:"labels_url"`
ReleasesURL string `json:"releases_url"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
PushedAt time.Time `json:"pushed_at"`
GitURL string `json:"git_url"`
SSHURL string `json:"ssh_url"`
CloneURL string `json:"clone_url"`
SvnURL string `json:"svn_url"`
Homepage *string `json:"homepage"`
Size int64 `json:"size"`
StargazersCount int64 `json:"stargazers_count"`
WatchersCount int64 `json:"watchers_count"`
Language *string `json:"language"`
HasIssues bool `json:"has_issues"`
HasDownloads bool `json:"has_downloads"`
HasWiki bool `json:"has_wiki"`
HasPages bool `json:"has_pages"`
ForksCount int64 `json:"forks_count"`
MirrorURL *string `json:"mirror_url"`
OpenIssuesCount int64 `json:"open_issues_count"`
Forks int64 `json:"forks"`
OpenIssues int64 `json:"open_issues"`
Watchers int64 `json:"watchers"`
DefaultBranch string `json:"default_branch"`
} `json:"repository"`
Sender struct {
Login string `json:"login"`
ID int64 `json:"id"`
NodeID string `json:"node_id"`
AvatarURL string `json:"avatar_url"`
GravatarID string `json:"gravatar_id"`
URL string `json:"url"`
HTMLURL string `json:"html_url"`
FollowersURL string `json:"followers_url"`
FollowingURL string `json:"following_url"`
GistsURL string `json:"gists_url"`
StarredURL string `json:"starred_url"`
SubscriptionsURL string `json:"subscriptions_url"`
OrganizationsURL string `json:"organizations_url"`
ReposURL string `json:"repos_url"`
EventsURL string `json:"events_url"`
ReceivedEventsURL string `json:"received_events_url"`
Type string `json:"type"`
SiteAdmin bool `json:"site_admin"`
} `json:"sender"`
}
// MilestonePayload contains the information for GitHub's milestone hook event // MilestonePayload contains the information for GitHub's milestone hook event
type MilestonePayload struct { type MilestonePayload struct {
Action string `json:"action"` Action string `json:"action"`
@@ -2849,13 +2999,14 @@ type PingPayload struct {
type ProjectCardPayload struct { type ProjectCardPayload struct {
Action string `json:"action"` Action string `json:"action"`
ProjectCard struct { ProjectCard struct {
URL string `json:"url"` URL string `json:"url"`
ColumnURL string `json:"column_url"` ProjectURL string `json:"project_url"`
ColumnID int64 `json:"column_id"` ColumnURL string `json:"column_url"`
ID int64 `json:"id"` ColumnID int64 `json:"column_id"`
NodeID string `json:"node_id"` ID int64 `json:"id"`
Note *string `json:"note"` NodeID string `json:"node_id"`
Creator struct { Note *string `json:"note"`
Creator struct {
Login string `json:"login"` Login string `json:"login"`
ID int64 `json:"id"` ID int64 `json:"id"`
NodeID string `json:"node_id"` NodeID string `json:"node_id"`
@@ -3452,6 +3603,7 @@ type PullRequestPayload struct {
Assignee *Assignee `json:"assignee"` Assignee *Assignee `json:"assignee"`
Assignees []*Assignee `json:"assignees"` Assignees []*Assignee `json:"assignees"`
Milestone *Milestone `json:"milestone"` Milestone *Milestone `json:"milestone"`
Draft bool `json:"draft"`
CommitsURL string `json:"commits_url"` CommitsURL string `json:"commits_url"`
ReviewCommentsURL string `json:"review_comments_url"` ReviewCommentsURL string `json:"review_comments_url"`
ReviewCommentURL string `json:"review_comment_url"` ReviewCommentURL string `json:"review_comment_url"`
@@ -3869,6 +4021,14 @@ type PullRequestPayload struct {
Type string `json:"type"` Type string `json:"type"`
SiteAdmin bool `json:"site_admin"` SiteAdmin bool `json:"site_admin"`
} `json:"sender"` } `json:"sender"`
Changes *struct {
Title *struct {
From string `json:"from"`
} `json:"title"`
Body *struct {
From string `json:"from"`
} `json:"body"`
} `json:"changes"`
Assignee *Assignee `json:"assignee"` Assignee *Assignee `json:"assignee"`
RequestedReviewer *Assignee `json:"requested_reviewer"` RequestedReviewer *Assignee `json:"requested_reviewer"`
RequestedTeam struct { RequestedTeam struct {
@@ -5139,6 +5299,9 @@ type ReleasePayload struct {
Type string `json:"type"` Type string `json:"type"`
SiteAdmin bool `json:"site_admin"` SiteAdmin bool `json:"site_admin"`
} `json:"sender"` } `json:"sender"`
Installation struct {
ID int `json:"id"`
} `json:"installation"`
} }
// RepositoryPayload contains the information for GitHub's repository hook event // RepositoryPayload contains the information for GitHub's repository hook event
+10 -1
View File
@@ -191,7 +191,16 @@ func eventParsing(gitLabEvent Event, events []Event, payload []byte) (interface{
case objectMergeRequest: case objectMergeRequest:
return eventParsing(MergeRequestEvents, events, payload) return eventParsing(MergeRequestEvents, events, payload)
default: default:
return nil, fmt.Errorf("unknown system hook event %s", gitLabEvent) switch pl.EventName {
case objectPush:
return eventParsing(PushEvents, events, payload)
case objectTag:
return eventParsing(TagEvents, events, payload)
case objectMergeRequest:
return eventParsing(MergeRequestEvents, events, payload)
default:
return nil, fmt.Errorf("unknown system hook event %s", gitLabEvent)
}
} }
default: default:
return nil, fmt.Errorf("unknown event %s", gitLabEvent) return nil, fmt.Errorf("unknown event %s", gitLabEvent)
+3 -3
View File
@@ -286,19 +286,19 @@ func TestSystemHooks(t *testing.T) {
name: "PushEvent", name: "PushEvent",
event: PushEvents, event: PushEvents,
typ: PushEventPayload{}, typ: PushEventPayload{},
filename: "../testdata/gitlab/push-event.json", filename: "../testdata/gitlab/system-push-event.json",
}, },
{ {
name: "TagEvent", name: "TagEvent",
event: TagEvents, event: TagEvents,
typ: TagEventPayload{}, typ: TagEventPayload{},
filename: "../testdata/gitlab/tag-event.json", filename: "../testdata/gitlab/system-tag-event.json",
}, },
{ {
name: "MergeRequestEvent", name: "MergeRequestEvent",
event: MergeRequestEvents, event: MergeRequestEvents,
typ: MergeRequestEventPayload{}, typ: MergeRequestEventPayload{},
filename: "../testdata/gitlab/merge-request-event.json", filename: "../testdata/gitlab/system-merge-request-event.json",
}, },
} }
for _, tt := range tests { for _, tt := range tests {
+26 -6
View File
@@ -56,6 +56,7 @@ type MergeRequestEventPayload struct {
Changes Changes `json:"changes"` Changes Changes `json:"changes"`
Project Project `json:"project"` Project Project `json:"project"`
Repository Repository `json:"repository"` Repository Repository `json:"repository"`
Labels []Label `json:"labels"`
} }
// PushEventPayload contains the information for GitLab's push event // PushEventPayload contains the information for GitLab's push event
@@ -67,6 +68,7 @@ type PushEventPayload struct {
CheckoutSHA string `json:"checkout_sha"` CheckoutSHA string `json:"checkout_sha"`
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
UserUsername string `json:"user_username"`
UserEmail string `json:"user_email"` UserEmail string `json:"user_email"`
UserAvatar string `json:"user_avatar"` UserAvatar string `json:"user_avatar"`
ProjectID int64 `json:"project_id"` ProjectID int64 `json:"project_id"`
@@ -85,6 +87,7 @@ type TagEventPayload struct {
CheckoutSHA string `json:"checkout_sha"` CheckoutSHA string `json:"checkout_sha"`
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
UserUsername string `json:"user_username"`
UserAvatar string `json:"user_avatar"` UserAvatar string `json:"user_avatar"`
ProjectID int64 `json:"project_id"` ProjectID int64 `json:"project_id"`
Project Project `json:"Project"` Project Project `json:"Project"`
@@ -104,12 +107,12 @@ type WikiPageEventPayload struct {
// PipelineEventPayload contains the information for GitLab's pipeline status change event // PipelineEventPayload contains the information for GitLab's pipeline status change event
type PipelineEventPayload struct { type PipelineEventPayload struct {
ObjectKind string `json:"object_kind"` ObjectKind string `json:"object_kind"`
User User `json:"user"` User User `json:"user"`
Project Project `json:"project"` Project Project `json:"project"`
Commit Commit `json:"commit"` Commit Commit `json:"commit"`
ObjectAttributes ObjectAttributes `json:"object_attributes"` ObjectAttributes PipelineObjectAttributes `json:"object_attributes"`
Jobs []Job `json:"jobs"` Jobs []Job `json:"jobs"`
} }
// CommentEventPayload contains the information for GitLab's comment event // CommentEventPayload contains the information for GitLab's comment event
@@ -174,6 +177,7 @@ type JobEventPayload struct {
// SystemHookPayload contains the ObjectKind to match with real hook events // SystemHookPayload contains the ObjectKind to match with real hook events
type SystemHookPayload struct { type SystemHookPayload struct {
ObjectKind string `json:"object_kind"` ObjectKind string `json:"object_kind"`
EventName string `json:"event_name"`
} }
// Issue contains all of the GitLab issue information // Issue contains all of the GitLab issue information
@@ -281,6 +285,7 @@ type User struct {
// Project contains all of the GitLab project information // Project contains all of the GitLab project information
type Project struct { type Project struct {
ID int64 `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Description string `json:"description"` Description string `json:"description"`
WebURL string `json:"web_url"` WebURL string `json:"web_url"`
@@ -356,6 +361,21 @@ type ObjectAttributes struct {
Assignee Assignee `json:"assignee"` Assignee Assignee `json:"assignee"`
} }
// PipelineObjectAttributes contains pipeline specific GitLab object attributes information
type PipelineObjectAttributes struct {
ID int64 `json:"id"`
Ref string `json:"ref"`
Tag bool `json:"tag"`
SHA string `json:"sha"`
BeforeSHA string `json:"before_sha"`
Source string `json:"source"`
Status string `json:"status"`
Stages []string `json:"stages"`
CreatedAt customTime `json:"created_at"`
FinishedAt customTime `json:"finished_at"`
Duration int64 `json:"duration"`
}
// Position defines a specific location, identified by paths line numbers and // Position defines a specific location, identified by paths line numbers and
// image coordinates, within a specific diff, identified by start, head and // image coordinates, within a specific diff, identified by start, head and
// base commit ids. // base commit ids.
@@ -0,0 +1,75 @@
{
"action": "removed",
"installation": {
"id": 2,
"account": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"repository_selection": "selected",
"access_tokens_url": "https://api.github.com/installations/2/access_tokens",
"repositories_url": "https://api.github.com/installation/repositories",
"html_url": "https://github.com/settings/installations/2",
"app_id": 5725,
"target_id": 3880403,
"target_type": "User",
"permissions": {
"metadata": "read",
"contents": "read",
"issues": "write"
},
"events": [
"push",
"pull_request"
],
"created_at": 1525109898,
"updated_at": 1525109899,
"single_file_name": "config.yml"
},
"repository_selection": "selected",
"repositories_added": [],
"repositories_removed": [
{
"id": 1296269,
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"private": false
}
],
"sender": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
}
+2 -1
View File
@@ -2,6 +2,7 @@
"action": "created", "action": "created",
"project_card": { "project_card": {
"url": "https://api.github.com/projects/columns/cards/1266091", "url": "https://api.github.com/projects/columns/cards/1266091",
"project_url": "https://api.github.com/projects/6047634",
"column_url": "https://api.github.com/projects/columns/515520", "column_url": "https://api.github.com/projects/columns/515520",
"column_id": 515520, "column_id": 515520,
"id": 1266091, "id": 1266091,
@@ -27,7 +28,7 @@
}, },
"created_at": 1483569391, "created_at": 1483569391,
"updated_at": 1483569391, "updated_at": 1483569391,
"content_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2" "content_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/2"
}, },
"repository": { "repository": {
"id": 35129377, "id": 35129377,
+208
View File
@@ -0,0 +1,208 @@
{
"action": "created",
"issue": {
"url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/3",
"repository_url": "https://api.github.com/repos/chhsia0/knative-route-demo",
"labels_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/3/labels{/name}",
"comments_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/3/comments",
"events_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/3/events",
"html_url": "https://github.com/chhsia0/knative-route-demo/pull/3",
"id": 494965988,
"node_id": "MDExOlB1bGxSZXF1ZXN0MzE4NjEwOTI3",
"number": 3,
"title": "Updated to v2.",
"user": {
"login": "chhsia0",
"id": 4643017,
"node_id": "MDQ6VXNlcjQ2NDMwMTc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/4643017?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chhsia0",
"html_url": "https://github.com/chhsia0",
"followers_url": "https://api.github.com/users/chhsia0/followers",
"following_url": "https://api.github.com/users/chhsia0/following{/other_user}",
"gists_url": "https://api.github.com/users/chhsia0/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chhsia0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chhsia0/subscriptions",
"organizations_url": "https://api.github.com/users/chhsia0/orgs",
"repos_url": "https://api.github.com/users/chhsia0/repos",
"events_url": "https://api.github.com/users/chhsia0/events{/privacy}",
"received_events_url": "https://api.github.com/users/chhsia0/received_events",
"type": "User",
"site_admin": false
},
"labels": [
],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [
],
"milestone": null,
"comments": 17,
"created_at": "2019-09-18T03:28:04Z",
"updated_at": "2019-10-26T16:09:23Z",
"closed_at": null,
"author_association": "OWNER",
"pull_request": {
"url": "https://api.github.com/repos/chhsia0/knative-route-demo/pulls/3",
"html_url": "https://github.com/chhsia0/knative-route-demo/pull/3",
"diff_url": "https://github.com/chhsia0/knative-route-demo/pull/3.diff",
"patch_url": "https://github.com/chhsia0/knative-route-demo/pull/3.patch"
},
"body": ""
},
"comment": {
"url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/comments/546616131",
"html_url": "https://github.com/chhsia0/knative-route-demo/pull/3#issuecomment-546616131",
"issue_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/3",
"id": 546616131,
"node_id": "MDEyOklzc3VlQ29tbWVudDU0NjYxNjEzMQ==",
"user": {
"login": "chhsia0",
"id": 4643017,
"node_id": "MDQ6VXNlcjQ2NDMwMTc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/4643017?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chhsia0",
"html_url": "https://github.com/chhsia0",
"followers_url": "https://api.github.com/users/chhsia0/followers",
"following_url": "https://api.github.com/users/chhsia0/following{/other_user}",
"gists_url": "https://api.github.com/users/chhsia0/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chhsia0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chhsia0/subscriptions",
"organizations_url": "https://api.github.com/users/chhsia0/orgs",
"repos_url": "https://api.github.com/users/chhsia0/repos",
"events_url": "https://api.github.com/users/chhsia0/events{/privacy}",
"received_events_url": "https://api.github.com/users/chhsia0/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2019-10-26T16:09:23Z",
"updated_at": "2019-10-26T16:09:23Z",
"author_association": "OWNER",
"body": "/build"
},
"repository": {
"id": 199540710,
"node_id": "MDEwOlJlcG9zaXRvcnkxOTk1NDA3MTA=",
"name": "knative-route-demo",
"full_name": "chhsia0/knative-route-demo",
"private": false,
"owner": {
"login": "chhsia0",
"id": 4643017,
"node_id": "MDQ6VXNlcjQ2NDMwMTc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/4643017?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chhsia0",
"html_url": "https://github.com/chhsia0",
"followers_url": "https://api.github.com/users/chhsia0/followers",
"following_url": "https://api.github.com/users/chhsia0/following{/other_user}",
"gists_url": "https://api.github.com/users/chhsia0/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chhsia0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chhsia0/subscriptions",
"organizations_url": "https://api.github.com/users/chhsia0/orgs",
"repos_url": "https://api.github.com/users/chhsia0/repos",
"events_url": "https://api.github.com/users/chhsia0/events{/privacy}",
"received_events_url": "https://api.github.com/users/chhsia0/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/chhsia0/knative-route-demo",
"description": "Simple knative route demo",
"fork": true,
"url": "https://api.github.com/repos/chhsia0/knative-route-demo",
"forks_url": "https://api.github.com/repos/chhsia0/knative-route-demo/forks",
"keys_url": "https://api.github.com/repos/chhsia0/knative-route-demo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/chhsia0/knative-route-demo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/chhsia0/knative-route-demo/teams",
"hooks_url": "https://api.github.com/repos/chhsia0/knative-route-demo/hooks",
"issue_events_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/events{/number}",
"events_url": "https://api.github.com/repos/chhsia0/knative-route-demo/events",
"assignees_url": "https://api.github.com/repos/chhsia0/knative-route-demo/assignees{/user}",
"branches_url": "https://api.github.com/repos/chhsia0/knative-route-demo/branches{/branch}",
"tags_url": "https://api.github.com/repos/chhsia0/knative-route-demo/tags",
"blobs_url": "https://api.github.com/repos/chhsia0/knative-route-demo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/chhsia0/knative-route-demo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/chhsia0/knative-route-demo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/chhsia0/knative-route-demo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/chhsia0/knative-route-demo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/chhsia0/knative-route-demo/languages",
"stargazers_url": "https://api.github.com/repos/chhsia0/knative-route-demo/stargazers",
"contributors_url": "https://api.github.com/repos/chhsia0/knative-route-demo/contributors",
"subscribers_url": "https://api.github.com/repos/chhsia0/knative-route-demo/subscribers",
"subscription_url": "https://api.github.com/repos/chhsia0/knative-route-demo/subscription",
"commits_url": "https://api.github.com/repos/chhsia0/knative-route-demo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/chhsia0/knative-route-demo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/chhsia0/knative-route-demo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/chhsia0/knative-route-demo/contents/{+path}",
"compare_url": "https://api.github.com/repos/chhsia0/knative-route-demo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/chhsia0/knative-route-demo/merges",
"archive_url": "https://api.github.com/repos/chhsia0/knative-route-demo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/chhsia0/knative-route-demo/downloads",
"issues_url": "https://api.github.com/repos/chhsia0/knative-route-demo/issues{/number}",
"pulls_url": "https://api.github.com/repos/chhsia0/knative-route-demo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/chhsia0/knative-route-demo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/chhsia0/knative-route-demo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/chhsia0/knative-route-demo/labels{/name}",
"releases_url": "https://api.github.com/repos/chhsia0/knative-route-demo/releases{/id}",
"deployments_url": "https://api.github.com/repos/chhsia0/knative-route-demo/deployments",
"created_at": "2019-07-29T23:38:07Z",
"updated_at": "2019-10-01T18:07:59Z",
"pushed_at": "2019-10-23T23:49:38Z",
"git_url": "git://github.com/chhsia0/knative-route-demo.git",
"ssh_url": "git@github.com:chhsia0/knative-route-demo.git",
"clone_url": "https://github.com/chhsia0/knative-route-demo.git",
"svn_url": "https://github.com/chhsia0/knative-route-demo",
"homepage": "",
"size": 59,
"stargazers_count": 0,
"watchers_count": 0,
"language": "Go",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": false,
"has_pages": true,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 3,
"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="
},
"forks": 0,
"open_issues": 3,
"watchers": 0,
"default_branch": "master"
},
"sender": {
"login": "chhsia0",
"id": 4643017,
"node_id": "MDQ6VXNlcjQ2NDMwMTc=",
"avatar_url": "https://avatars0.githubusercontent.com/u/4643017?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/chhsia0",
"html_url": "https://github.com/chhsia0",
"followers_url": "https://api.github.com/users/chhsia0/followers",
"following_url": "https://api.github.com/users/chhsia0/following{/other_user}",
"gists_url": "https://api.github.com/users/chhsia0/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chhsia0/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chhsia0/subscriptions",
"organizations_url": "https://api.github.com/users/chhsia0/orgs",
"repos_url": "https://api.github.com/users/chhsia0/repos",
"events_url": "https://api.github.com/users/chhsia0/events{/privacy}",
"received_events_url": "https://api.github.com/users/chhsia0/received_events",
"type": "User",
"site_admin": false
}
}
+1
View File
@@ -39,6 +39,7 @@
"merge_commit_sha": null, "merge_commit_sha": null,
"assignee": null, "assignee": null,
"milestone": null, "milestone": null,
"draft": false,
"commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits", "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/commits",
"review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments", "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/1/comments",
"review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}", "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}",
+114
View File
@@ -0,0 +1,114 @@
{
"object_kind": "merge_request",
"user": {
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon"
},
"project": {
"name": "Example",
"description": "",
"web_url": "http://example.com/jsmith/example",
"avatar_url": null,
"git_ssh_url": "git@example.com:jsmith/example.git",
"git_http_url": "http://example.com/jsmith/example.git",
"namespace": "Jsmith",
"visibility_level": 0,
"path_with_namespace": "jsmith/example",
"default_branch": "master",
"ci_config_path": "",
"homepage": "http://example.com/jsmith/example",
"url": "git@example.com:jsmith/example.git",
"ssh_url": "git@example.com:jsmith/example.git",
"http_url": "http://example.com/jsmith/example.git"
},
"object_attributes": {
"id": 90,
"target_branch": "master",
"source_branch": "ms-viewport",
"source_project_id": 14,
"author_id": 51,
"assignee_id": 6,
"title": "MS-Viewport",
"created_at": "2017-09-20T08:31:45.944Z",
"updated_at": "2017-09-28T12:23:42.365Z",
"milestone_id": null,
"state": "opened",
"merge_status": "unchecked",
"target_project_id": 14,
"iid": 1,
"description": "",
"updated_by_id": 1,
"merge_error": null,
"merge_params": {
"force_remove_source_branch": "0"
},
"merge_when_pipeline_succeeds": false,
"merge_user_id": null,
"merge_commit_sha": null,
"deleted_at": null,
"in_progress_merge_commit_sha": null,
"lock_version": 5,
"time_estimate": 0,
"last_edited_at": "2017-09-27T12:43:37.558Z",
"last_edited_by_id": 1,
"head_pipeline_id": 61,
"ref_fetched": true,
"merge_jid": null,
"source": {
"name": "Awesome Project",
"description": "",
"web_url": "http://example.com/awesome_space/awesome_project",
"avatar_url": null,
"git_ssh_url": "git@example.com:awesome_space/awesome_project.git",
"git_http_url": "http://example.com/awesome_space/awesome_project.git",
"namespace": "root",
"visibility_level": 0,
"path_with_namespace": "awesome_space/awesome_project",
"default_branch": "master",
"ci_config_path": "",
"homepage": "http://example.com/awesome_space/awesome_project",
"url": "http://example.com/awesome_space/awesome_project.git",
"ssh_url": "git@example.com:awesome_space/awesome_project.git",
"http_url": "http://example.com/awesome_space/awesome_project.git"
},
"target": {
"name": "Awesome Project",
"description": "Aut reprehenderit ut est.",
"web_url": "http://example.com/awesome_space/awesome_project",
"avatar_url": null,
"git_ssh_url": "git@example.com:awesome_space/awesome_project.git",
"git_http_url": "http://example.com/awesome_space/awesome_project.git",
"namespace": "Awesome Space",
"visibility_level": 0,
"path_with_namespace": "awesome_space/awesome_project",
"default_branch": "master",
"ci_config_path": "",
"homepage": "http://example.com/awesome_space/awesome_project",
"url": "http://example.com/awesome_space/awesome_project.git",
"ssh_url": "git@example.com:awesome_space/awesome_project.git",
"http_url": "http://example.com/awesome_space/awesome_project.git"
},
"last_commit": {
"id": "ba3e0d8ff79c80d5b0bbb4f3e2e343e0aaa662b7",
"message": "fixed readme",
"timestamp": "2017-09-26T16:12:57Z",
"url": "http://example.com/awesome_space/awesome_project/commits/da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"author": {
"name": "GitLab dev user",
"email": "gitlabdev@dv6700.(none)"
}
},
"work_in_progress": false,
"total_time_spent": 0,
"human_total_time_spent": null,
"human_time_estimate": null
},
"labels": null,
"repository": {
"name": "git-gpg-test",
"url": "git@example.com:awesome_space/awesome_project.git",
"description": "",
"homepage": "http://example.com/awesome_space/awesome_project"
}
}
+50
View File
@@ -0,0 +1,50 @@
{
"event_name": "push",
"before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
"after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"ref": "refs/heads/master",
"checkout_sha": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"user_id": 4,
"user_name": "John Smith",
"user_email": "john@example.com",
"user_avatar": "https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80",
"project_id": 15,
"project":{
"name":"Diaspora",
"description":"",
"web_url":"http://example.com/mike/diaspora",
"avatar_url":null,
"git_ssh_url":"git@example.com:mike/diaspora.git",
"git_http_url":"http://example.com/mike/diaspora.git",
"namespace":"Mike",
"visibility_level":0,
"path_with_namespace":"mike/diaspora",
"default_branch":"master",
"homepage":"http://example.com/mike/diaspora",
"url":"git@example.com:mike/diaspora.git",
"ssh_url":"git@example.com:mike/diaspora.git",
"http_url":"http://example.com/mike/diaspora.git"
},
"repository":{
"name": "Diaspora",
"url": "git@example.com:mike/diaspora.git",
"description": "",
"homepage": "http://example.com/mike/diaspora",
"git_http_url":"http://example.com/mike/diaspora.git",
"git_ssh_url":"git@example.com:mike/diaspora.git",
"visibility_level":0
},
"commits": [
{
"id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"message": "Add simple search to projects in public area",
"timestamp": "2013-05-13T18:18:08+00:00",
"url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428",
"author": {
"name": "Example User",
"email": "user@example.com"
}
}
],
"total_commits_count": 1
}
+38
View File
@@ -0,0 +1,38 @@
{
"event_name": "tag_push",
"before": "0000000000000000000000000000000000000000",
"after": "82b3d5ae55f7080f1e6022629cdb57bfae7cccc7",
"ref": "refs/tags/v1.0.0",
"checkout_sha": "5937ac0a7beb003549fc5fd26fc247adbce4a52e",
"user_id": 1,
"user_name": "John Smith",
"user_avatar": "https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80",
"project_id": 1,
"project":{
"name":"Example",
"description":"",
"web_url":"http://example.com/jsmith/example",
"avatar_url":null,
"git_ssh_url":"git@example.com:jsmith/example.git",
"git_http_url":"http://example.com/jsmith/example.git",
"namespace":"Jsmith",
"visibility_level":0,
"path_with_namespace":"jsmith/example",
"default_branch":"master",
"homepage":"http://example.com/jsmith/example",
"url":"git@example.com:jsmith/example.git",
"ssh_url":"git@example.com:jsmith/example.git",
"http_url":"http://example.com/jsmith/example.git"
},
"repository":{
"name": "Example",
"url": "ssh://git@example.com/jsmith/example.git",
"description": "",
"homepage": "http://example.com/jsmith/example",
"git_http_url":"http://example.com/jsmith/example.git",
"git_ssh_url":"git@example.com:jsmith/example.git",
"visibility_level":0
},
"commits": [],
"total_commits_count": 0
}