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
c72c76fd
Commit
c72c76fd
authored
Nov 18, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typos
parent
dd826a5f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
23 deletions
+13
-23
app/models/project_services/mattermost_command_service.rb
app/models/project_services/mattermost_command_service.rb
+1
-1
db/schema.rb
db/schema.rb
+4
-16
lib/mattermost/presenter.rb
lib/mattermost/presenter.rb
+4
-3
spec/lib/gitlab/chat_commands/command_spec.rb
spec/lib/gitlab/chat_commands/command_spec.rb
+4
-3
No files found.
app/models/project_services/mattermost_command_service.rb
View file @
c72c76fd
...
@@ -12,7 +12,7 @@ class MattermostCommandService < ChatService
...
@@ -12,7 +12,7 @@ class MattermostCommandService < ChatService
end
end
def
description
def
description
'Mattermost is an open source, self-hosted Slack-alternative'
"Perform common operations on GitLab in Mattermost"
end
end
def
to_param
def
to_param
...
...
db/schema.rb
View file @
c72c76fd
...
@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20161113184239) do
...
@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20161113184239) do
t
.
text
"help_page_text_html"
t
.
text
"help_page_text_html"
t
.
text
"shared_runners_text_html"
t
.
text
"shared_runners_text_html"
t
.
text
"after_sign_up_text_html"
t
.
text
"after_sign_up_text_html"
t
.
boolean
"sidekiq_throttling_enabled"
,
default:
false
t
.
string
"sidekiq_throttling_queues"
t
.
decimal
"sidekiq_throttling_factor"
t
.
boolean
"housekeeping_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_bitmaps_enabled"
,
default:
true
,
null:
false
t
.
boolean
"housekeeping_bitmaps_enabled"
,
default:
true
,
null:
false
t
.
integer
"housekeeping_incremental_repack_period"
,
default:
10
,
null:
false
t
.
integer
"housekeeping_incremental_repack_period"
,
default:
10
,
null:
false
t
.
integer
"housekeeping_full_repack_period"
,
default:
50
,
null:
false
t
.
integer
"housekeeping_full_repack_period"
,
default:
50
,
null:
false
t
.
integer
"housekeeping_gc_period"
,
default:
200
,
null:
false
t
.
integer
"housekeeping_gc_period"
,
default:
200
,
null:
false
t
.
boolean
"sidekiq_throttling_enabled"
,
default:
false
t
.
string
"sidekiq_throttling_queues"
t
.
decimal
"sidekiq_throttling_factor"
end
end
create_table
"audit_events"
,
force: :cascade
do
|
t
|
create_table
"audit_events"
,
force: :cascade
do
|
t
|
...
@@ -384,17 +384,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
...
@@ -384,17 +384,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
add_index
"ci_variables"
,
[
"gl_project_id"
],
name:
"index_ci_variables_on_gl_project_id"
,
using: :btree
add_index
"ci_variables"
,
[
"gl_project_id"
],
name:
"index_ci_variables_on_gl_project_id"
,
using: :btree
create_table
"custom_emoji"
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
t
.
string
"emoji"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"custom_emoji"
,
[
"project_id"
,
"name"
],
name:
"index_custom_emoji_on_project_id_and_name"
,
unique:
true
,
using: :btree
add_index
"custom_emoji"
,
[
"project_id"
],
name:
"index_custom_emoji_on_project_id"
,
using: :btree
create_table
"deploy_keys_projects"
,
force: :cascade
do
|
t
|
create_table
"deploy_keys_projects"
,
force: :cascade
do
|
t
|
t
.
integer
"deploy_key_id"
,
null:
false
t
.
integer
"deploy_key_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
...
@@ -941,7 +930,7 @@ ActiveRecord::Schema.define(version: 20161113184239) do
...
@@ -941,7 +930,7 @@ ActiveRecord::Schema.define(version: 20161113184239) do
t
.
boolean
"has_external_wiki"
t
.
boolean
"has_external_wiki"
t
.
boolean
"lfs_enabled"
t
.
boolean
"lfs_enabled"
t
.
text
"description_html"
t
.
text
"description_html"
t
.
boolean
"only_allow_merge_if_all_discussions_are_resolved"
,
default:
false
,
null:
false
t
.
boolean
"only_allow_merge_if_all_discussions_are_resolved"
end
end
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
...
@@ -1265,7 +1254,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
...
@@ -1265,7 +1254,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
add_index
"web_hooks"
,
[
"project_id"
],
name:
"index_web_hooks_on_project_id"
,
using: :btree
add_index
"web_hooks"
,
[
"project_id"
],
name:
"index_web_hooks_on_project_id"
,
using: :btree
add_foreign_key
"boards"
,
"projects"
add_foreign_key
"boards"
,
"projects"
add_foreign_key
"custom_emoji"
,
"projects"
add_foreign_key
"issue_metrics"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"issue_metrics"
,
"issues"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"labels"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"label_priorities"
,
"projects"
,
on_delete: :cascade
...
...
lib/mattermost/presenter.rb
View file @
c72c76fd
...
@@ -14,9 +14,10 @@ module Mattermost
...
@@ -14,9 +14,10 @@ module Mattermost
end
end
def
help
(
commands
,
trigger
)
def
help
(
commands
,
trigger
)
if
commands
.
zero
?
if
commands
.
none
?
ephemeral_response
(
"No commands configured"
)
ephemeral_response
(
"No commands configured"
)
else
else
commands
.
map!
{
|
command
|
"
#{
trigger
}
#{
command
}
"
}
message
=
header_with_list
(
"Available commands"
,
commands
)
message
=
header_with_list
(
"Available commands"
,
commands
)
ephemeral_response
(
message
)
ephemeral_response
(
message
)
...
@@ -46,7 +47,7 @@ module Mattermost
...
@@ -46,7 +47,7 @@ module Mattermost
private
private
def
not_found
def
not_found
ephemeral_response
(
"404 not found! GitLab couldn't find what you
r
were looking for! :boom:"
)
ephemeral_response
(
"404 not found! GitLab couldn't find what you were looking for! :boom:"
)
end
end
def
single_resource
(
resource
)
def
single_resource
(
resource
)
...
@@ -67,7 +68,7 @@ module Mattermost
...
@@ -67,7 +68,7 @@ module Mattermost
end
end
def
error
(
resource
)
def
error
(
resource
)
message
=
header_with_list
(
"The action was not succesful, because:"
,
resource
.
errors
.
messages
)
message
=
header_with_list
(
"The action was not succes
s
ful, because:"
,
resource
.
errors
.
messages
)
ephemeral_response
(
message
)
ephemeral_response
(
message
)
end
end
...
...
spec/lib/gitlab/chat_commands/command_spec.rb
View file @
c72c76fd
...
@@ -11,18 +11,19 @@ describe Gitlab::ChatCommands::Command, service: true do
...
@@ -11,18 +11,19 @@ describe Gitlab::ChatCommands::Command, service: true do
let
(
:params
)
{
{
text:
'issue show 1'
}
}
let
(
:params
)
{
{
text:
'issue show 1'
}
}
let
(
:project
)
{
create
(
:project
,
has_external_issue_tracker:
true
)
}
let
(
:project
)
{
create
(
:project
,
has_external_issue_tracker:
true
)
}
it
'displays
the help message
'
do
it
'displays
404 messages
'
do
expect
(
subject
[
:response_type
]).
to
be
(
:ephemeral
)
expect
(
subject
[
:response_type
]).
to
be
(
:ephemeral
)
expect
(
subject
[
:text
]).
to
start_with
(
'404 not found'
)
expect
(
subject
[
:text
]).
to
start_with
(
'404 not found'
)
end
end
end
end
context
'when an unknown command is triggered'
do
context
'when an unknown command is triggered'
do
let
(
:params
)
{
{
text:
"unknown command 123"
}
}
let
(
:params
)
{
{
command:
'/gitlab'
,
text:
"unknown command 123"
}
}
it
'displays the help message'
do
it
'displays the help message'
do
expect
(
subject
[
:response_type
]).
to
be
(
:ephemeral
)
expect
(
subject
[
:response_type
]).
to
be
(
:ephemeral
)
expect
(
subject
[
:text
]).
to
start_with
(
'Available commands'
)
expect
(
subject
[
:text
]).
to
start_with
(
'Available commands'
)
expect
(
subject
[
:text
]).
to
match
(
'/gitlab issue show'
)
end
end
end
end
...
@@ -35,7 +36,7 @@ describe Gitlab::ChatCommands::Command, service: true do
...
@@ -35,7 +36,7 @@ describe Gitlab::ChatCommands::Command, service: true do
end
end
end
end
context
'issue is succesfully created'
do
context
'issue is succes
s
fully created'
do
let
(
:params
)
{
{
text:
"issue create my new issue"
}
}
let
(
:params
)
{
{
text:
"issue create my new issue"
}
}
before
do
before
do
...
...
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