summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKirill Zaitsev <kirik910@gmail.com>2016-02-06 17:20:21 +0300
committerRémy Coutable <remy@rymai.me>2016-02-11 17:22:11 +0100
commitb123171d3da752c084ef7bfa82dbed962b3e5168 (patch)
tree8a31350c2d57776b6e174ccb03c2556b873a1bc4 /lib
parent9b1dfd3e81855c99b0ccb703d3aecc3f1a7ac7c9 (diff)
downloadgitlab-ce-b123171d3da752c084ef7bfa82dbed962b3e5168.tar.gz
Add new data to project in push, issue, merge-request and note webhooks databugagazavr/gitlab-ce-extend-hooks
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`, `path_with_namespace` and `default_branch` in `project` in push, issue, merge-request and note webhooks data - Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in favor of `git_http_url` in `project` for push, issue, merge-request and note webhooks data - Deprecate the `repository` key in push, issue, merge-request and note webhooks data, use `project` instead
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/note_data_builder.rb11
-rw-r--r--lib/gitlab/push_data_builder.rb16
2 files changed, 10 insertions, 17 deletions
diff --git a/lib/gitlab/note_data_builder.rb b/lib/gitlab/note_data_builder.rb
index ea6b0ee796d..71cf6a0d886 100644
--- a/lib/gitlab/note_data_builder.rb
+++ b/lib/gitlab/note_data_builder.rb
@@ -53,13 +53,10 @@ module Gitlab
object_kind: "note",
user: user.hook_attrs,
project_id: project.id,
- repository: {
- name: project.name,
- url: project.url_to_repo,
- description: project.description,
- homepage: project.web_url,
- },
- object_attributes: note.hook_attrs
+ project: project.hook_attrs,
+ object_attributes: note.hook_attrs,
+ # DEPRECATED
+ repository: project.hook_attrs.slice(:name, :url, :description, :homepage)
}
base_data[:object_attributes][:url] =
diff --git a/lib/gitlab/push_data_builder.rb b/lib/gitlab/push_data_builder.rb
index 4f9cdef3869..1dad621aa00 100644
--- a/lib/gitlab/push_data_builder.rb
+++ b/lib/gitlab/push_data_builder.rb
@@ -47,18 +47,14 @@ module Gitlab
user_id: user.id,
user_name: user.name,
user_email: user.email,
+ user_avatar: user.avatar_url,
project_id: project.id,
- repository: {
- name: project.name,
- url: project.url_to_repo,
- description: project.description,
- homepage: project.web_url,
- git_http_url: project.http_url_to_repo,
- git_ssh_url: project.ssh_url_to_repo,
- visibility_level: project.visibility_level
- },
+ project: project.hook_attrs,
commits: commit_attrs,
- total_commits_count: commits_count
+ total_commits_count: commits_count,
+ # DEPRECATED
+ repository: project.hook_attrs.slice(:name, :url, :description, :homepage,
+ :git_http_url, :git_ssh_url, :visibility_level)
}
data