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
0de8dccd
Commit
0de8dccd
authored
Mar 16, 2017
by
billy.lb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when system hook for deploy key
parent
4a81867d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+4
-5
changelogs/unreleased/bugfix-systemhook.yml
changelogs/unreleased/bugfix-systemhook.yml
+4
-0
spec/services/system_hooks_service_spec.rb
spec/services/system_hooks_service_spec.rb
+3
-0
No files found.
app/services/system_hooks_service.rb
View file @
0de8dccd
...
@@ -24,10 +24,9 @@ class SystemHooksService
...
@@ -24,10 +24,9 @@ class SystemHooksService
key:
model
.
key
,
key:
model
.
key
,
id:
model
.
id
id:
model
.
id
)
)
if
model
.
user
if
model
.
user
data
.
merge!
(
data
[
:username
]
=
model
.
user
.
username
username:
model
.
user
.
username
)
end
end
when
Project
when
Project
data
.
merge!
(
project_data
(
model
))
data
.
merge!
(
project_data
(
model
))
...
@@ -35,8 +34,6 @@ class SystemHooksService
...
@@ -35,8 +34,6 @@ class SystemHooksService
if
event
==
:rename
||
event
==
:transfer
if
event
==
:rename
||
event
==
:transfer
data
[
:old_path_with_namespace
]
=
model
.
old_path_with_namespace
data
[
:old_path_with_namespace
]
=
model
.
old_path_with_namespace
end
end
data
when
User
when
User
data
.
merge!
({
data
.
merge!
({
name:
model
.
name
,
name:
model
.
name
,
...
@@ -59,6 +56,8 @@ class SystemHooksService
...
@@ -59,6 +56,8 @@ class SystemHooksService
when
GroupMember
when
GroupMember
data
.
merge!
(
group_member_data
(
model
))
data
.
merge!
(
group_member_data
(
model
))
end
end
data
end
end
def
build_event_name
(
model
,
event
)
def
build_event_name
(
model
,
event
)
...
...
changelogs/unreleased/bugfix-systemhook.yml
0 → 100644
View file @
0de8dccd
---
title
:
Fix bug when system hook for deploy key
merge_request
:
9796
author
:
billy.lb
spec/services/system_hooks_service_spec.rb
View file @
0de8dccd
...
@@ -5,6 +5,7 @@ describe SystemHooksService, services: true do
...
@@ -5,6 +5,7 @@ describe SystemHooksService, services: true do
let
(
:project
)
{
create
:project
}
let
(
:project
)
{
create
:project
}
let
(
:project_member
)
{
create
:project_member
}
let
(
:project_member
)
{
create
:project_member
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:deploy_key
)
{
create
(
:key
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:group_member
)
{
create
(
:group_member
)
}
let
(
:group_member
)
{
create
(
:group_member
)
}
...
@@ -18,6 +19,8 @@ describe SystemHooksService, services: true do
...
@@ -18,6 +19,8 @@ describe SystemHooksService, services: true do
it
{
expect
(
event_data
(
project_member
,
:destroy
)).
to
include
(
:event_name
,
:created_at
,
:updated_at
,
:project_name
,
:project_path
,
:project_path_with_namespace
,
:project_id
,
:user_name
,
:user_username
,
:user_email
,
:user_id
,
:access_level
,
:project_visibility
)
}
it
{
expect
(
event_data
(
project_member
,
:destroy
)).
to
include
(
:event_name
,
:created_at
,
:updated_at
,
:project_name
,
:project_path
,
:project_path_with_namespace
,
:project_id
,
:user_name
,
:user_username
,
:user_email
,
:user_id
,
:access_level
,
:project_visibility
)
}
it
{
expect
(
event_data
(
key
,
:create
)).
to
include
(
:username
,
:key
,
:id
)
}
it
{
expect
(
event_data
(
key
,
:create
)).
to
include
(
:username
,
:key
,
:id
)
}
it
{
expect
(
event_data
(
key
,
:destroy
)).
to
include
(
:username
,
:key
,
:id
)
}
it
{
expect
(
event_data
(
key
,
:destroy
)).
to
include
(
:username
,
:key
,
:id
)
}
it
{
expect
(
event_data
(
deploy_key
,
:create
)).
to
include
(
:key
,
:id
)
}
it
{
expect
(
event_data
(
deploy_key
,
:destroy
)).
to
include
(
:key
,
:id
)
}
it
do
it
do
project
.
old_path_with_namespace
=
'renamed_from_path'
project
.
old_path_with_namespace
=
'renamed_from_path'
...
...
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