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
b4963e9d
Commit
b4963e9d
authored
Sep 19, 2014
by
Kirill Zaitsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tag_push_events to project hook api
parent
a3d90c50
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
web_hook.rb
app/models/hooks/web_hook.rb
+1
-0
projects.md
doc/api/projects.md
+2
-0
entities.rb
lib/api/entities.rb
+2
-1
project_hooks.rb
lib/api/project_hooks.rb
+14
-2
No files found.
app/models/hooks/web_hook.rb
View file @
b4963e9d
...
...
@@ -21,6 +21,7 @@ class WebHook < ActiveRecord::Base
default_value_for
:push_events
,
true
default_value_for
:issues_events
,
false
default_value_for
:merge_requests_events
,
false
default_value_for
:tag_push_events
,
false
# HTTParty timeout
default_timeout
Gitlab
.
config
.
gitlab
.
webhook_timeout
...
...
doc/api/projects.md
View file @
b4963e9d
...
...
@@ -447,6 +447,7 @@ Parameters:
-
`push_events`
- Trigger hook on push events
-
`issues_events`
- Trigger hook on issues events
-
`merge_requests_events`
- Trigger hook on merge_requests events
-
`tag_push_events`
- Trigger hook on push_tag events
### Edit project hook
...
...
@@ -464,6 +465,7 @@ Parameters:
-
`push_events`
- Trigger hook on push events
-
`issues_events`
- Trigger hook on issues events
-
`merge_requests_events`
- Trigger hook on merge_requests events
-
`tag_push_events`
- Trigger hook on push_tag events
### Delete project hook
...
...
lib/api/entities.rb
View file @
b4963e9d
...
...
@@ -30,7 +30,8 @@ module API
end
class
ProjectHook
<
Hook
expose
:project_id
,
:push_events
,
:issues_events
,
:merge_requests_events
expose
:project_id
,
:push_events
expose
:issues_events
,
:merge_requests_events
,
:tag_push_events
end
class
ForkedFromProject
<
Grape
::
Entity
...
...
lib/api/project_hooks.rb
View file @
b4963e9d
...
...
@@ -38,7 +38,13 @@ module API
# POST /projects/:id/hooks
post
":id/hooks"
do
required_attributes!
[
:url
]
attrs
=
attributes_for_keys
[
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
]
attrs
=
attributes_for_keys
[
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
,
:tag_push_events
]
@hook
=
user_project
.
hooks
.
new
(
attrs
)
if
@hook
.
save
...
...
@@ -62,7 +68,13 @@ module API
put
":id/hooks/:hook_id"
do
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
required_attributes!
[
:url
]
attrs
=
attributes_for_keys
[
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
]
attrs
=
attributes_for_keys
[
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
,
:tag_push_events
]
if
@hook
.
update_attributes
attrs
present
@hook
,
with:
Entities
::
ProjectHook
...
...
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