Commit 07d9b036 authored by Kukovskii Vladimir's avatar Kukovskii Vladimir

Add dummy Google Hangouts Chat integration

parent fabf6a56
......@@ -154,6 +154,7 @@ class Project < ActiveRecord::Base
has_one :mock_monitoring_service
has_one :microsoft_teams_service
has_one :packagist_service
has_one :hangouts_chat_service
# TODO: replace these relations with the fork network versions
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 @@ class Service < ActiveRecord::Base
emails_on_push
external_wiki
flowdock
hangouts_chat
hipchat
irker
jira
......
......@@ -368,6 +368,14 @@ module API
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' => [
{
required: true,
......@@ -688,6 +696,7 @@ module API
ExternalWikiService,
FlowdockService,
GemnasiumService,
HangoutsChatService,
HipchatService,
IrkerService,
JiraService,
......
......@@ -211,6 +211,7 @@ project:
- slack_service
- microsoft_teams_service
- mattermost_service
- hangouts_chat_service
- buildkite_service
- bamboo_service
- teamcity_service
......
......@@ -26,6 +26,7 @@ describe Project do
it { is_expected.to have_one(:slack_service) }
it { is_expected.to have_one(:microsoft_teams_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(:pushover_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