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
99c2f3b3
Commit
99c2f3b3
authored
Aug 23, 2016
by
Ben Boeckel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: expose wiki_page_events project hook field in the API
parent
f413d7ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
1 deletion
+12
-1
CHANGELOG
CHANGELOG
+1
-0
doc/api/projects.md
doc/api/projects.md
+3
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/project_hooks.rb
lib/api/project_hooks.rb
+2
-0
spec/factories/project_hooks.rb
spec/factories/project_hooks.rb
+1
-0
spec/requests/api/project_hooks_spec.rb
spec/requests/api/project_hooks_spec.rb
+4
-0
No files found.
CHANGELOG
View file @
99c2f3b3
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
v 8.12.0 (unreleased)
- Change merge_error column from string to text type
- Change merge_error column from string to text type
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Added tests for diff notes
- Added tests for diff notes
v 8.11.1 (unreleased)
v 8.11.1 (unreleased)
...
...
doc/api/projects.md
View file @
99c2f3b3
...
@@ -918,6 +918,7 @@ Parameters:
...
@@ -918,6 +918,7 @@ Parameters:
"note_events"
:
true
,
"note_events"
:
true
,
"build_events"
:
true
,
"build_events"
:
true
,
"pipeline_events"
:
true
,
"pipeline_events"
:
true
,
"wiki_page_events"
:
true
,
"enable_ssl_verification"
:
true
,
"enable_ssl_verification"
:
true
,
"created_at"
:
"2012-10-12T17:04:47Z"
"created_at"
:
"2012-10-12T17:04:47Z"
}
}
...
@@ -942,6 +943,7 @@ Parameters:
...
@@ -942,6 +943,7 @@ Parameters:
-
`note_events`
- Trigger hook on note events
-
`note_events`
- Trigger hook on note events
-
`build_events`
- Trigger hook on build events
-
`build_events`
- Trigger hook on build events
-
`pipeline_events`
- Trigger hook on pipeline events
-
`pipeline_events`
- Trigger hook on pipeline events
-
`wiki_page_events`
- Trigger hook on wiki page events
-
`enable_ssl_verification`
- Do SSL verification when triggering the hook
-
`enable_ssl_verification`
- Do SSL verification when triggering the hook
### Edit project hook
### Edit project hook
...
@@ -964,6 +966,7 @@ Parameters:
...
@@ -964,6 +966,7 @@ Parameters:
-
`note_events`
- Trigger hook on note events
-
`note_events`
- Trigger hook on note events
-
`build_events`
- Trigger hook on build events
-
`build_events`
- Trigger hook on build events
-
`pipeline_events`
- Trigger hook on pipeline events
-
`pipeline_events`
- Trigger hook on pipeline events
-
`wiki_page_events`
- Trigger hook on wiki page events
-
`enable_ssl_verification`
- Do SSL verification when triggering the hook
-
`enable_ssl_verification`
- Do SSL verification when triggering the hook
### Delete project hook
### Delete project hook
...
...
lib/api/entities.rb
View file @
99c2f3b3
...
@@ -49,7 +49,7 @@ module API
...
@@ -49,7 +49,7 @@ module API
class
ProjectHook
<
Hook
class
ProjectHook
<
Hook
expose
:project_id
,
:push_events
expose
:project_id
,
:push_events
expose
:issues_events
,
:merge_requests_events
,
:tag_push_events
expose
:issues_events
,
:merge_requests_events
,
:tag_push_events
expose
:note_events
,
:build_events
,
:pipeline_events
expose
:note_events
,
:build_events
,
:pipeline_events
,
:wiki_page_events
expose
:enable_ssl_verification
expose
:enable_ssl_verification
end
end
...
...
lib/api/project_hooks.rb
View file @
99c2f3b3
...
@@ -46,6 +46,7 @@ module API
...
@@ -46,6 +46,7 @@ module API
:note_events
,
:note_events
,
:build_events
,
:build_events
,
:pipeline_events
,
:pipeline_events
,
:wiki_page_events
,
:enable_ssl_verification
:enable_ssl_verification
]
]
@hook
=
user_project
.
hooks
.
new
(
attrs
)
@hook
=
user_project
.
hooks
.
new
(
attrs
)
...
@@ -80,6 +81,7 @@ module API
...
@@ -80,6 +81,7 @@ module API
:note_events
,
:note_events
,
:build_events
,
:build_events
,
:pipeline_events
,
:pipeline_events
,
:wiki_page_events
,
:enable_ssl_verification
:enable_ssl_verification
]
]
...
...
spec/factories/project_hooks.rb
View file @
99c2f3b3
...
@@ -14,6 +14,7 @@ FactoryGirl.define do
...
@@ -14,6 +14,7 @@ FactoryGirl.define do
note_events
true
note_events
true
build_events
true
build_events
true
pipeline_events
true
pipeline_events
true
wiki_page_events
true
end
end
end
end
end
end
spec/requests/api/project_hooks_spec.rb
View file @
99c2f3b3
...
@@ -34,6 +34,7 @@ describe API::API, 'ProjectHooks', api: true do
...
@@ -34,6 +34,7 @@ describe API::API, 'ProjectHooks', api: true do
expect
(
json_response
.
first
[
'note_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'note_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'build_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'build_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'pipeline_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'pipeline_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'wiki_page_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'enable_ssl_verification'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'enable_ssl_verification'
]).
to
eq
(
true
)
end
end
end
end
...
@@ -59,6 +60,7 @@ describe API::API, 'ProjectHooks', api: true do
...
@@ -59,6 +60,7 @@ describe API::API, 'ProjectHooks', api: true do
expect
(
json_response
[
'note_events'
]).
to
eq
(
hook
.
note_events
)
expect
(
json_response
[
'note_events'
]).
to
eq
(
hook
.
note_events
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
hook
.
build_events
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
hook
.
build_events
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
hook
.
pipeline_events
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
hook
.
pipeline_events
)
expect
(
json_response
[
'wiki_page_events'
]).
to
eq
(
hook
.
wiki_page_events
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
hook
.
enable_ssl_verification
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
hook
.
enable_ssl_verification
)
end
end
...
@@ -95,6 +97,7 @@ describe API::API, 'ProjectHooks', api: true do
...
@@ -95,6 +97,7 @@ describe API::API, 'ProjectHooks', api: true do
expect
(
json_response
[
'note_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'note_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'wiki_page_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
true
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
true
)
end
end
...
@@ -122,6 +125,7 @@ describe API::API, 'ProjectHooks', api: true do
...
@@ -122,6 +125,7 @@ describe API::API, 'ProjectHooks', api: true do
expect
(
json_response
[
'note_events'
]).
to
eq
(
hook
.
note_events
)
expect
(
json_response
[
'note_events'
]).
to
eq
(
hook
.
note_events
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
hook
.
build_events
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
hook
.
build_events
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
hook
.
pipeline_events
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
hook
.
pipeline_events
)
expect
(
json_response
[
'wiki_page_events'
]).
to
eq
(
hook
.
wiki_page_events
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
hook
.
enable_ssl_verification
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
hook
.
enable_ssl_verification
)
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