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
1f64332e
Commit
1f64332e
authored
Jan 07, 2016
by
Tommy Beadle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include user_username in user_(add_to/remove_from)_(project/group) system hooks.
parent
dada25d4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+2
-0
doc/system_hooks/system_hooks.md
doc/system_hooks/system_hooks.md
+4
-0
spec/services/system_hooks_service_spec.rb
spec/services/system_hooks_service_spec.rb
+4
-4
No files found.
app/services/system_hooks_service.rb
View file @
1f64332e
...
@@ -100,6 +100,7 @@ class SystemHooksService
...
@@ -100,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
,
access_level:
model
.
human_access
,
access_level:
model
.
human_access
,
...
@@ -112,6 +113,7 @@ class SystemHooksService
...
@@ -112,6 +113,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 @
1f64332e
...
@@ -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"
,
}
}
...
@@ -217,6 +219,7 @@ X-Gitlab-Event: System Hook
...
@@ -217,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
}
}
```
```
...
@@ -233,6 +236,7 @@ X-Gitlab-Event: System Hook
...
@@ -233,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 @
1f64332e
...
@@ -13,8 +13,8 @@ describe SystemHooksService, services: true do
...
@@ -13,8 +13,8 @@ describe SystemHooksService, services: true do
it
{
expect
(
event_data
(
user
,
:destroy
)).
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
,
: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
,
: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
,
: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
,
: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
,
: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
)
}
...
@@ -50,13 +50,13 @@ describe SystemHooksService, services: true do
...
@@ -50,13 +50,13 @@ describe SystemHooksService, services: true do
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