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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
dd64f8aa
Commit
dd64f8aa
authored
Aug 30, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to confidential issues events to trigger services
parent
a103a5d9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
18 deletions
+37
-18
app/controllers/concerns/service_params.rb
app/controllers/concerns/service_params.rb
+1
-1
app/helpers/services_helper.rb
app/helpers/services_helper.rb
+4
-2
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+1
-1
app/models/project_services/slack_service.rb
app/models/project_services/slack_service.rb
+1
-1
app/models/service.rb
app/models/service.rb
+2
-1
db/migrate/20160830211132_add_confidential_issues_events_to_services.rb
...60830211132_add_confidential_issues_events_to_services.rb
+15
-0
db/schema.rb
db/schema.rb
+13
-12
No files found.
app/controllers/concerns/service_params.rb
View file @
dd64f8aa
...
@@ -13,7 +13,7 @@ module ServiceParams
...
@@ -13,7 +13,7 @@ module ServiceParams
# `issue_events` and `merge_request_events` (singular!)
# `issue_events` and `merge_request_events` (singular!)
# See app/helpers/services_helper.rb for how we
# See app/helpers/services_helper.rb for how we
# make those event names plural as special case.
# make those event names plural as special case.
:issues_events
,
:merge_requests_events
,
:issues_events
,
:
confidential_issues_events
,
:
merge_requests_events
,
:notify_only_broken_builds
,
:notify_only_broken_pipelines
,
:notify_only_broken_builds
,
:notify_only_broken_pipelines
,
:add_pusher
,
:send_from_committer_email
,
:disable_diffs
,
:add_pusher
,
:send_from_committer_email
,
:disable_diffs
,
:external_wiki_url
,
:notify
,
:color
,
:external_wiki_url
,
:notify
,
:color
,
...
...
app/helpers/services_helper.rb
View file @
dd64f8aa
...
@@ -8,7 +8,9 @@ module ServicesHelper
...
@@ -8,7 +8,9 @@ module ServicesHelper
when
"note"
when
"note"
"Event will be triggered when someone adds a comment"
"Event will be triggered when someone adds a comment"
when
"issue"
when
"issue"
"Event will be triggered when an issue is created/updated/merged"
"Event will be triggered when an issue is created/updated/closed"
when
"confidential_issue"
"Event will be triggered when a confidential issue is created/updated/closed"
when
"merge_request"
when
"merge_request"
"Event will be triggered when a merge request is created/updated/merged"
"Event will be triggered when a merge request is created/updated/merged"
when
"build"
when
"build"
...
@@ -19,7 +21,7 @@ module ServicesHelper
...
@@ -19,7 +21,7 @@ module ServicesHelper
end
end
def
service_event_field_name
(
event
)
def
service_event_field_name
(
event
)
event
=
event
.
pluralize
if
%w[merge_request issue]
.
include?
(
event
)
event
=
event
.
pluralize
if
%w[merge_request issue
confidential_issue
]
.
include?
(
event
)
"
#{
event
}
_events"
"
#{
event
}
_events"
end
end
end
end
app/models/project_services/hipchat_service.rb
View file @
dd64f8aa
...
@@ -39,7 +39,7 @@ class HipchatService < Service
...
@@ -39,7 +39,7 @@ class HipchatService < Service
end
end
def
supported_events
def
supported_events
%w(push issue merge_request note tag_push build)
%w(push issue
confidential_issue
merge_request note tag_push build)
end
end
def
execute
(
data
)
def
execute
(
data
)
...
...
app/models/project_services/slack_service.rb
View file @
dd64f8aa
...
@@ -44,7 +44,7 @@ class SlackService < Service
...
@@ -44,7 +44,7 @@ class SlackService < Service
end
end
def
supported_events
def
supported_events
%w(push issue merge_request note tag_push build wiki_page)
%w(push issue
confidential_issue
merge_request note tag_push build wiki_page)
end
end
def
execute
(
data
)
def
execute
(
data
)
...
...
app/models/service.rb
View file @
dd64f8aa
...
@@ -7,6 +7,7 @@ class Service < ActiveRecord::Base
...
@@ -7,6 +7,7 @@ class Service < ActiveRecord::Base
default_value_for
:active
,
false
default_value_for
:active
,
false
default_value_for
:push_events
,
true
default_value_for
:push_events
,
true
default_value_for
:issues_events
,
true
default_value_for
:issues_events
,
true
default_value_for
:confidential_issues_events
,
true
default_value_for
:merge_requests_events
,
true
default_value_for
:merge_requests_events
,
true
default_value_for
:tag_push_events
,
true
default_value_for
:tag_push_events
,
true
default_value_for
:note_events
,
true
default_value_for
:note_events
,
true
...
@@ -100,7 +101,7 @@ class Service < ActiveRecord::Base
...
@@ -100,7 +101,7 @@ class Service < ActiveRecord::Base
end
end
def
supported_events
def
supported_events
%w(push tag_push issue merge_request wiki_page)
%w(push tag_push issue
confidential_issue
merge_request wiki_page)
end
end
def
execute
(
data
)
def
execute
(
data
)
...
...
db/migrate/20160830211132_add_confidential_issues_events_to_services.rb
0 → 100644
View file @
dd64f8aa
class
AddConfidentialIssuesEventsToServices
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
:services
,
:confidential_issues_events
,
:boolean
,
default:
true
,
allow_null:
false
end
def
down
remove_column
:services
,
:confidential_issues_events
end
end
db/schema.rb
View file @
dd64f8aa
...
@@ -901,19 +901,20 @@ ActiveRecord::Schema.define(version: 20160830232601) do
...
@@ -901,19 +901,20 @@ ActiveRecord::Schema.define(version: 20160830232601) do
t
.
integer
"project_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
t
.
boolean
"active"
,
default:
false
,
null:
false
t
.
boolean
"active"
,
default:
false
,
null:
false
t
.
text
"properties"
t
.
text
"properties"
t
.
boolean
"template"
,
default:
false
t
.
boolean
"template"
,
default:
false
t
.
boolean
"push_events"
,
default:
true
t
.
boolean
"push_events"
,
default:
true
t
.
boolean
"issues_events"
,
default:
true
t
.
boolean
"issues_events"
,
default:
true
t
.
boolean
"merge_requests_events"
,
default:
true
t
.
boolean
"merge_requests_events"
,
default:
true
t
.
boolean
"tag_push_events"
,
default:
true
t
.
boolean
"tag_push_events"
,
default:
true
t
.
boolean
"note_events"
,
default:
true
,
null:
false
t
.
boolean
"note_events"
,
default:
true
,
null:
false
t
.
boolean
"build_events"
,
default:
false
,
null:
false
t
.
boolean
"build_events"
,
default:
false
,
null:
false
t
.
string
"category"
,
default:
"common"
,
null:
false
t
.
string
"category"
,
default:
"common"
,
null:
false
t
.
boolean
"default"
,
default:
false
t
.
boolean
"default"
,
default:
false
t
.
boolean
"wiki_page_events"
,
default:
true
t
.
boolean
"wiki_page_events"
,
default:
true
t
.
boolean
"pipeline_events"
,
default:
false
,
null:
false
t
.
boolean
"pipeline_events"
,
default:
false
,
null:
false
t
.
boolean
"confidential_issues_events"
,
default:
true
,
null:
false
end
end
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
...
...
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