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
Léo-Paul Géneau
gitlab-ce
Commits
eacae005
Commit
eacae005
authored
Feb 22, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/MultilineHashBraceLayout
parent
99a34a52
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
98 additions
and
103 deletions
+98
-103
.rubocop.yml
.rubocop.yml
+1
-1
app/controllers/jwt_controller.rb
app/controllers/jwt_controller.rb
+4
-2
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+2
-1
app/models/project_services/chat_message/issue_message.rb
app/models/project_services/chat_message/issue_message.rb
+2
-1
app/models/project_services/irker_service.rb
app/models/project_services/irker_service.rb
+2
-1
app/models/project_services/kubernetes_service.rb
app/models/project_services/kubernetes_service.rb
+4
-8
app/models/project_services/pushover_service.rb
app/models/project_services/pushover_service.rb
+2
-4
lib/gitlab/ci/config/entry/environment.rb
lib/gitlab/ci/config/entry/environment.rb
+4
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+2
-1
spec/lib/expand_variables_spec.rb
spec/lib/expand_variables_spec.rb
+9
-18
spec/lib/gitlab/template/issue_template_spec.rb
spec/lib/gitlab/template/issue_template_spec.rb
+2
-1
spec/lib/gitlab/template/merge_request_template_spec.rb
spec/lib/gitlab/template/merge_request_template_spec.rb
+2
-1
spec/lib/mattermost/command_spec.rb
spec/lib/mattermost/command_spec.rb
+3
-3
spec/lib/mattermost/team_spec.rb
spec/lib/mattermost/team_spec.rb
+13
-12
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+2
-1
spec/models/project_services/drone_ci_service_spec.rb
spec/models/project_services/drone_ci_service_spec.rb
+3
-3
spec/models/project_services/mattermost_slash_commands_service_spec.rb
...roject_services/mattermost_slash_commands_service_spec.rb
+2
-1
spec/requests/lfs_http_spec.rb
spec/requests/lfs_http_spec.rb
+25
-32
spec/services/create_deployment_service_spec.rb
spec/services/create_deployment_service_spec.rb
+7
-4
spec/support/kubernetes_helpers.rb
spec/support/kubernetes_helpers.rb
+7
-6
No files found.
.rubocop.yml
View file @
eacae005
...
@@ -277,7 +277,7 @@ Style/MultilineBlockLayout:
...
@@ -277,7 +277,7 @@ Style/MultilineBlockLayout:
# Checks that the closing brace in a hash literal is either on the same line as
# Checks that the closing brace in a hash literal is either on the same line as
# the last hash element, or a new line.
# the last hash element, or a new line.
Style/MultilineHashBraceLayout
:
Style/MultilineHashBraceLayout
:
Enabled
:
fals
e
Enabled
:
tru
e
EnforcedStyle
:
symmetrical
EnforcedStyle
:
symmetrical
# Do not use then for multi-line if/unless.
# Do not use then for multi-line if/unless.
...
...
app/controllers/jwt_controller.rb
View file @
eacae005
...
@@ -39,7 +39,8 @@ class JwtController < ApplicationController
...
@@ -39,7 +39,8 @@ class JwtController < ApplicationController
message:
"HTTP Basic: Access denied
\n
"
\
message:
"HTTP Basic: Access denied
\n
"
\
"You have 2FA enabled, please use a personal access token for Git over HTTP.
\n
"
\
"You have 2FA enabled, please use a personal access token for Git over HTTP.
\n
"
\
"You can generate one at
#{
profile_personal_access_tokens_url
}
"
}
"You can generate one at
#{
profile_personal_access_tokens_url
}
"
}
]
},
status:
401
]
},
status:
401
end
end
def
render_unauthorized
def
render_unauthorized
...
@@ -47,7 +48,8 @@ class JwtController < ApplicationController
...
@@ -47,7 +48,8 @@ class JwtController < ApplicationController
errors:
[
errors:
[
{
code:
'UNAUTHORIZED'
,
{
code:
'UNAUTHORIZED'
,
message:
'HTTP Basic: Access denied'
}
message:
'HTTP Basic: Access denied'
}
]
},
status:
401
]
},
status:
401
end
end
def
auth_params
def
auth_params
...
...
app/controllers/snippets_controller.rb
View file @
eacae005
...
@@ -28,7 +28,8 @@ class SnippetsController < ApplicationController
...
@@ -28,7 +28,8 @@ class SnippetsController < ApplicationController
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
{
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
{
filter: :by_user
,
filter: :by_user
,
user:
@user
,
user:
@user
,
scope:
params
[
:scope
]
})
scope:
params
[
:scope
]
})
.
page
(
params
[
:page
])
.
page
(
params
[
:page
])
render
'index'
render
'index'
...
...
app/models/project_services/chat_message/issue_message.rb
View file @
eacae005
...
@@ -51,7 +51,8 @@ module ChatMessage
...
@@ -51,7 +51,8 @@ module ChatMessage
title:
issue_title
,
title:
issue_title
,
title_link:
issue_url
,
title_link:
issue_url
,
text:
format
(
description
),
text:
format
(
description
),
color:
"#C95823"
}]
color:
"#C95823"
}]
end
end
def
project_link
def
project_link
...
...
app/models/project_services/irker_service.rb
View file @
eacae005
...
@@ -33,7 +33,8 @@ class IrkerService < Service
...
@@ -33,7 +33,8 @@ class IrkerService < Service
end
end
def
settings
def
settings
{
server_host:
server_host
.
present?
?
server_host
:
'localhost'
,
{
server_host:
server_host
.
present?
?
server_host
:
'localhost'
,
server_port:
server_port
.
present?
?
server_port
:
6659
server_port:
server_port
.
present?
?
server_port
:
6659
}
}
end
end
...
...
app/models/project_services/kubernetes_service.rb
View file @
eacae005
...
@@ -62,23 +62,19 @@ class KubernetesService < DeploymentService
...
@@ -62,23 +62,19 @@ class KubernetesService < DeploymentService
{
type:
'text'
,
{
type:
'text'
,
name:
'namespace'
,
name:
'namespace'
,
title:
'Kubernetes namespace'
,
title:
'Kubernetes namespace'
,
placeholder:
'Kubernetes namespace'
,
placeholder:
'Kubernetes namespace'
},
},
{
type:
'text'
,
{
type:
'text'
,
name:
'api_url'
,
name:
'api_url'
,
title:
'API URL'
,
title:
'API URL'
,
placeholder:
'Kubernetes API URL, like https://kube.example.com/'
,
placeholder:
'Kubernetes API URL, like https://kube.example.com/'
},
},
{
type:
'text'
,
{
type:
'text'
,
name:
'token'
,
name:
'token'
,
title:
'Service token'
,
title:
'Service token'
,
placeholder:
'Service token'
,
placeholder:
'Service token'
},
},
{
type:
'textarea'
,
{
type:
'textarea'
,
name:
'ca_pem'
,
name:
'ca_pem'
,
title:
'Custom CA bundle'
,
title:
'Custom CA bundle'
,
placeholder:
'Certificate Authority bundle (PEM format)'
,
placeholder:
'Certificate Authority bundle (PEM format)'
},
},
]
]
end
end
...
...
app/models/project_services/pushover_service.rb
View file @
eacae005
...
@@ -29,8 +29,7 @@ class PushoverService < Service
...
@@ -29,8 +29,7 @@ class PushoverService < Service
[
'Normal Priority'
,
0
],
[
'Normal Priority'
,
0
],
[
'High Priority'
,
1
]
[
'High Priority'
,
1
]
],
],
default_choice:
0
default_choice:
0
},
},
{
type:
'select'
,
name:
'sound'
,
choices:
{
type:
'select'
,
name:
'sound'
,
choices:
[
[
[
'Device default sound'
,
nil
],
[
'Device default sound'
,
nil
],
...
@@ -56,8 +55,7 @@ class PushoverService < Service
...
@@ -56,8 +55,7 @@ class PushoverService < Service
[
'Pushover Echo (long)'
,
'echo'
],
[
'Pushover Echo (long)'
,
'echo'
],
[
'Up Down (long)'
,
'updown'
],
[
'Up Down (long)'
,
'updown'
],
[
'None (silent)'
,
'none'
]
[
'None (silent)'
,
'none'
]
]
]},
},
]
]
end
end
...
...
lib/gitlab/ci/config/entry/environment.rb
View file @
eacae005
...
@@ -21,12 +21,14 @@ module Gitlab
...
@@ -21,12 +21,14 @@ module Gitlab
validates
:name
,
validates
:name
,
type:
{
type:
{
with:
String
,
with:
String
,
message:
Gitlab
::
Regex
.
environment_name_regex_message
}
message:
Gitlab
::
Regex
.
environment_name_regex_message
}
validates
:name
,
validates
:name
,
format:
{
format:
{
with:
Gitlab
::
Regex
.
environment_name_regex
,
with:
Gitlab
::
Regex
.
environment_name_regex
,
message:
Gitlab
::
Regex
.
environment_name_regex_message
}
message:
Gitlab
::
Regex
.
environment_name_regex_message
}
with_options
if: :hash?
do
with_options
if: :hash?
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
eacae005
...
@@ -54,7 +54,8 @@ describe Projects::MergeRequestsController do
...
@@ -54,7 +54,8 @@ describe Projects::MergeRequestsController do
project_id:
fork_project
.
to_param
,
project_id:
fork_project
.
to_param
,
merge_request:
{
merge_request:
{
source_branch:
'remove-submodule'
,
source_branch:
'remove-submodule'
,
target_branch:
'master'
},
target_branch:
'master'
},
format:
format
format:
format
end
end
end
end
...
...
spec/lib/expand_variables_spec.rb
View file @
eacae005
...
@@ -7,58 +7,49 @@ describe ExpandVariables do
...
@@ -7,58 +7,49 @@ describe ExpandVariables do
tests
=
[
tests
=
[
{
value:
'key'
,
{
value:
'key'
,
result:
'key'
,
result:
'key'
,
variables:
[]
variables:
[]
},
},
{
value:
'key$variable'
,
{
value:
'key$variable'
,
result:
'key'
,
result:
'key'
,
variables:
[]
variables:
[]
},
},
{
value:
'key$variable'
,
{
value:
'key$variable'
,
result:
'keyvalue'
,
result:
'keyvalue'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
}
{
key:
'variable'
,
value:
'value'
}
]
]},
},
{
value:
'key${variable}'
,
{
value:
'key${variable}'
,
result:
'keyvalue'
,
result:
'keyvalue'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
}
{
key:
'variable'
,
value:
'value'
}
]
]},
},
{
value:
'key$variable$variable2'
,
{
value:
'key$variable$variable2'
,
result:
'keyvalueresult'
,
result:
'keyvalueresult'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable2'
,
value:
'result'
},
{
key:
'variable2'
,
value:
'result'
},
]
]},
},
{
value:
'key${variable}${variable2}'
,
{
value:
'key${variable}${variable2}'
,
result:
'keyvalueresult'
,
result:
'keyvalueresult'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable2'
,
value:
'result'
}
{
key:
'variable2'
,
value:
'result'
}
]
]},
},
{
value:
'key$variable2$variable'
,
{
value:
'key$variable2$variable'
,
result:
'keyresultvalue'
,
result:
'keyresultvalue'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable2'
,
value:
'result'
},
{
key:
'variable2'
,
value:
'result'
},
]
]},
},
{
value:
'key${variable2}${variable}'
,
{
value:
'key${variable2}${variable}'
,
result:
'keyresultvalue'
,
result:
'keyresultvalue'
,
variables:
[
variables:
[
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable'
,
value:
'value'
},
{
key:
'variable2'
,
value:
'result'
}
{
key:
'variable2'
,
value:
'result'
}
]
]},
},
{
value:
'review/$CI_BUILD_REF_NAME'
,
{
value:
'review/$CI_BUILD_REF_NAME'
,
result:
'review/feature/add-review-apps'
,
result:
'review/feature/add-review-apps'
,
variables:
[
variables:
[
{
key:
'CI_BUILD_REF_NAME'
,
value:
'feature/add-review-apps'
}
{
key:
'CI_BUILD_REF_NAME'
,
value:
'feature/add-review-apps'
}
]
]},
},
]
]
tests
.
each
do
|
test
|
tests
.
each
do
|
test
|
...
...
spec/lib/gitlab/template/issue_template_spec.rb
View file @
eacae005
...
@@ -11,7 +11,8 @@ describe Gitlab::Template::IssueTemplate do
...
@@ -11,7 +11,8 @@ describe Gitlab::Template::IssueTemplate do
create_template:
{
create_template:
{
user:
user
,
user:
user
,
access:
Gitlab
::
Access
::
MASTER
,
access:
Gitlab
::
Access
::
MASTER
,
path:
'issue_templates'
})
path:
'issue_templates'
})
end
end
describe
'.all'
do
describe
'.all'
do
...
...
spec/lib/gitlab/template/merge_request_template_spec.rb
View file @
eacae005
...
@@ -11,7 +11,8 @@ describe Gitlab::Template::MergeRequestTemplate do
...
@@ -11,7 +11,8 @@ describe Gitlab::Template::MergeRequestTemplate do
create_template:
{
create_template:
{
user:
user
,
user:
user
,
access:
Gitlab
::
Access
::
MASTER
,
access:
Gitlab
::
Access
::
MASTER
,
path:
'merge_request_templates'
})
path:
'merge_request_templates'
})
end
end
describe
'.all'
do
describe
'.all'
do
...
...
spec/lib/mattermost/command_spec.rb
View file @
eacae005
...
@@ -13,8 +13,7 @@ describe Mattermost::Command do
...
@@ -13,8 +13,7 @@ describe Mattermost::Command do
describe
'#create'
do
describe
'#create'
do
let
(
:params
)
do
let
(
:params
)
do
{
team_id:
'abc'
,
{
team_id:
'abc'
,
trigger:
'gitlab'
trigger:
'gitlab'
}
}
end
end
subject
{
described_class
.
new
(
nil
).
create
(
params
)
}
subject
{
described_class
.
new
(
nil
).
create
(
params
)
}
...
@@ -24,7 +23,8 @@ describe Mattermost::Command do
...
@@ -24,7 +23,8 @@ describe Mattermost::Command do
stub_request
(
:post
,
'http://mattermost.example.com/api/v3/teams/abc/commands/create'
)
stub_request
(
:post
,
'http://mattermost.example.com/api/v3/teams/abc/commands/create'
)
.
with
(
body:
{
.
with
(
body:
{
team_id:
'abc'
,
team_id:
'abc'
,
trigger:
'gitlab'
}.
to_json
)
trigger:
'gitlab'
}.
to_json
)
.
to_return
(
.
to_return
(
status:
200
,
status:
200
,
headers:
{
'Content-Type'
=>
'application/json'
},
headers:
{
'Content-Type'
=>
'application/json'
},
...
...
spec/lib/mattermost/team_spec.rb
View file @
eacae005
...
@@ -14,18 +14,19 @@ describe Mattermost::Team do
...
@@ -14,18 +14,19 @@ describe Mattermost::Team do
context
'for valid request'
do
context
'for valid request'
do
let
(
:response
)
do
let
(
:response
)
do
[{
[{
"id"
=>
"xiyro8huptfhdndadpz8r3wnbo"
,
"id"
=>
"xiyro8huptfhdndadpz8r3wnbo"
,
"create_at"
=>
1482174222155
,
"create_at"
=>
1482174222155
,
"update_at"
=>
1482174222155
,
"update_at"
=>
1482174222155
,
"delete_at"
=>
0
,
"delete_at"
=>
0
,
"display_name"
=>
"chatops"
,
"display_name"
=>
"chatops"
,
"name"
=>
"chatops"
,
"name"
=>
"chatops"
,
"email"
=>
"admin@example.com"
,
"email"
=>
"admin@example.com"
,
"type"
=>
"O"
,
"type"
=>
"O"
,
"company_name"
=>
""
,
"company_name"
=>
""
,
"allowed_domains"
=>
""
,
"allowed_domains"
=>
""
,
"invite_id"
=>
"o4utakb9jtb7imctdfzbf9r5ro"
,
"invite_id"
=>
"o4utakb9jtb7imctdfzbf9r5ro"
,
"allow_open_invite"
=>
false
}]
"allow_open_invite"
=>
false
}]
end
end
before
do
before
do
...
...
spec/models/environment_spec.rb
View file @
eacae005
...
@@ -76,7 +76,8 @@ describe Environment, models: true do
...
@@ -76,7 +76,8 @@ describe Environment, models: true do
end
end
describe
'#update_merge_request_metrics?'
do
describe
'#update_merge_request_metrics?'
do
{
'production'
=>
true
,
{
'production'
=>
true
,
'production/eu'
=>
true
,
'production/eu'
=>
true
,
'production/www.gitlab.com'
=>
true
,
'production/www.gitlab.com'
=>
true
,
'productioneu'
=>
false
,
'productioneu'
=>
false
,
...
...
spec/models/project_services/drone_ci_service_spec.rb
View file @
eacae005
...
@@ -95,12 +95,12 @@ describe DroneCiService, models: true, caching: true do
...
@@ -95,12 +95,12 @@ describe DroneCiService, models: true, caching: true do
is_expected
.
to
eq
(
:error
)
is_expected
.
to
eq
(
:error
)
end
end
{
"killed"
=>
:canceled
,
{
"killed"
=>
:canceled
,
"failure"
=>
:failed
,
"failure"
=>
:failed
,
"error"
=>
:failed
,
"error"
=>
:failed
,
"success"
=>
"success"
,
"success"
=>
"success"
}.
each
do
|
drone_status
,
our_status
|
}.
each
do
|
drone_status
,
our_status
|
it
"sets commit status to
#{
our_status
.
inspect
}
when returned status is
#{
drone_status
.
inspect
}
"
do
it
"sets commit status to
#{
our_status
.
inspect
}
when returned status is
#{
drone_status
.
inspect
}
"
do
stub_request
(
body:
%({"status":"#{drone_status}"})
)
stub_request
(
body:
%({"status":"#{drone_status}"})
)
...
...
spec/models/project_services/mattermost_slash_commands_service_spec.rb
View file @
eacae005
...
@@ -36,7 +36,8 @@ describe MattermostSlashCommandsService, :models do
...
@@ -36,7 +36,8 @@ describe MattermostSlashCommandsService, :models do
description:
"Perform common operations on:
#{
project
.
name_with_namespace
}
"
,
description:
"Perform common operations on:
#{
project
.
name_with_namespace
}
"
,
display_name:
"GitLab /
#{
project
.
name_with_namespace
}
"
,
display_name:
"GitLab /
#{
project
.
name_with_namespace
}
"
,
method:
'P'
,
method:
'P'
,
username:
'GitLab'
}.
to_json
)
username:
'GitLab'
}.
to_json
)
.
to_return
(
.
to_return
(
status:
200
,
status:
200
,
headers:
{
'Content-Type'
=>
'application/json'
},
headers:
{
'Content-Type'
=>
'application/json'
},
...
...
spec/requests/lfs_http_spec.rb
View file @
eacae005
...
@@ -25,11 +25,9 @@ describe 'Git LFS API and storage' do
...
@@ -25,11 +25,9 @@ describe 'Git LFS API and storage' do
{
{
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
},
},
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
],
],
'operation'
=>
'upload'
'operation'
=>
'upload'
}
}
...
@@ -53,11 +51,9 @@ describe 'Git LFS API and storage' do
...
@@ -53,11 +51,9 @@ describe 'Git LFS API and storage' do
{
{
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
},
},
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
],
],
'operation'
=>
'upload'
'operation'
=>
'upload'
}
}
...
@@ -378,8 +374,7 @@ describe 'Git LFS API and storage' do
...
@@ -378,8 +374,7 @@ describe 'Git LFS API and storage' do
'operation'
=>
'download'
,
'operation'
=>
'download'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
]
]
}
}
end
end
...
@@ -397,7 +392,8 @@ describe 'Git LFS API and storage' do
...
@@ -397,7 +392,8 @@ describe 'Git LFS API and storage' do
it
'with href to download'
do
it
'with href to download'
do
expect
(
json_response
).
to
eq
({
expect
(
json_response
).
to
eq
({
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
,
'size'
=>
sample_size
,
'actions'
=>
{
'actions'
=>
{
'download'
=>
{
'download'
=>
{
...
@@ -424,7 +420,8 @@ describe 'Git LFS API and storage' do
...
@@ -424,7 +420,8 @@ describe 'Git LFS API and storage' do
it
'with href to download'
do
it
'with href to download'
do
expect
(
json_response
).
to
eq
({
expect
(
json_response
).
to
eq
({
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
,
'size'
=>
sample_size
,
'error'
=>
{
'error'
=>
{
'code'
=>
404
,
'code'
=>
404
,
...
@@ -442,8 +439,7 @@ describe 'Git LFS API and storage' do
...
@@ -442,8 +439,7 @@ describe 'Git LFS API and storage' do
'operation'
=>
'download'
,
'operation'
=>
'download'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
}
}
]
]
}
}
end
end
...
@@ -455,7 +451,8 @@ describe 'Git LFS API and storage' do
...
@@ -455,7 +451,8 @@ describe 'Git LFS API and storage' do
it
'with an 404 for specific object'
do
it
'with an 404 for specific object'
do
expect
(
json_response
).
to
eq
({
expect
(
json_response
).
to
eq
({
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
,
'size'
=>
1575078
,
'error'
=>
{
'error'
=>
{
'code'
=>
404
,
'code'
=>
404
,
...
@@ -469,14 +466,13 @@ describe 'Git LFS API and storage' do
...
@@ -469,14 +466,13 @@ describe 'Git LFS API and storage' do
context
'when downloading one new and one existing lfs object'
do
context
'when downloading one new and one existing lfs object'
do
let
(
:body
)
do
let
(
:body
)
do
{
'operation'
=>
'download'
,
{
'operation'
=>
'download'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
},
},
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
]
]
}
}
end
end
...
@@ -617,7 +613,8 @@ describe 'Git LFS API and storage' do
...
@@ -617,7 +613,8 @@ describe 'Git LFS API and storage' do
it
'responds with status 200 and href to download'
do
it
'responds with status 200 and href to download'
do
expect
(
json_response
).
to
eq
({
expect
(
json_response
).
to
eq
({
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
,
'size'
=>
sample_size
,
'authenticated'
=>
true
,
'authenticated'
=>
true
,
'actions'
=>
{
'actions'
=>
{
...
@@ -651,8 +648,7 @@ describe 'Git LFS API and storage' do
...
@@ -651,8 +648,7 @@ describe 'Git LFS API and storage' do
'operation'
=>
'upload'
,
'operation'
=>
'upload'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
]
]
}
}
end
end
...
@@ -692,8 +688,7 @@ describe 'Git LFS API and storage' do
...
@@ -692,8 +688,7 @@ describe 'Git LFS API and storage' do
'operation'
=>
'upload'
,
'operation'
=>
'upload'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
}
}
]
]
}
}
end
end
...
@@ -713,14 +708,13 @@ describe 'Git LFS API and storage' do
...
@@ -713,14 +708,13 @@ describe 'Git LFS API and storage' do
context
'when pushing one new and one existing lfs object'
do
context
'when pushing one new and one existing lfs object'
do
let
(
:body
)
do
let
(
:body
)
do
{
'operation'
=>
'upload'
,
{
'operation'
=>
'upload'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
{
'oid'
=>
'91eff75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897'
,
'size'
=>
1575078
'size'
=>
1575078
},
},
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
]
]
}
}
end
end
...
@@ -818,8 +812,7 @@ describe 'Git LFS API and storage' do
...
@@ -818,8 +812,7 @@ describe 'Git LFS API and storage' do
'operation'
=>
'other'
,
'operation'
=>
'other'
,
'objects'
=>
[
'objects'
=>
[
{
'oid'
=>
sample_oid
,
{
'oid'
=>
sample_oid
,
'size'
=>
sample_size
'size'
=>
sample_size
}
}
]
]
}
}
end
end
...
...
spec/services/create_deployment_service_spec.rb
View file @
eacae005
...
@@ -9,7 +9,8 @@ describe CreateDeploymentService, services: true do
...
@@ -9,7 +9,8 @@ describe CreateDeploymentService, services: true do
describe
'#execute'
do
describe
'#execute'
do
let
(
:options
)
{
nil
}
let
(
:options
)
{
nil
}
let
(
:params
)
do
let
(
:params
)
do
{
environment:
'production'
,
{
environment:
'production'
,
ref:
'master'
,
ref:
'master'
,
tag:
false
,
tag:
false
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
,
...
@@ -83,10 +84,11 @@ describe CreateDeploymentService, services: true do
...
@@ -83,10 +84,11 @@ describe CreateDeploymentService, services: true do
context
'for environment with invalid name'
do
context
'for environment with invalid name'
do
let
(
:params
)
do
let
(
:params
)
do
{
environment:
'name,with,commas'
,
{
environment:
'name,with,commas'
,
ref:
'master'
,
ref:
'master'
,
tag:
false
,
tag:
false
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
}
}
end
end
...
@@ -101,7 +103,8 @@ describe CreateDeploymentService, services: true do
...
@@ -101,7 +103,8 @@ describe CreateDeploymentService, services: true do
context
'when variables are used'
do
context
'when variables are used'
do
let
(
:params
)
do
let
(
:params
)
do
{
environment:
'review-apps/$CI_BUILD_REF_NAME'
,
{
environment:
'review-apps/$CI_BUILD_REF_NAME'
,
ref:
'master'
,
ref:
'master'
,
tag:
false
,
tag:
false
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
,
sha:
'97de212e80737a608d939f648d959671fb0a0142'
,
...
...
spec/support/kubernetes_helpers.rb
View file @
eacae005
...
@@ -2,23 +2,24 @@ module KubernetesHelpers
...
@@ -2,23 +2,24 @@ module KubernetesHelpers
include
Gitlab
::
Kubernetes
include
Gitlab
::
Kubernetes
def
kube_discovery_body
def
kube_discovery_body
{
"kind"
=>
"APIResourceList"
,
{
"kind"
=>
"APIResourceList"
,
"resources"
=>
[
"resources"
=>
[
{
"name"
=>
"pods"
,
"namespaced"
=>
true
,
"kind"
=>
"Pod"
},
{
"name"
=>
"pods"
,
"namespaced"
=>
true
,
"kind"
=>
"Pod"
},
]
,
]
}
}
end
end
def
kube_pods_body
(
*
pods
)
def
kube_pods_body
(
*
pods
)
{
"kind"
=>
"PodList"
,
{
"kind"
=>
"PodList"
,
"items"
=>
[
kube_pod
],
"items"
=>
[
kube_pod
]
}
}
end
end
# This is a partial response, it will have many more elements in reality but
# This is a partial response, it will have many more elements in reality but
# these are the ones we care about at the moment
# these are the ones we care about at the moment
def
kube_pod
(
app:
"valid-pod-label"
)
def
kube_pod
(
app:
"valid-pod-label"
)
{
"metadata"
=>
{
{
"metadata"
=>
{
"name"
=>
"kube-pod"
,
"name"
=>
"kube-pod"
,
"creationTimestamp"
=>
"2016-11-25T19:55:19Z"
,
"creationTimestamp"
=>
"2016-11-25T19:55:19Z"
,
"labels"
=>
{
"app"
=>
app
},
"labels"
=>
{
"app"
=>
app
},
...
@@ -29,7 +30,7 @@ module KubernetesHelpers
...
@@ -29,7 +30,7 @@ module KubernetesHelpers
{
"name"
=>
"container-1"
},
{
"name"
=>
"container-1"
},
],
],
},
},
"status"
=>
{
"phase"
=>
"Running"
}
,
"status"
=>
{
"phase"
=>
"Running"
}
}
}
end
end
...
...
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