Commit 9ed59ee9f00ec31564f4f1f069f1cdcc7d78281b

Authored by Marin Jankovski
1 parent 1073019d

Include project_id in webhook payload.

app/services/git_push_service.rb
@@ -112,6 +112,7 @@ class GitPushService @@ -112,6 +112,7 @@ class GitPushService
112 # ref: String, 112 # ref: String,
113 # user_id: String, 113 # user_id: String,
114 # user_name: String, 114 # user_name: String,
  115 + # project_id: String,
115 # repository: { 116 # repository: {
116 # name: String, 117 # name: String,
117 # url: String, 118 # url: String,
@@ -136,6 +137,7 @@ class GitPushService @@ -136,6 +137,7 @@ class GitPushService
136 ref: ref, 137 ref: ref,
137 user_id: user.id, 138 user_id: user.id,
138 user_name: user.name, 139 user_name: user.name,
  140 + project_id: project.id,
139 repository: { 141 repository: {
140 name: project.name, 142 name: project.name,
141 url: project.url_to_repo, 143 url: project.url_to_repo,
app/views/projects/hooks/_data_ex.html.erb
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "ref": "refs/heads/master", 5 "ref": "refs/heads/master",
6 "user_id": 4, 6 "user_id": 4,
7 "user_name": "John Smith", 7 "user_name": "John Smith",
  8 + "project_id": 15,
8 "repository": { 9 "repository": {
9 "name": "Diaspora", 10 "name": "Diaspora",
10 "url": "git@localhost:diaspora.git", 11 "url": "git@localhost:diaspora.git",
spec/services/git_push_service_spec.rb
@@ -26,6 +26,7 @@ describe GitPushService do @@ -26,6 +26,7 @@ describe GitPushService do
26 it { should include(ref: @ref) } 26 it { should include(ref: @ref) }
27 it { should include(user_id: user.id) } 27 it { should include(user_id: user.id) }
28 it { should include(user_name: user.name) } 28 it { should include(user_name: user.name) }
  29 + it { should include(project_id: project.id) }
29 30
30 context "with repository data" do 31 context "with repository data" do
31 subject { @push_data[:repository] } 32 subject { @push_data[:repository] }