summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-08-19 04:25:54 +0000
committer🤖 GitLab Bot 🤖 <gitlab-bot@gitlab.com>2019-08-19 05:19:56 +0000
commita30e9d1438320bc83d99c86103482fa79fd5d005 (patch)
tree24cead21660b7e9f959f3850ecd88e068105cbdf /app
parent29ed66a688409c50b9320481739a099485c30b5f (diff)
downloadgitlab-ce-a30e9d1438320bc83d99c86103482fa79fd5d005.tar.gz
Merge branch 'sh-fix-pipelines-not-being-created' into 'master'
Fix pipelines not always being created after a push Closes #66196 See merge request gitlab-org/gitlab-ce!31927 (cherry picked from commit c7d12e602120bc0ec801b9696c7ac344dda10fc4) b46b9d5e Fix pipelines not always being created after a push
Diffstat (limited to 'app')
-rw-r--r--app/services/git/base_hooks_service.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb
index 3fd38444196..47c308c8280 100644
--- a/app/services/git/base_hooks_service.rb
+++ b/app/services/git/base_hooks_service.rb
@@ -56,7 +56,7 @@ module Git
return unless params.fetch(:create_pipelines, true)
Ci::CreatePipelineService
- .new(project, current_user, base_params)
+ .new(project, current_user, pipeline_params)
.execute(:push, pipeline_options)
end
@@ -75,24 +75,29 @@ module Git
ProjectCacheWorker.perform_async(project.id, file_types, [], false)
end
- def base_params
+ def pipeline_params
{
- oldrev: params[:oldrev],
- newrev: params[:newrev],
+ before: params[:oldrev],
+ after: params[:newrev],
ref: params[:ref],
- push_options: params[:push_options] || {}
+ push_options: params[:push_options] || {},
+ checkout_sha: Gitlab::DataBuilder::Push.checkout_sha(
+ project.repository, params[:newrev], params[:ref])
}
end
def push_data_params(commits:, with_changed_files: true)
- base_params.merge(
+ {
+ oldrev: params[:oldrev],
+ newrev: params[:newrev],
+ ref: params[:ref],
project: project,
user: current_user,
commits: commits,
message: event_message,
commits_count: commits_count,
with_changed_files: with_changed_files
- )
+ }
end
def event_push_data