BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
32a5b741
Unverified
Commit
32a5b741
authored
Jan 13, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add_username_to_user_system_hooks' of
https://github.com/tbeadle/gitlabhq
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parents
678ee247
1f64332e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
17 deletions
+26
-17
system_hooks_service.rb
app/services/system_hooks_service.rb
+4
-1
system_hooks.md
doc/system_hooks/system_hooks.md
+6
-0
system_hooks_service_spec.rb
spec/services/system_hooks_service_spec.rb
+16
-16
No files found.
app/services/system_hooks_service.rb
View file @
32a5b741
...
@@ -47,7 +47,8 @@ class SystemHooksService
...
@@ -47,7 +47,8 @@ class SystemHooksService
data
.
merge!
({
data
.
merge!
({
name:
model
.
name
,
name:
model
.
name
,
email:
model
.
email
,
email:
model
.
email
,
user_id:
model
.
id
user_id:
model
.
id
,
username:
model
.
username
})
})
when
ProjectMember
when
ProjectMember
data
.
merge!
(
project_member_data
(
model
))
data
.
merge!
(
project_member_data
(
model
))
...
@@ -99,6 +100,7 @@ class SystemHooksService
...
@@ -99,6 +100,7 @@ class SystemHooksService
project_path:
model
.
project
.
path
,
project_path:
model
.
project
.
path
,
project_path_with_namespace:
model
.
project
.
path_with_namespace
,
project_path_with_namespace:
model
.
project
.
path_with_namespace
,
project_id:
model
.
project
.
id
,
project_id:
model
.
project
.
id
,
user_username:
model
.
user
.
username
,
user_name:
model
.
user
.
name
,
user_name:
model
.
user
.
name
,
user_email:
model
.
user
.
email
,
user_email:
model
.
user
.
email
,
user_id:
model
.
user
.
id
,
user_id:
model
.
user
.
id
,
...
@@ -112,6 +114,7 @@ class SystemHooksService
...
@@ -112,6 +114,7 @@ class SystemHooksService
group_name:
model
.
group
.
name
,
group_name:
model
.
group
.
name
,
group_path:
model
.
group
.
path
,
group_path:
model
.
group
.
path
,
group_id:
model
.
group
.
id
,
group_id:
model
.
group
.
id
,
user_username:
model
.
user
.
username
,
user_name:
model
.
user
.
name
,
user_name:
model
.
user
.
name
,
user_email:
model
.
user
.
email
,
user_email:
model
.
user
.
email
,
user_id:
model
.
user
.
id
,
user_id:
model
.
user
.
id
,
...
...
doc/system_hooks/system_hooks.md
View file @
32a5b741
...
@@ -96,6 +96,7 @@ X-Gitlab-Event: System Hook
...
@@ -96,6 +96,7 @@ X-Gitlab-Event: System Hook
"project_path_with_namespace"
:
"jsmith/storecloud"
,
"project_path_with_namespace"
:
"jsmith/storecloud"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_name"
:
"John Smith"
,
"user_name"
:
"John Smith"
,
"user_username"
:
"johnsmith"
,
"user_id"
:
41
,
"user_id"
:
41
,
"project_visibility"
:
"private"
,
"project_visibility"
:
"private"
,
}
}
...
@@ -115,6 +116,7 @@ X-Gitlab-Event: System Hook
...
@@ -115,6 +116,7 @@ X-Gitlab-Event: System Hook
"project_path_with_namespace"
:
"jsmith/storecloud"
,
"project_path_with_namespace"
:
"jsmith/storecloud"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_name"
:
"John Smith"
,
"user_name"
:
"John Smith"
,
"user_username"
:
"johnsmith"
,
"user_id"
:
41
,
"user_id"
:
41
,
"project_visibility"
:
"private"
,
"project_visibility"
:
"private"
,
}
}
...
@@ -129,6 +131,7 @@ X-Gitlab-Event: System Hook
...
@@ -129,6 +131,7 @@ X-Gitlab-Event: System Hook
"email"
:
"js@gitlabhq.com"
,
"email"
:
"js@gitlabhq.com"
,
"event_name"
:
"user_create"
,
"event_name"
:
"user_create"
,
"name"
:
"John Smith"
,
"name"
:
"John Smith"
,
"username"
:
"js"
,
"user_id"
:
41
"user_id"
:
41
}
}
```
```
...
@@ -142,6 +145,7 @@ X-Gitlab-Event: System Hook
...
@@ -142,6 +145,7 @@ X-Gitlab-Event: System Hook
"email"
:
"js@gitlabhq.com"
,
"email"
:
"js@gitlabhq.com"
,
"event_name"
:
"user_destroy"
,
"event_name"
:
"user_destroy"
,
"name"
:
"John Smith"
,
"name"
:
"John Smith"
,
"username"
:
"js"
,
"user_id"
:
41
"user_id"
:
41
}
}
```
```
...
@@ -215,6 +219,7 @@ X-Gitlab-Event: System Hook
...
@@ -215,6 +219,7 @@ X-Gitlab-Event: System Hook
"group_path"
:
"storecloud"
,
"group_path"
:
"storecloud"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_name"
:
"John Smith"
,
"user_name"
:
"John Smith"
,
"user_username"
:
"johnsmith"
,
"user_id"
:
41
"user_id"
:
41
}
}
```
```
...
@@ -231,6 +236,7 @@ X-Gitlab-Event: System Hook
...
@@ -231,6 +236,7 @@ X-Gitlab-Event: System Hook
"group_path"
:
"storecloud"
,
"group_path"
:
"storecloud"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_email"
:
"johnsmith@gmail.com"
,
"user_name"
:
"John Smith"
,
"user_name"
:
"John Smith"
,
"user_username"
:
"johnsmith"
,
"user_id"
:
41
"user_id"
:
41
}
}
```
```
spec/services/system_hooks_service_spec.rb
View file @
32a5b741
...
@@ -9,54 +9,54 @@ describe SystemHooksService, services: true do
...
@@ -9,54 +9,54 @@ describe SystemHooksService, services: true do
let
(
:group_member
)
{
create
(
:group_member
)
}
let
(
:group_member
)
{
create
(
:group_member
)
}
context
'event data'
do
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
,
: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
)
}
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
,
: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
,
: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
,
:user_id
,
:access_level
,
: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_
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_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
do
it
do
project
.
old_path_with_namespace
=
'renamed_from_path'
project
.
old_path_with_namespace
=
'renamed_from_path'
expect
(
event_data
(
project
,
:rename
)).
to
include
(
expect
(
event_data
(
project
,
:rename
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:owner_name
,
:owner_email
,
:project_visibility
,
:owner_name
,
:owner_email
,
:project_visibility
,
:old_path_with_namespace
:old_path_with_namespace
)
)
end
end
it
do
it
do
project
.
old_path_with_namespace
=
'transfered_from_path'
project
.
old_path_with_namespace
=
'transfered_from_path'
expect
(
event_data
(
project
,
:transfer
)).
to
include
(
expect
(
event_data
(
project
,
:transfer
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:project_id
,
:owner_name
,
:owner_email
,
:project_visibility
,
:owner_name
,
:owner_email
,
:project_visibility
,
:old_path_with_namespace
:old_path_with_namespace
)
)
end
end
it
do
it
do
expect
(
event_data
(
group
,
:create
)).
to
include
(
expect
(
event_data
(
group
,
:create
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:group_id
,
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:group_id
,
:owner_name
,
:owner_email
:owner_name
,
:owner_email
)
)
end
end
it
do
it
do
expect
(
event_data
(
group
,
:destroy
)).
to
include
(
expect
(
event_data
(
group
,
:destroy
)).
to
include
(
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:group_id
,
:event_name
,
:name
,
:created_at
,
:updated_at
,
:path
,
:group_id
,
:owner_name
,
:owner_email
:owner_name
,
:owner_email
)
)
end
end
it
do
it
do
expect
(
event_data
(
group_member
,
:create
)).
to
include
(
expect
(
event_data
(
group_member
,
:create
)).
to
include
(
:event_name
,
:created_at
,
:updated_at
,
:group_name
,
:group_path
,
:event_name
,
:created_at
,
:updated_at
,
:group_name
,
:group_path
,
:group_id
,
:user_id
,
:user_name
,
:user_email
,
:group_access
:group_id
,
:user_id
,
:user_
username
,
:user_
name
,
:user_email
,
:group_access
)
)
end
end
it
do
it
do
expect
(
event_data
(
group_member
,
:destroy
)).
to
include
(
expect
(
event_data
(
group_member
,
:destroy
)).
to
include
(
:event_name
,
:created_at
,
:updated_at
,
:group_name
,
:group_path
,
:event_name
,
:created_at
,
:updated_at
,
:group_name
,
:group_path
,
:group_id
,
:user_id
,
:user_name
,
:user_email
,
:group_access
:group_id
,
:user_id
,
:user_
username
,
:user_
name
,
:user_email
,
:group_access
)
)
end
end
end
end
...
...
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