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
20844326
Commit
20844326
authored
Feb 26, 2018
by
Jean-Baptiste Guerraz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
align "confidential issues events" implementation with "issues events" one
parent
bac9bb18
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
7 deletions
+24
-7
doc/api/projects.md
doc/api/projects.md
+3
-0
doc/api/services.md
doc/api/services.md
+1
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/project_hooks.rb
lib/api/project_hooks.rb
+1
-0
lib/api/v3/entities.rb
lib/api/v3/entities.rb
+6
-4
lib/api/v3/project_hooks.rb
lib/api/v3/project_hooks.rb
+1
-0
spec/lib/gitlab/import_export/relation_factory_spec.rb
spec/lib/gitlab/import_export/relation_factory_spec.rb
+1
-0
spec/requests/api/project_hooks_spec.rb
spec/requests/api/project_hooks_spec.rb
+5
-1
spec/requests/api/v3/project_hooks_spec.rb
spec/requests/api/v3/project_hooks_spec.rb
+5
-1
No files found.
doc/api/projects.md
View file @
20844326
...
...
@@ -1194,6 +1194,7 @@ GET /projects/:id/hooks/:hook_id
"project_id"
:
3
,
"push_events"
:
true
,
"issues_events"
:
true
,
"confidential_issues_events"
:
true
,
"merge_requests_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
...
...
@@ -1219,6 +1220,7 @@ POST /projects/:id/hooks
|
`url`
| string | yes | The hook URL |
|
`push_events`
| boolean | no | Trigger hook on push events |
|
`issues_events`
| boolean | no | Trigger hook on issues events |
|
`confidential_issues_events`
| boolean | no | Trigger hook on confidential issues events |
|
`merge_requests_events`
| boolean | no | Trigger hook on merge requests events |
|
`tag_push_events`
| boolean | no | Trigger hook on tag push events |
|
`note_events`
| boolean | no | Trigger hook on note events |
...
...
@@ -1243,6 +1245,7 @@ PUT /projects/:id/hooks/:hook_id
|
`url`
| string | yes | The hook URL |
|
`push_events`
| boolean | no | Trigger hook on push events |
|
`issues_events`
| boolean | no | Trigger hook on issues events |
|
`confidential_issues_events`
| boolean | no | Trigger hook on confidential issues events |
|
`merge_requests_events`
| boolean | no | Trigger hook on merge requests events |
|
`tag_push_events`
| boolean | no | Trigger hook on tag push events |
|
`note_events`
| boolean | no | Trigger hook on note events |
...
...
doc/api/services.md
View file @
20844326
...
...
@@ -619,6 +619,7 @@ Example response:
"active"
:
true
,
"push_events"
:
true
,
"issues_events"
:
true
,
"confidential_issues_events"
:
true
,
"merge_requests_events"
:
true
,
"tag_push_events"
:
true
,
"note_events"
:
true
,
...
...
lib/api/entities.rb
View file @
20844326
...
...
@@ -71,7 +71,7 @@ module API
end
class
ProjectHook
<
Hook
expose
:project_id
,
:issues_events
expose
:project_id
,
:issues_events
,
:confidential_issues_events
expose
:note_events
,
:pipeline_events
,
:wiki_page_events
expose
:job_events
end
...
...
lib/api/project_hooks.rb
View file @
20844326
...
...
@@ -10,6 +10,7 @@ module API
requires
:url
,
type:
String
,
desc:
"The URL to send the request to"
optional
:push_events
,
type:
Boolean
,
desc:
"Trigger hook on push events"
optional
:issues_events
,
type:
Boolean
,
desc:
"Trigger hook on issues events"
optional
:confidential_issues_events
,
type:
Boolean
,
desc:
"Trigger hook on confidential issues events"
optional
:merge_requests_events
,
type:
Boolean
,
desc:
"Trigger hook on merge request events"
optional
:tag_push_events
,
type:
Boolean
,
desc:
"Trigger hook on tag push events"
optional
:note_events
,
type:
Boolean
,
desc:
"Trigger hook on note(comment) events"
...
...
lib/api/v3/entities.rb
View file @
20844326
...
...
@@ -252,8 +252,9 @@ module API
class
ProjectService
<
Grape
::
Entity
expose
:id
,
:title
,
:created_at
,
:updated_at
,
:active
expose
:push_events
,
:issues_events
,
:merge_requests_events
expose
:tag_push_events
,
:note_events
,
:pipeline_events
expose
:push_events
,
:issues_events
,
:confidential_issues_events
expose
:merge_requests_events
,
:tag_push_events
,
:note_events
expose
:pipeline_events
expose
:job_events
,
as: :build_events
# Expose serialized properties
expose
:properties
do
|
service
,
options
|
...
...
@@ -262,8 +263,9 @@ module API
end
class
ProjectHook
<
::
API
::
Entities
::
Hook
expose
:project_id
,
:issues_events
,
:merge_requests_events
expose
:note_events
,
:pipeline_events
,
:wiki_page_events
expose
:project_id
,
:issues_events
,
:confidential_issues_events
expose
:merge_requests_events
,
:note_events
,
:pipeline_events
expose
:wiki_page_events
expose
:job_events
,
as: :build_events
end
...
...
lib/api/v3/project_hooks.rb
View file @
20844326
...
...
@@ -11,6 +11,7 @@ module API
requires
:url
,
type:
String
,
desc:
"The URL to send the request to"
optional
:push_events
,
type:
Boolean
,
desc:
"Trigger hook on push events"
optional
:issues_events
,
type:
Boolean
,
desc:
"Trigger hook on issues events"
optional
:confidential_issues_events
,
type:
Boolean
,
desc:
"Trigger hook on confidential issues events"
optional
:merge_requests_events
,
type:
Boolean
,
desc:
"Trigger hook on merge request events"
optional
:tag_push_events
,
type:
Boolean
,
desc:
"Trigger hook on tag push events"
optional
:note_events
,
type:
Boolean
,
desc:
"Trigger hook on note(comment) events"
...
...
spec/lib/gitlab/import_export/relation_factory_spec.rb
View file @
20844326
...
...
@@ -29,6 +29,7 @@ describe Gitlab::ImportExport::RelationFactory do
'service_id'
=>
service_id
,
'push_events'
=>
true
,
'issues_events'
=>
false
,
'confidential_issues_events'
=>
false
,
'merge_requests_events'
=>
true
,
'tag_push_events'
=>
false
,
'note_events'
=>
true
,
...
...
spec/requests/api/project_hooks_spec.rb
View file @
20844326
...
...
@@ -28,6 +28,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
json_response
.
count
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'url'
]).
to
eq
(
"http://example.com"
)
expect
(
json_response
.
first
[
'issues_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'confidential_issues_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'push_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'merge_requests_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'tag_push_events'
]).
to
eq
(
true
)
...
...
@@ -56,6 +57,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'url'
]).
to
eq
(
hook
.
url
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
hook
.
issues_events
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
hook
.
confidential_issues_events
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
hook
.
push_events
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
hook
.
merge_requests_events
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
hook
.
tag_push_events
)
...
...
@@ -90,13 +92,14 @@ describe API::ProjectHooks, 'ProjectHooks' do
it
"adds hook to project"
do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
url:
"http://example.com"
,
issues_events:
true
,
wiki_page_events:
true
,
url:
"http://example.com"
,
issues_events:
true
,
confidential_issues_events:
true
,
wiki_page_events:
true
,
job_events:
true
end
.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
[
'url'
]).
to
eq
(
'http://example.com'
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
false
)
...
...
@@ -144,6 +147,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'url'
]).
to
eq
(
'http://example.org'
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
hook
.
issues_events
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
hook
.
confidential_issues_events
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
hook
.
merge_requests_events
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
hook
.
tag_push_events
)
...
...
spec/requests/api/v3/project_hooks_spec.rb
View file @
20844326
...
...
@@ -27,6 +27,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
json_response
.
count
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'url'
]).
to
eq
(
"http://example.com"
)
expect
(
json_response
.
first
[
'issues_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'confidential_issues_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'push_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'merge_requests_events'
]).
to
eq
(
true
)
expect
(
json_response
.
first
[
'tag_push_events'
]).
to
eq
(
true
)
...
...
@@ -54,6 +55,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'url'
]).
to
eq
(
hook
.
url
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
hook
.
issues_events
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
hook
.
confidential_issues_events
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
hook
.
push_events
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
hook
.
merge_requests_events
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
hook
.
tag_push_events
)
...
...
@@ -87,12 +89,13 @@ describe API::ProjectHooks, 'ProjectHooks' do
it
"adds hook to project"
do
expect
do
post
v3_api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
url:
"http://example.com"
,
issues_events:
true
,
wiki_page_events:
true
,
build_events:
true
url:
"http://example.com"
,
issues_events:
true
,
confidential_issues_events:
true
,
wiki_page_events:
true
,
build_events:
true
end
.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
expect
(
json_response
[
'url'
]).
to
eq
(
'http://example.com'
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
true
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
false
)
...
...
@@ -139,6 +142,7 @@ describe API::ProjectHooks, 'ProjectHooks' do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'url'
]).
to
eq
(
'http://example.org'
)
expect
(
json_response
[
'issues_events'
]).
to
eq
(
hook
.
issues_events
)
expect
(
json_response
[
'confidential_issues_events'
]).
to
eq
(
hook
.
confidential_issues_events
)
expect
(
json_response
[
'push_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'merge_requests_events'
]).
to
eq
(
hook
.
merge_requests_events
)
expect
(
json_response
[
'tag_push_events'
]).
to
eq
(
hook
.
tag_push_events
)
...
...
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