Skip to content
Snippets Groups Projects
Commit 30d5e9fa authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch '22974-trigger-service-events-through-api' into 'master'

adds events to services api deserialization

Closes #22974

See merge request !8324
parents 6c65f7a7 4b6e583c
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 47 deletions
module ServicesHelper
def service_event_description(event)
case event
when "push"
when "push", "push_events"
"Event will be triggered by a push to the repository"
when "tag_push"
when "tag_push", "tag_push_events"
"Event will be triggered when a new tag is pushed to the repository"
when "note"
when "note", "note_events"
"Event will be triggered when someone adds a comment"
when "issue"
when "issue", "issue_events"
"Event will be triggered when an issue is created/updated/closed"
when "confidential_issue"
when "confidential_issue", "confidential_issue_events"
"Event will be triggered when a confidential issue is created/updated/closed"
when "merge_request"
when "merge_request", "merge_request_events"
"Event will be triggered when a merge request is created/updated/merged"
when "build"
when "build", "build_events"
"Event will be triggered when a build status changes"
when "wiki_page"
when "wiki_page", "wiki_page_events"
"Event will be triggered when a wiki page is created/updated"
when "commit"
when "commit", "commit_events"
"Event will be triggered when a commit is created/updated"
end
end
Loading
Loading
@@ -26,4 +26,6 @@ module ServicesHelper
event = event.pluralize if %w[merge_request issue confidential_issue].include?(event)
"#{event}_events"
end
extend self
end
Loading
Loading
@@ -25,7 +25,7 @@ You can create a Personal Access Token here:
http://app.asana.com/-/account_api'
end
 
def to_param
def self.to_param
'asana'
end
 
Loading
Loading
@@ -44,7 +44,7 @@ http://app.asana.com/-/account_api'
]
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class AssemblaService < Service
'Project Management Software (Source Commits Endpoint)'
end
 
def to_param
def self.to_param
'assembla'
end
 
Loading
Loading
@@ -23,7 +23,7 @@ class AssemblaService < Service
]
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ class BambooService < CiService
'You must set up automatic revision labeling and a repository trigger in Bamboo.'
end
 
def to_param
def self.to_param
'bamboo'
end
 
Loading
Loading
@@ -56,10 +56,6 @@ class BambooService < CiService
]
end
 
def supported_events
%w(push)
end
def build_page(sha, ref)
with_reactive_cache(sha, ref) {|cached| cached[:build_page] }
end
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ class BugzillaService < IssueTrackerService
end
end
 
def to_param
def self.to_param
'bugzilla'
end
end
Loading
Loading
@@ -24,10 +24,6 @@ class BuildkiteService < CiService
hook.save
end
 
def supported_events
%w(push)
end
def execute(data)
return unless supported_events.include?(data[:object_kind])
 
Loading
Loading
@@ -54,7 +50,7 @@ class BuildkiteService < CiService
'Continuous integration and deployments'
end
 
def to_param
def self.to_param
'buildkite'
end
 
Loading
Loading
Loading
Loading
@@ -19,11 +19,11 @@ class BuildsEmailService < Service
'Email the builds status to a list of recipients.'
end
 
def to_param
def self.to_param
'builds_email'
end
 
def supported_events
def self.supported_events
%w(build)
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class CampfireService < Service
'Simple web-based real-time group chat'
end
 
def to_param
def self.to_param
'campfire'
end
 
Loading
Loading
@@ -24,7 +24,7 @@ class CampfireService < Service
]
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ class ChatNotificationService < Service
valid?
end
 
def supported_events
def self.supported_events
%w[push issue confidential_issue merge_request note tag_push
build pipeline wiki_page]
end
Loading
Loading
Loading
Loading
@@ -13,8 +13,8 @@ class ChatSlashCommandsService < Service
ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
end
 
def supported_events
[]
def self.supported_events
%w()
end
 
def can_test?
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ class CiService < Service
self.respond_to?(:token) && self.token.present? && ActiveSupport::SecurityUtils.variable_size_secure_compare(token, self.token)
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ class CustomIssueTrackerService < IssueTrackerService
end
end
 
def to_param
def self.to_param
'custom_issue_tracker'
end
 
Loading
Loading
Loading
Loading
@@ -5,8 +5,8 @@
class DeploymentService < Service
default_value_for :category, 'deployment'
 
def supported_events
[]
def self.supported_events
%w()
end
 
def predefined_variables
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ class DroneCiService < CiService
true
end
 
def supported_events
def self.supported_events
%w(push merge_request tag_push)
end
 
Loading
Loading
@@ -87,7 +87,7 @@ class DroneCiService < CiService
'Drone is a Continuous Integration platform built on Docker, written in Go'
end
 
def to_param
def self.to_param
'drone_ci'
end
 
Loading
Loading
Loading
Loading
@@ -12,11 +12,11 @@ class EmailsOnPushService < Service
'Email the commits and diff of each push to a list of recipients.'
end
 
def to_param
def self.to_param
'emails_on_push'
end
 
def supported_events
def self.supported_events
%w(push tag_push)
end
 
Loading
Loading
Loading
Loading
@@ -13,7 +13,7 @@ class ExternalWikiService < Service
'Replaces the link to the internal wiki with a link to an external wiki.'
end
 
def to_param
def self.to_param
'external_wiki'
end
 
Loading
Loading
@@ -29,4 +29,8 @@ class ExternalWikiService < Service
nil
end
end
def self.supported_events
%w()
end
end
Loading
Loading
@@ -12,7 +12,7 @@ class FlowdockService < Service
'Flowdock is a collaboration web app for technical teams.'
end
 
def to_param
def self.to_param
'flowdock'
end
 
Loading
Loading
@@ -22,7 +22,7 @@ class FlowdockService < Service
]
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class GemnasiumService < Service
'Gemnasium monitors your project dependencies and alerts you about updates and security vulnerabilities.'
end
 
def to_param
def self.to_param
'gemnasium'
end
 
Loading
Loading
@@ -23,7 +23,7 @@ class GemnasiumService < Service
]
end
 
def supported_events
def self.supported_events
%w(push)
end
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ class GitlabIssueTrackerService < IssueTrackerService
 
default_value_for :default, true
 
def to_param
def self.to_param
'gitlab'
end
 
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ class HipchatService < Service
'Private group chat and IM'
end
 
def to_param
def self.to_param
'hipchat'
end
 
Loading
Loading
@@ -45,7 +45,7 @@ class HipchatService < Service
]
end
 
def supported_events
def self.supported_events
%w(push issue confidential_issue merge_request note tag_push build)
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment