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
Jérome Perrin
gitlab-ce
Commits
fed29117
Commit
fed29117
authored
Dec 20, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename SlackNotificationService back to SlackService
parent
1139da27
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
16 additions
and
19 deletions
+16
-19
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_services/slack_service.rb
app/models/project_services/slack_service.rb
+2
-2
app/models/service.rb
app/models/service.rb
+1
-1
db/migrate/20141006143943_move_slack_service_to_webhook.rb
db/migrate/20141006143943_move_slack_service_to_webhook.rb
+1
-1
db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb
...958_change_slack_service_to_slack_notification_service.rb
+5
-8
lib/api/services.rb
lib/api/services.rb
+1
-1
spec/features/projects/import_export/test_project_export.tar.gz
...eatures/projects/import_export/test_project_export.tar.gz
+0
-0
spec/features/projects/services/slack_service_spec.rb
spec/features/projects/services/slack_service_spec.rb
+2
-2
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-1
spec/models/project_services/slack_service_spec.rb
spec/models/project_services/slack_service_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
fed29117
...
...
@@ -96,7 +96,7 @@ class Project < ActiveRecord::Base
has_one
:mattermost_slash_commands_service
,
dependent: :destroy
has_one
:mattermost_notification_service
,
dependent: :destroy
has_one
:slack_slash_commands_service
,
dependent: :destroy
has_one
:slack_
notification_
service
,
dependent: :destroy
has_one
:slack_service
,
dependent: :destroy
has_one
:buildkite_service
,
dependent: :destroy
has_one
:bamboo_service
,
dependent: :destroy
has_one
:teamcity_service
,
dependent: :destroy
...
...
app/models/project_services/slack_
notification_
service.rb
→
app/models/project_services/slack_service.rb
View file @
fed29117
class
Slack
Notification
Service
<
ChatNotificationService
class
SlackService
<
ChatNotificationService
def
title
'Slack notifications'
end
...
...
@@ -8,7 +8,7 @@ class SlackNotificationService < ChatNotificationService
end
def
to_param
'slack
_notification
'
'slack'
end
def
help
...
...
app/models/service.rb
View file @
fed29117
...
...
@@ -222,7 +222,7 @@ class Service < ActiveRecord::Base
pushover
redmine
slack_slash_commands
slack
_notification
slack
teamcity
]
end
...
...
db/migrate/20141006143943_move_slack_service_to_webhook.rb
View file @
fed29117
...
...
@@ -5,7 +5,7 @@ class MoveSlackServiceToWebhook < ActiveRecord::Migration
DOWNTIME_REASON
=
'Move old fields "token" and "subdomain" to one single field "webhook"'
def
change
Slack
Notification
Service
.
all
.
each
do
|
slack_service
|
SlackService
.
all
.
each
do
|
slack_service
|
if
[
"token"
,
"subdomain"
].
all?
{
|
property
|
slack_service
.
properties
.
key?
property
}
token
=
slack_service
.
properties
[
'token'
]
subdomain
=
slack_service
.
properties
[
'subdomain'
]
...
...
db/migrate/20161213172958_change_slack_service_to_slack_notification_service.rb
View file @
fed29117
class
ChangeSlackServiceToSlackNotificationService
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME_REASON
=
'Rename SlackService to SlackNotificationService'
DOWNTIME
=
false
def
up
execute
(
"UPDATE services SET type = 'SlackNotificationService' WHERE type = 'SlackService'"
)
end
def
down
execute
(
"UPDATE services SET type = 'SlackService' WHERE type = 'SlackNotificationService'"
)
# This migration is a no-op, as it existed in an RC but we renamed
# SlackNotificationService back to SlackService:
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8191#note_20310845
def
change
end
end
lib/api/services.rb
View file @
fed29117
...
...
@@ -480,7 +480,7 @@ module API
desc:
'The description of the tracker'
}
],
'slack
-notification
'
=>
[
'slack'
=>
[
{
required:
true
,
name: :webhook
,
...
...
spec/features/projects/import_export/test_project_export.tar.gz
View file @
fed29117
No preview for this file type
spec/features/projects/services/slack_service_spec.rb
View file @
fed29117
...
...
@@ -2,8 +2,8 @@ require 'spec_helper'
feature
'Projects > Slack service > Setup events'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:service
)
{
Slack
Notification
Service
.
new
}
let
(
:project
)
{
create
(
:project
,
slack_
notification_
service:
service
)
}
let
(
:service
)
{
SlackService
.
new
}
let
(
:project
)
{
create
(
:project
,
slack_service:
service
)
}
background
do
service
.
fields
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
fed29117
...
...
@@ -137,7 +137,7 @@ project:
-
assembla_service
-
asana_service
-
gemnasium_service
-
slack_
notification_
service
-
slack_service
-
mattermost_notification_service
-
buildkite_service
-
bamboo_service
...
...
spec/models/project_services/slack_
notification_
service_spec.rb
→
spec/models/project_services/slack_service_spec.rb
View file @
fed29117
require
'spec_helper'
describe
Slack
Notification
Service
,
models:
true
do
describe
SlackService
,
models:
true
do
it_behaves_like
"slack or mattermost notifications"
end
spec/models/project_spec.rb
View file @
fed29117
...
...
@@ -21,7 +21,7 @@ describe Project, models: true do
it
{
is_expected
.
to
have_many
(
:hooks
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_many
(
:protected_branches
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:forked_project_link
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:slack_
notification_
service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:slack_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:mattermost_notification_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:pushover_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:asana_service
).
dependent
(
:destroy
)
}
...
...
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