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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
dada25d4
Commit
dada25d4
authored
Jan 07, 2016
by
Tommy Beadle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include the username in user_create/destroy system hooks.
parent
fc386b65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+2
-1
doc/system_hooks/system_hooks.md
doc/system_hooks/system_hooks.md
+2
-0
spec/services/system_hooks_service_spec.rb
spec/services/system_hooks_service_spec.rb
+2
-2
No files found.
app/services/system_hooks_service.rb
View file @
dada25d4
...
...
@@ -47,7 +47,8 @@ class SystemHooksService
data
.
merge!
({
name:
model
.
name
,
email:
model
.
email
,
user_id:
model
.
id
user_id:
model
.
id
,
username:
model
.
username
})
when
ProjectMember
data
.
merge!
(
project_member_data
(
model
))
...
...
doc/system_hooks/system_hooks.md
View file @
dada25d4
...
...
@@ -129,6 +129,7 @@ X-Gitlab-Event: System Hook
"email"
:
"js@gitlabhq.com"
,
"event_name"
:
"user_create"
,
"name"
:
"John Smith"
,
"username"
:
"js"
,
"user_id"
:
41
}
```
...
...
@@ -142,6 +143,7 @@ X-Gitlab-Event: System Hook
"email"
:
"js@gitlabhq.com"
,
"event_name"
:
"user_destroy"
,
"name"
:
"John Smith"
,
"username"
:
"js"
,
"user_id"
:
41
}
```
...
...
spec/services/system_hooks_service_spec.rb
View file @
dada25d4
...
...
@@ -9,8 +9,8 @@ describe SystemHooksService, services: true do
let
(
:group_member
)
{
create
(
:group_member
)
}
context
'event data'
do
it
{
expect
(
event_data
(
user
,
:create
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:email
,
:user_id
)
}
it
{
expect
(
event_data
(
user
,
:destroy
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:email
,
:user_id
)
}
it
{
expect
(
event_data
(
user
,
:create
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:email
,
:user_id
,
:username
)
}
it
{
expect
(
event_data
(
user
,
:destroy
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:email
,
:user_id
,
:username
)
}
it
{
expect
(
event_data
(
project
,
:create
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:owner_name
,
:owner_email
,
:project_visibility
)
}
it
{
expect
(
event_data
(
project
,
:destroy
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:owner_name
,
:owner_email
,
:project_visibility
)
}
it
{
expect
(
event_data
(
project_member
,
:create
)).
to
include
(
:event_name
,
:created_at
,
:updated_at
,
:project_name
,
:project_path
,
:project_path_with_namespace
,
:project_id
,
:user_name
,
:user_email
,
:access_level
,
:project_visibility
)
}
...
...
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