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
d17cce6a
Commit
d17cce6a
authored
Apr 03, 2019
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only execute system hooks once when pushing tags
parent
645303c7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
app/services/git/tag_push_service.rb
app/services/git/tag_push_service.rb
+0
-12
changelogs/unreleased/52560-fix-duplicate-tag-system-hooks.yml
...elogs/unreleased/52560-fix-duplicate-tag-system-hooks.yml
+5
-0
spec/services/git/tag_push_service_spec.rb
spec/services/git/tag_push_service_spec.rb
+14
-0
No files found.
app/services/git/tag_push_service.rb
View file @
d17cce6a
...
@@ -13,7 +13,6 @@ module Git
...
@@ -13,7 +13,6 @@ module Git
EventCreateService
.
new
.
push
(
project
,
current_user
,
push_data
)
EventCreateService
.
new
.
push
(
project
,
current_user
,
push_data
)
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
push_data
).
execute
(
:push
,
pipeline_options
)
Ci
::
CreatePipelineService
.
new
(
project
,
current_user
,
push_data
).
execute
(
:push
,
pipeline_options
)
SystemHooksService
.
new
.
execute_hooks
(
build_system_push_data
,
:tag_push_hooks
)
project
.
execute_hooks
(
push_data
.
dup
,
:tag_push_hooks
)
project
.
execute_hooks
(
push_data
.
dup
,
:tag_push_hooks
)
project
.
execute_services
(
push_data
.
dup
,
:tag_push_hooks
)
project
.
execute_services
(
push_data
.
dup
,
:tag_push_hooks
)
...
@@ -50,17 +49,6 @@ module Git
...
@@ -50,17 +49,6 @@ module Git
push_options:
params
[
:push_options
]
||
[])
push_options:
params
[
:push_options
]
||
[])
end
end
def
build_system_push_data
Gitlab
::
DataBuilder
::
Push
.
build
(
project
,
current_user
,
params
[
:oldrev
],
params
[
:newrev
],
params
[
:ref
],
[],
''
)
end
def
pipeline_options
def
pipeline_options
{}
# to be overridden in EE
{}
# to be overridden in EE
end
end
...
...
changelogs/unreleased/52560-fix-duplicate-tag-system-hooks.yml
0 → 100644
View file @
d17cce6a
---
title
:
Only execute system hooks once when pushing tags
merge_request
:
26888
author
:
type
:
fixed
spec/services/git/tag_push_service_spec.rb
View file @
d17cce6a
...
@@ -31,6 +31,20 @@ describe Git::TagPushService do
...
@@ -31,6 +31,20 @@ describe Git::TagPushService do
end
end
end
end
describe
'System Hooks'
do
let!
(
:push_data
)
{
service
.
tap
(
&
:execute
).
push_data
}
it
"executes system hooks after pushing a tag"
do
expect_next_instance_of
(
SystemHooksService
)
do
|
system_hooks_service
|
expect
(
system_hooks_service
)
.
to
receive
(
:execute_hooks
)
.
with
(
push_data
,
:tag_push_hooks
)
end
service
.
execute
end
end
describe
"Pipelines"
do
describe
"Pipelines"
do
subject
{
service
.
execute
}
subject
{
service
.
execute
}
...
...
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