Commit 73cac8fe authored by Kukovskii Vladimir's avatar Kukovskii Vladimir
Browse files

Add dummy Google Hangouts Chat integration

parent e603cc0b61b8
...@@ -154,6 +154,7 @@ class Project < ActiveRecord::Base ...@@ -154,6 +154,7 @@ class Project < ActiveRecord::Base
has_one :mock_monitoring_service has_one :mock_monitoring_service
has_one :microsoft_teams_service has_one :microsoft_teams_service
has_one :packagist_service has_one :packagist_service
has_one :hangouts_chat_service
# TODO: replace these relations with the fork network versions # TODO: replace these relations with the fork network versions
has_one :forked_project_link, foreign_key: "forked_to_project_id" has_one :forked_project_link, foreign_key: "forked_to_project_id"
......
class HangoutsChatService < ChatNotificationService
def title
'Hangouts Chat'
end
def description
'Receive event notifications in Google Hangouts Chat'
end
def self.to_param
'hangouts_chat'
end
def help
'This service sends notifications about projects events to Google Hangouts Chat room.<br />
To set up this service:
<ol>
<li><a href="https://developers.google.com/hangouts/chat/how-tos/webhooks">Set up an incoming webhook for your room</a>. All notifications will come to this room.</li>
<li>Paste the <strong>Webhook URL</strong> into the field below.</li>
<li>Select events below to enable notifications.</li>
</ol>'
end
def event_field(event)
end
def default_channel_placeholder
end
def webhook_placeholder
'https://chat.googleapis.com/v1/spaces…'
end
def default_fields
[
{ type: 'text', name: 'webhook', placeholder: "e.g. #{webhook_placeholder}" },
{ type: 'checkbox', name: 'notify_only_broken_pipelines' },
{ type: 'checkbox', name: 'notify_only_default_branch' }
]
end
end
...@@ -254,6 +254,7 @@ def self.available_services_names ...@@ -254,6 +254,7 @@ def self.available_services_names
emails_on_push emails_on_push
external_wiki external_wiki
flowdock flowdock
hangouts_chat
hipchat hipchat
irker irker
jira jira
......
...@@ -368,6 +368,14 @@ class Services < Grape::API ...@@ -368,6 +368,14 @@ class Services < Grape::API
desc: "The project's slug on gemnasium.com" desc: "The project's slug on gemnasium.com"
} }
], ],
'hangouts-chat' => [
{
required: true,
name: :webhook,
type: String,
desc: 'The Hangouts Chat webhook. e.g. https://chat.googleapis.com/v1/spaces…'
}
],
'hipchat' => [ 'hipchat' => [
{ {
required: true, required: true,
...@@ -688,6 +696,7 @@ class Services < Grape::API ...@@ -688,6 +696,7 @@ class Services < Grape::API
ExternalWikiService, ExternalWikiService,
FlowdockService, FlowdockService,
GemnasiumService, GemnasiumService,
HangoutsChatService,
HipchatService, HipchatService,
IrkerService, IrkerService,
JiraService, JiraService,
......
...@@ -211,6 +211,7 @@ project: ...@@ -211,6 +211,7 @@ project:
- slack_service - slack_service
- microsoft_teams_service - microsoft_teams_service
- mattermost_service - mattermost_service
- hangouts_chat_service
- buildkite_service - buildkite_service
- bamboo_service - bamboo_service
- teamcity_service - teamcity_service
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
it { is_expected.to have_one(:slack_service) } it { is_expected.to have_one(:slack_service) }
it { is_expected.to have_one(:microsoft_teams_service) } it { is_expected.to have_one(:microsoft_teams_service) }
it { is_expected.to have_one(:mattermost_service) } it { is_expected.to have_one(:mattermost_service) }
it { is_expected.to have_one(:hangouts_chat_service) }
it { is_expected.to have_one(:packagist_service) } it { is_expected.to have_one(:packagist_service) }
it { is_expected.to have_one(:pushover_service) } it { is_expected.to have_one(:pushover_service) }
it { is_expected.to have_one(:asana_service) } it { is_expected.to have_one(:asana_service) }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment