From 9ed59ee9f00ec31564f4f1f069f1cdcc7d78281b Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 14 Oct 2013 12:03:25 +0200 Subject: [PATCH] Include project_id in webhook payload. --- app/services/git_push_service.rb | 2 ++ app/views/projects/hooks/_data_ex.html.erb | 1 + spec/services/git_push_service_spec.rb | 1 + 3 files changed, 4 insertions(+), 0 deletions(-) diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index f9d43e6..3ad41de 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -112,6 +112,7 @@ class GitPushService # ref: String, # user_id: String, # user_name: String, + # project_id: String, # repository: { # name: String, # url: String, @@ -136,6 +137,7 @@ class GitPushService ref: ref, user_id: user.id, user_name: user.name, + project_id: project.id, repository: { name: project.name, url: project.url_to_repo, diff --git a/app/views/projects/hooks/_data_ex.html.erb b/app/views/projects/hooks/_data_ex.html.erb index b4281fa..5092aaf 100644 --- a/app/views/projects/hooks/_data_ex.html.erb +++ b/app/views/projects/hooks/_data_ex.html.erb @@ -5,6 +5,7 @@ "ref": "refs/heads/master", "user_id": 4, "user_name": "John Smith", + "project_id": 15, "repository": { "name": "Diaspora", "url": "git@localhost:diaspora.git", diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index e3c25fa..2870f59 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -26,6 +26,7 @@ describe GitPushService do it { should include(ref: @ref) } it { should include(user_id: user.id) } it { should include(user_name: user.name) } + it { should include(project_id: project.id) } context "with repository data" do subject { @push_data[:repository] } -- libgit2 0.21.2