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
dd64f8aa
Commit
dd64f8aa
authored
8 years ago
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
Show 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
# `issue_events` and `merge_request_events` (singular!)
# See app/helpers/services_helper.rb for how we
# 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
,
:add_pusher
,
:send_from_committer_email
,
:disable_diffs
,
:external_wiki_url
,
:notify
,
:color
,
...
...
This diff is collapsed.
Click to expand it.
app/helpers/services_helper.rb
View file @
dd64f8aa
...
...
@@ -8,7 +8,9 @@ module ServicesHelper
when
"note"
"Event will be triggered when someone adds a comment"
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"
"Event will be triggered when a merge request is created/updated/merged"
when
"build"
...
...
@@ -19,7 +21,7 @@ module ServicesHelper
end
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"
end
end
This diff is collapsed.
Click to expand it.
app/models/project_services/hipchat_service.rb
View file @
dd64f8aa
...
...
@@ -39,7 +39,7 @@ class HipchatService < Service
end
def
supported_events
%w(push issue merge_request note tag_push build)
%w(push issue
confidential_issue
merge_request note tag_push build)
end
def
execute
(
data
)
...
...
This diff is collapsed.
Click to expand it.
app/models/project_services/slack_service.rb
View file @
dd64f8aa
...
...
@@ -44,7 +44,7 @@ class SlackService < Service
end
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
def
execute
(
data
)
...
...
This diff is collapsed.
Click to expand it.
app/models/service.rb
View file @
dd64f8aa
...
...
@@ -7,6 +7,7 @@ class Service < ActiveRecord::Base
default_value_for
:active
,
false
default_value_for
:push_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
:tag_push_events
,
true
default_value_for
:note_events
,
true
...
...
@@ -100,7 +101,7 @@ class Service < ActiveRecord::Base
end
def
supported_events
%w(push tag_push issue merge_request wiki_page)
%w(push tag_push issue
confidential_issue
merge_request wiki_page)
end
def
execute
(
data
)
...
...
This diff is collapsed.
Click to expand it.
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
This diff is collapsed.
Click to expand it.
db/schema.rb
View file @
dd64f8aa
...
...
@@ -914,6 +914,7 @@ ActiveRecord::Schema.define(version: 20160830232601) do
t
.
boolean
"default"
,
default:
false
t
.
boolean
"wiki_page_events"
,
default:
true
t
.
boolean
"pipeline_events"
,
default:
false
,
null:
false
t
.
boolean
"confidential_issues_events"
,
default:
true
,
null:
false
end
add_index
"services"
,
[
"project_id"
],
name:
"index_services_on_project_id"
,
using: :btree
...
...
This diff is collapsed.
Click to expand it.
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