Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9aa2cb58
Commit
9aa2cb58
authored
Aug 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0c28a7c8
c7d12e60
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
9 deletions
+33
-9
app/services/git/base_hooks_service.rb
app/services/git/base_hooks_service.rb
+12
-7
changelogs/unreleased/sh-fix-pipelines-not-being-created.yml
changelogs/unreleased/sh-fix-pipelines-not-being-created.yml
+5
-0
lib/gitlab/data_builder/push.rb
lib/gitlab/data_builder/push.rb
+0
-2
spec/services/git/branch_push_service_spec.rb
spec/services/git/branch_push_service_spec.rb
+16
-0
No files found.
app/services/git/base_hooks_service.rb
View file @
9aa2cb58
...
...
@@ -56,7 +56,7 @@ module Git
return
unless
params
.
fetch
(
:create_pipelines
,
true
)
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
bas
e_params
)
.
new
(
project
,
current_user
,
pipelin
e_params
)
.
execute
(
:push
,
pipeline_options
)
end
...
...
@@ -75,24 +75,29 @@ module Git
ProjectCacheWorker
.
perform_async
(
project
.
id
,
file_types
,
[],
false
)
end
def
bas
e_params
def
pipelin
e_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
...
...
changelogs/unreleased/sh-fix-pipelines-not-being-created.yml
0 → 100644
View file @
9aa2cb58
---
title
:
Fix pipelines not always being created after a push
merge_request
:
31927
author
:
type
:
fixed
lib/gitlab/data_builder/push.rb
View file @
9aa2cb58
...
...
@@ -129,8 +129,6 @@ module Gitlab
SAMPLE_DATA
end
private
def
checkout_sha
(
repository
,
newrev
,
ref
)
# Checkout sha is nil when we remove branch or tag
return
if
Gitlab
::
Git
.
blank_ref?
(
newrev
)
...
...
spec/services/git/branch_push_service_spec.rb
View file @
9aa2cb58
...
...
@@ -76,6 +76,22 @@ describe Git::BranchPushService, services: true do
stub_ci_pipeline_to_return_yaml_file
end
it
'creates a pipeline with the right parameters'
do
expect
(
Ci
::
CreatePipelineService
)
.
to
receive
(
:new
)
.
with
(
project
,
user
,
{
before:
oldrev
,
after:
newrev
,
ref:
ref
,
checkout_sha:
SeedRepo
::
Commit
::
ID
,
push_options:
{}
}).
and_call_original
subject
end
it
"creates a new pipeline"
do
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment