-
![]()
+
{{ user.login }} Admin
diff --git a/doc/swagger.yml b/doc/swagger.yml
index 729d5c4c1..e02c63695 100644
--- a/doc/swagger.yml
+++ b/doc/swagger.yml
@@ -812,7 +812,7 @@ definitions:
{
"login": "Octocat",
"email": "octocat@github.com",
- "avatar": "7194e8d48fa1d2b689f99443b767316c",
+ "avatar_url": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
"admin": false,
"active": true
}
@@ -821,7 +821,7 @@ definitions:
type: string
email:
type: string
- avatar:
+ avatar_url:
type: string
admin:
type: boolean
@@ -929,6 +929,7 @@ definitions:
"head_commit": {
"sha": "d101ef3ed6e973b039c3fd5ccdec378b0fa8684c",
"ref": "refs\/heads\/master",
+ "link_url": "https:\/\/github.com\/drone\/drone\/commit\/d101ef3ed6",
"branch": "master",
"message": "updated the README.md file",
"timestamp": "",
diff --git a/pkg/remote/builtin/github/github.go b/pkg/remote/builtin/github/github.go
index 4829565fc..7876a60b8 100644
--- a/pkg/remote/builtin/github/github.go
+++ b/pkg/remote/builtin/github/github.go
@@ -302,7 +302,7 @@ func (g *GitHub) push(r *http.Request) (*common.Hook, error) {
return nil, nil
}
- return &common.Hook{Repo: repo, Commit: commit}, nil
+ return &common.Hook{Event: "push", Repo: repo, Commit: commit}, nil
}
// ¯\_(ツ)_/¯
@@ -385,7 +385,7 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) {
// Author.Login
// Author.Email
- return &common.Hook{Repo: repo, Commit: c, PullRequest: pr}, nil
+ return &common.Hook{Event: "pull_request", Repo: repo, Commit: c, PullRequest: pr}, nil
}
type pushHook struct {
diff --git a/pkg/remote/builtin/gitlab/gitlab.go b/pkg/remote/builtin/gitlab/gitlab.go
index c100d21c2..1244f6268 100644
--- a/pkg/remote/builtin/gitlab/gitlab.go
+++ b/pkg/remote/builtin/gitlab/gitlab.go
@@ -256,7 +256,7 @@ func (g *Gitlab) Hook(req *http.Request) (*common.Hook, error) {
func mergeRequest(parsed *gogitlab.HookPayload, req *http.Request) (*common.Hook, error) {
var hook = new(common.Hook)
-
+ hook.Event = "pull_request"
hook.Repo = &common.Repo{}
hook.Repo.Owner = req.FormValue("owner")
hook.Repo.Name = req.FormValue("name")
@@ -295,6 +295,7 @@ func push(parsed *gogitlab.HookPayload, req *http.Request) (*common.Hook, error)
var cloneUrl = parsed.Repository.GitHttpUrl
var hook = new(common.Hook)
+ hook.Event = "push"
hook.Repo = &common.Repo{}
hook.Repo.Owner = req.FormValue("owner")
hook.Repo.Name = req.FormValue("name")
diff --git a/pkg/types/build.go b/pkg/types/build.go
index 18882fc41..26e67eb7c 100644
--- a/pkg/types/build.go
+++ b/pkg/types/build.go
@@ -11,8 +11,9 @@ const (
type Build struct {
ID int64
- RepoID int64 `json:"-" sql:"unique:ux_build_number,index:ix_build_repo_id"`
+ RepoID int64 `json:"id" sql:"unique:ux_build_number,index:ix_build_repo_id"`
Number int `json:"number" sql:"unique:ux_build_number"`
+ Event string `json:"event"`
Status string `json:"status"`
Started int64 `json:"started_at"`
Finished int64 `json:"finished_at"`
@@ -26,14 +27,14 @@ type Build struct {
type PullRequest struct {
Number int `json:"number,omitempty"`
Title string `json:"title,omitempty"`
- Link string `json:"link,omitempty"`
+ Link string `json:"link_url,omitempty"`
Base *Commit `json:"base_commit,omitempty"`
}
type Commit struct {
Sha string `json:"sha"`
Ref string `json:"ref"`
- Link string `json:"link,omitempty"`
+ Link string `json:"link_url,omitempty"`
Branch string `json:"branch" sql:"index:ix_commit_branch"`
Message string `json:"message"`
Timestamp string `json:"timestamp,omitempty"`
diff --git a/pkg/types/hook.go b/pkg/types/hook.go
index 042cc1a80..12678bd21 100644
--- a/pkg/types/hook.go
+++ b/pkg/types/hook.go
@@ -1,6 +1,7 @@
package types
type Hook struct {
+ Event string
Repo *Repo
Commit *Commit
PullRequest *PullRequest
diff --git a/pkg/types/repo.go b/pkg/types/repo.go
index d028e761f..dd1e7b8d1 100644
--- a/pkg/types/repo.go
+++ b/pkg/types/repo.go
@@ -6,7 +6,7 @@ type Repo struct {
Owner string `json:"owner" sql:"unique:ux_repo_owner_name"`
Name string `json:"name" sql:"unique:ux_repo_owner_name"`
FullName string `json:"full_name" sql:"unique:ux_repo_full_name"`
- Avatar string `json:"avatar"`
+ Avatar string `json:"avatar_url"`
Self string `json:"self_url"`
Link string `json:"link_url"`
Clone string `json:"clone_url"`
diff --git a/pkg/types/status.go b/pkg/types/status.go
index f147e4d2d..780f57a31 100644
--- a/pkg/types/status.go
+++ b/pkg/types/status.go
@@ -1,10 +1,10 @@
package types
type Status struct {
- ID int64 `meddler:"status_id,pk" json:"-"`
- CommitID int64 `meddler:"commit_id" json:"-"`
- State string `meddler:"status_state" json:"state"`
- Link string `meddler:"status_link" json:"target_url"`
- Desc string `meddler:"status_desc" json:"description"`
- Context string `meddler:"status_context" json:"context"`
+ ID int64 `json:"-"`
+ CommitID int64 `json:"-"`
+ State string `json:"status"`
+ Link string `json:"target_url"`
+ Desc string `json:"description"`
+ Context string `json:"context"`
}
diff --git a/pkg/types/user.go b/pkg/types/user.go
index 9c043dbc5..4d0594471 100644
--- a/pkg/types/user.go
+++ b/pkg/types/user.go
@@ -6,7 +6,7 @@ type User struct {
Token string `json:"-"`
Secret string `json:"-"`
Email string `json:"email,omitempty"`
- Avatar string `json:"avatar,omitempty"`
+ Avatar string `json:"avatar_url,omitempty"`
Active bool `json:"active,omitempty"`
Admin bool `json:"admin,omitempty"`