Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GitLab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
projects.thm.de
GitLab
Commits
7d4b52b2
Commit
7d4b52b2
authored
Feb 22, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/WordArray
parent
eacae005
Changes
69
Hide whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
159 additions
and
164 deletions
+159
-164
.rubocop.yml
.rubocop.yml
+1
-1
app/finders/todos_finder.rb
app/finders/todos_finder.rb
+1
-1
app/helpers/emails_helper.rb
app/helpers/emails_helper.rb
+1
-1
app/helpers/tab_helper.rb
app/helpers/tab_helper.rb
+1
-1
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
app/models/diff_note.rb
app/models/diff_note.rb
+1
-1
app/models/event.rb
app/models/event.rb
+1
-1
app/models/note.rb
app/models/note.rb
+1
-1
app/models/project_services/drone_ci_service.rb
app/models/project_services/drone_ci_service.rb
+1
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+1
-1
app/models/project_services/pushover_service.rb
app/models/project_services/pushover_service.rb
+11
-11
app/services/projects/download_service.rb
app/services/projects/download_service.rb
+1
-1
config/initializers/health_check.rb
config/initializers/health_check.rb
+2
-2
config/initializers/metrics.rb
config/initializers/metrics.rb
+7
-7
db/migrate/20161128142110_remove_unnecessary_indexes.rb
db/migrate/20161128142110_remove_unnecessary_indexes.rb
+2
-2
features/steps/project/builds/artifacts.rb
features/steps/project/builds/artifacts.rb
+1
-1
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+1
-1
lib/api/commits.rb
lib/api/commits.rb
+1
-1
lib/api/pipelines.rb
lib/api/pipelines.rb
+1
-1
lib/api/runners.rb
lib/api/runners.rb
+1
-1
lib/api/v3/commits.rb
lib/api/v3/commits.rb
+1
-1
lib/ci/api/helpers.rb
lib/ci/api/helpers.rb
+1
-1
lib/gitlab/template/gitlab_ci_yml_template.rb
lib/gitlab/template/gitlab_ci_yml_template.rb
+1
-1
lib/gitlab/url_sanitizer.rb
lib/gitlab/url_sanitizer.rb
+1
-1
spec/controllers/profiles/personal_access_tokens_spec.rb
spec/controllers/profiles/personal_access_tokens_spec.rb
+2
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+1
-1
spec/features/issues/bulk_assignment_labels_spec.rb
spec/features/issues/bulk_assignment_labels_spec.rb
+3
-3
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+1
-1
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
...eatures/projects/labels/issues_sorted_by_priority_spec.rb
+2
-2
spec/helpers/auth_helper_spec.rb
spec/helpers/auth_helper_spec.rb
+1
-1
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+1
-1
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+1
-1
spec/lib/bitbucket/collection_spec.rb
spec/lib/bitbucket/collection_spec.rb
+1
-1
spec/lib/bitbucket/representation/repo_spec.rb
spec/lib/bitbucket/representation/repo_spec.rb
+1
-1
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+17
-17
spec/lib/extracts_path_spec.rb
spec/lib/extracts_path_spec.rb
+2
-2
spec/lib/gitlab/ci/config/entry/commands_spec.rb
spec/lib/gitlab/ci/config/entry/commands_spec.rb
+1
-1
spec/lib/gitlab/ci/config/entry/factory_spec.rb
spec/lib/gitlab/ci/config/entry/factory_spec.rb
+5
-5
spec/lib/gitlab/ci/config/entry/global_spec.rb
spec/lib/gitlab/ci/config/entry/global_spec.rb
+5
-5
spec/lib/gitlab/ci/config/entry/script_spec.rb
spec/lib/gitlab/ci/config/entry/script_spec.rb
+1
-1
spec/lib/gitlab/conflict/file_spec.rb
spec/lib/gitlab/conflict/file_spec.rb
+2
-2
spec/lib/gitlab/git/blob_snippet_spec.rb
spec/lib/gitlab/git/blob_snippet_spec.rb
+1
-1
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+1
-1
spec/lib/gitlab/import_export/attribute_configuration_spec.rb
.../lib/gitlab/import_export/attribute_configuration_spec.rb
+1
-1
spec/lib/gitlab/import_export/model_configuration_spec.rb
spec/lib/gitlab/import_export/model_configuration_spec.rb
+1
-1
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+1
-1
spec/lib/gitlab/import_sources_spec.rb
spec/lib/gitlab/import_sources_spec.rb
+17
-19
spec/lib/gitlab/ldap/auth_hash_spec.rb
spec/lib/gitlab/ldap/auth_hash_spec.rb
+1
-1
spec/models/application_setting_spec.rb
spec/models/application_setting_spec.rb
+3
-3
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+8
-8
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+4
-4
spec/models/merge_request_diff_spec.rb
spec/models/merge_request_diff_spec.rb
+1
-1
spec/models/project_services/irker_service_spec.rb
spec/models/project_services/irker_service_spec.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-1
spec/requests/api/labels_spec.rb
spec/requests/api/labels_spec.rb
+4
-5
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+1
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
spec/requests/api/v3/issues_spec.rb
spec/requests/api/v3/issues_spec.rb
+1
-1
spec/requests/api/v3/labels_spec.rb
spec/requests/api/v3/labels_spec.rb
+4
-5
spec/requests/api/v3/merge_requests_spec.rb
spec/requests/api/v3/merge_requests_spec.rb
+1
-1
spec/requests/api/v3/projects_spec.rb
spec/requests/api/v3/projects_spec.rb
+1
-1
spec/requests/ci/api/builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+1
-1
spec/requests/ci/api/runners_spec.rb
spec/requests/ci/api/runners_spec.rb
+1
-1
spec/services/auth/container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+1
-1
spec/services/merge_requests/resolve_service_spec.rb
spec/services/merge_requests/resolve_service_spec.rb
+4
-4
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
spec/support/repo_helpers.rb
spec/support/repo_helpers.rb
+6
-7
No files found.
.rubocop.yml
View file @
7d4b52b2
...
...
@@ -491,7 +491,7 @@ Style/WhileUntilModifier:
# Use %w or %W for arrays of words.
Style/WordArray
:
Enabled
:
fals
e
Enabled
:
tru
e
# Metrics #####################################################################
...
...
app/finders/todos_finder.rb
View file @
7d4b52b2
...
...
@@ -99,7 +99,7 @@ def projects(items)
end
def
type?
type
.
present?
&&
[
'Issue'
,
'MergeRequest'
]
.
include?
(
type
)
type
.
present?
&&
%w(Issue MergeRequest)
.
include?
(
type
)
end
def
type
...
...
app/helpers/emails_helper.rb
View file @
7d4b52b2
...
...
@@ -24,7 +24,7 @@ def email_action(url)
def
action_title
(
url
)
return
unless
url
[
"merge_requests"
,
"issues"
,
"commit"
]
.
each
do
|
action
|
%w(merge_requests issues commit)
.
each
do
|
action
|
if
url
.
split
(
"/"
).
include?
(
action
)
return
"View
#{
action
.
humanize
.
singularize
}
"
end
...
...
app/helpers/tab_helper.rb
View file @
7d4b52b2
...
...
@@ -99,7 +99,7 @@ def project_tab_class
return
'active'
end
if
[
'services'
,
'hooks'
,
'deploy_keys'
,
'protected_branches'
]
.
include?
controller
.
controller_name
if
%w(services hooks deploy_keys protected_branches)
.
include?
controller
.
controller_name
"active"
end
end
...
...
app/helpers/todos_helper.rb
View file @
7d4b52b2
...
...
@@ -150,6 +150,6 @@ def todo_due_date(todo)
private
def
show_todo_state?
(
todo
)
(
todo
.
target
.
is_a?
(
MergeRequest
)
||
todo
.
target
.
is_a?
(
Issue
))
&&
[
'closed'
,
'merged'
]
.
include?
(
todo
.
target
.
state
)
(
todo
.
target
.
is_a?
(
MergeRequest
)
||
todo
.
target
.
is_a?
(
Issue
))
&&
%w(closed merged)
.
include?
(
todo
.
target
.
state
)
end
end
app/models/concerns/issuable.rb
View file @
7d4b52b2
...
...
@@ -182,7 +182,7 @@ def with_label(title, sort = nil)
def
grouping_columns
(
sort
)
grouping_columns
=
[
arel_table
[
:id
]]
if
[
"milestone_due_desc"
,
"milestone_due_asc"
]
.
include?
(
sort
)
if
%w(milestone_due_desc milestone_due_asc)
.
include?
(
sort
)
milestone_table
=
Milestone
.
arel_table
grouping_columns
<<
milestone_table
[
:id
]
grouping_columns
<<
milestone_table
[
:due_date
]
...
...
app/models/diff_note.rb
View file @
7d4b52b2
...
...
@@ -8,7 +8,7 @@ class DiffNote < Note
validates
:position
,
presence:
true
validates
:diff_line
,
presence:
true
validates
:line_code
,
presence:
true
,
line_code:
true
validates
:noteable_type
,
inclusion:
{
in:
[
'Commit'
,
'MergeRequest'
]
}
validates
:noteable_type
,
inclusion:
{
in:
%w(Commit MergeRequest)
}
validates
:resolved_by
,
presence:
true
,
if: :resolved?
validate
:positions_complete
validate
:verify_supported
...
...
app/models/event.rb
View file @
7d4b52b2
...
...
@@ -47,7 +47,7 @@ class << self
def
contributions
where
(
"action = ? OR (target_type IN (?) AND action IN (?)) OR (target_type = ? AND action = ?)"
,
Event
::
PUSHED
,
[
"MergeRequest"
,
"Issue"
]
,
[
Event
::
CREATED
,
Event
::
CLOSED
,
Event
::
MERGED
],
%w(MergeRequest Issue)
,
[
Event
::
CREATED
,
Event
::
CLOSED
,
Event
::
MERGED
],
"Note"
,
Event
::
COMMENTED
)
end
...
...
app/models/note.rb
View file @
7d4b52b2
...
...
@@ -72,7 +72,7 @@ class Note < ActiveRecord::Base
scope
:inc_author
,
->
{
includes
(
:author
)
}
scope
:inc_relations_for_view
,
->
{
includes
(
:project
,
:author
,
:updated_by
,
:resolved_by
,
:award_emoji
)
}
scope
:diff_notes
,
->
{
where
(
type:
[
'LegacyDiffNote'
,
'DiffNote'
]
)
}
scope
:diff_notes
,
->
{
where
(
type:
%w(LegacyDiffNote DiffNote)
)
}
scope
:non_diff_notes
,
->
{
where
(
type:
[
'Note'
,
nil
])
}
scope
:with_associations
,
->
do
...
...
app/models/project_services/drone_ci_service.rb
View file @
7d4b52b2
...
...
@@ -114,7 +114,7 @@ def push_valid?(data)
end
def
merge_request_valid?
(
data
)
[
'opened'
,
'reopened'
]
.
include?
(
data
[
:object_attributes
][
:state
])
&&
%w(opened reopened)
.
include?
(
data
[
:object_attributes
][
:state
])
&&
data
[
:object_attributes
][
:merge_status
]
==
'unchecked'
end
end
app/models/project_services/hipchat_service.rb
View file @
7d4b52b2
...
...
@@ -36,7 +36,7 @@ def fields
{
type:
'text'
,
name:
'token'
,
placeholder:
'Room token'
},
{
type:
'text'
,
name:
'room'
,
placeholder:
'Room name or ID'
},
{
type:
'checkbox'
,
name:
'notify'
},
{
type:
'select'
,
name:
'color'
,
choices:
[
'yellow'
,
'red'
,
'green'
,
'purple'
,
'gray'
,
'random'
]
},
{
type:
'select'
,
name:
'color'
,
choices:
%w(yellow red green purple gray random)
},
{
type:
'text'
,
name:
'api_version'
,
placeholder:
'Leave blank for default (v2)'
},
{
type:
'text'
,
name:
'server'
,
...
...
app/models/project_services/pushover_service.rb
View file @
7d4b52b2
...
...
@@ -34,19 +34,19 @@ def fields
[
[
'Device default sound'
,
nil
],
[
'Pushover (default)'
,
'pushover'
],
[
'Bike'
,
'bike'
]
,
[
'Bugle'
,
'bugle'
]
,
%w(Bike bike)
,
%w(Bugle bugle)
,
[
'Cash Register'
,
'cashregister'
],
[
'Classical'
,
'classical'
]
,
[
'Cosmic'
,
'cosmic'
]
,
[
'Falling'
,
'falling'
]
,
[
'Gamelan'
,
'gamelan'
]
,
[
'Incoming'
,
'incoming'
]
,
[
'Intermission'
,
'intermission'
]
,
[
'Magic'
,
'magic'
]
,
[
'Mechanical'
,
'mechanical'
]
,
%w(Classical classical)
,
%w(Cosmic cosmic)
,
%w(Falling falling)
,
%w(Gamelan gamelan)
,
%w(Incoming incoming)
,
%w(Intermission intermission)
,
%w(Magic magic)
,
%w(Mechanical mechanical)
,
[
'Piano Bar'
,
'pianobar'
],
[
'Siren'
,
'siren'
]
,
%w(Siren siren)
,
[
'Space Alarm'
,
'spacealarm'
],
[
'Tug Boat'
,
'tugboat'
],
[
'Alien Alarm (long)'
,
'alien'
],
...
...
app/services/projects/download_service.rb
View file @
7d4b52b2
...
...
@@ -25,7 +25,7 @@ def valid_url?(url)
end
def
http?
(
url
)
url
=~
/\A
#{
URI
.
regexp
(
[
'http'
,
'https'
]
)
}
\z/
url
=~
/\A
#{
URI
.
regexp
(
%w(http https)
)
}
\z/
end
def
valid_domain?
(
url
)
...
...
config/initializers/health_check.rb
View file @
7d4b52b2
HealthCheck
.
setup
do
|
config
|
config
.
standard_checks
=
[
'database'
,
'migrations'
,
'cache'
]
config
.
full_checks
=
[
'database'
,
'migrations'
,
'cache'
]
config
.
standard_checks
=
%w(database migrations cache)
config
.
full_checks
=
%w(database migrations cache)
end
config/initializers/metrics.rb
View file @
7d4b52b2
...
...
@@ -20,13 +20,13 @@ def instrument_classes(instrumentation)
# Path to search => prefix to strip from constant
paths_to_instrument
=
{
[
'app'
,
'finders'
]
=>
[
'app'
,
'finders'
]
,
[
'app'
,
'mailers'
,
'emails'
]
=>
[
'app'
,
'mailers'
]
,
[
'app'
,
'services'
,
'**'
]
=>
[
'app'
,
'services'
]
,
[
'lib'
,
'gitlab'
,
'conflicts'
]
=>
[
'lib'
],
[
'lib'
,
'gitlab'
,
'diff'
]
=>
[
'lib'
],
[
'lib'
,
'gitlab'
,
'email'
,
'message'
]
=>
[
'lib'
],
[
'lib'
,
'gitlab'
,
'checks'
]
=>
[
'lib'
]
%w(app finders)
=>
%w(app finders)
,
%w(app mailers emails)
=>
%w(app mailers)
,
[
'app'
,
'services'
,
'**'
]
=>
%w(app services)
,
%w(lib gitlab conflicts)
=>
[
'lib'
],
%w(lib gitlab diff)
=>
[
'lib'
],
%w(lib gitlab email message)
=>
[
'lib'
],
%w(lib gitlab checks)
=>
[
'lib'
]
}
paths_to_instrument
.
each
do
|
(
path
,
prefix
)
|
...
...
db/migrate/20161128142110_remove_unnecessary_indexes.rb
View file @
7d4b52b2
...
...
@@ -12,7 +12,7 @@ def up
remove_index
:award_emoji
,
column: :user_id
if
index_exists?
(
:award_emoji
,
:user_id
)
remove_index
:ci_builds
,
column: :commit_id
if
index_exists?
(
:ci_builds
,
:commit_id
)
remove_index
:deployments
,
column: :project_id
if
index_exists?
(
:deployments
,
:project_id
)
remove_index
:deployments
,
column:
[
"project_id"
,
"environment_id"
]
if
index_exists?
(
:deployments
,
[
"project_id"
,
"environment_id"
]
)
remove_index
:deployments
,
column:
%w(project_id environment_id)
if
index_exists?
(
:deployments
,
%w(project_id environment_id)
)
remove_index
:lists
,
column: :board_id
if
index_exists?
(
:lists
,
:board_id
)
remove_index
:milestones
,
column: :project_id
if
index_exists?
(
:milestones
,
:project_id
)
remove_index
:notes
,
column: :project_id
if
index_exists?
(
:notes
,
:project_id
)
...
...
@@ -24,7 +24,7 @@ def down
add_concurrent_index
:award_emoji
,
:user_id
add_concurrent_index
:ci_builds
,
:commit_id
add_concurrent_index
:deployments
,
:project_id
add_concurrent_index
:deployments
,
[
"project_id"
,
"environment_id"
]
add_concurrent_index
:deployments
,
%w(project_id environment_id)
add_concurrent_index
:lists
,
:board_id
add_concurrent_index
:milestones
,
:project_id
add_concurrent_index
:notes
,
:project_id
...
...
features/steps/project/builds/artifacts.rb
View file @
7d4b52b2
...
...
@@ -76,7 +76,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
base64_params
=
send_data
.
sub
(
/\Aartifacts\-entry:/
,
''
)
params
=
JSON
.
parse
(
Base64
.
urlsafe_decode64
(
base64_params
))
expect
(
params
.
keys
).
to
eq
(
[
'Archive'
,
'Entry'
]
)
expect
(
params
.
keys
).
to
eq
(
%w(Archive Entry)
)
expect
(
params
[
'Archive'
]).
to
end_with
(
'build_artifacts.zip'
)
expect
(
params
[
'Entry'
]).
to
eq
(
Base64
.
encode64
(
'ci_artifacts.txt'
))
end
...
...
lib/api/commit_statuses.rb
View file @
7d4b52b2
...
...
@@ -40,7 +40,7 @@ class CommitStatuses < Grape::API
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:sha
,
type:
String
,
desc:
'The commit hash'
requires
:state
,
type:
String
,
desc:
'The state of the status'
,
values:
[
'pending'
,
'running'
,
'success'
,
'failed'
,
'canceled'
]
values:
%w(pending running success failed canceled)
optional
:ref
,
type:
String
,
desc:
'The ref'
optional
:target_url
,
type:
String
,
desc:
'The target URL to associate with this status'
optional
:description
,
type:
String
,
desc:
'A short description of the status'
...
...
lib/api/commits.rb
View file @
7d4b52b2
...
...
@@ -157,7 +157,7 @@ class Commits < Grape::API
optional
:path
,
type:
String
,
desc:
'The file path'
given
:path
do
requires
:line
,
type:
Integer
,
desc:
'The line number'
requires
:line_type
,
type:
String
,
values:
[
'new'
,
'old'
]
,
default:
'new'
,
desc:
'The type of the line'
requires
:line_type
,
type:
String
,
values:
%w(new old)
,
default:
'new'
,
desc:
'The type of the line'
end
end
post
':id/repository/commits/:sha/comments'
do
...
...
lib/api/pipelines.rb
View file @
7d4b52b2
...
...
@@ -14,7 +14,7 @@ class Pipelines < Grape::API
end
params
do
use
:pagination
optional
:scope
,
type:
String
,
values:
[
'running'
,
'branches'
,
'tags'
]
,
optional
:scope
,
type:
String
,
values:
%w(running branches tags)
,
desc:
'Either running, branches, or tags'
end
get
':id/pipelines'
do
...
...
lib/api/runners.rb
View file @
7d4b52b2
...
...
@@ -14,7 +14,7 @@ class Runners < Grape::API
use
:pagination
end
get
do
runners
=
filter_runners
(
current_user
.
ci_authorized_runners
,
params
[
:scope
],
without:
[
'specific'
,
'shared'
]
)
runners
=
filter_runners
(
current_user
.
ci_authorized_runners
,
params
[
:scope
],
without:
%w(specific shared)
)
present
paginate
(
runners
),
with:
Entities
::
Runner
end
...
...
lib/api/v3/commits.rb
View file @
7d4b52b2
...
...
@@ -162,7 +162,7 @@ class Commits < Grape::API
optional
:path
,
type:
String
,
desc:
'The file path'
given
:path
do
requires
:line
,
type:
Integer
,
desc:
'The line number'
requires
:line_type
,
type:
String
,
values:
[
'new'
,
'old'
]
,
default:
'new'
,
desc:
'The type of the line'
requires
:line_type
,
type:
String
,
values:
%w(new old)
,
default:
'new'
,
desc:
'The type of the line'
end
end
post
':id/repository/commits/:sha/comments'
do
...
...
lib/ci/api/helpers.rb
View file @
7d4b52b2
...
...
@@ -73,7 +73,7 @@ def current_runner
def
get_runner_version_from_params
return
unless
params
[
"info"
].
present?
attributes_for_keys
(
[
"name"
,
"version"
,
"revision"
,
"platform"
,
"architecture"
]
,
params
[
"info"
])
attributes_for_keys
(
%w(name version revision platform architecture)
,
params
[
"info"
])
end
def
max_artifacts_size
...
...
lib/gitlab/template/gitlab_ci_yml_template.rb
View file @
7d4b52b2
...
...
@@ -28,7 +28,7 @@ def finder(project = nil)
end
def
dropdown_names
(
context
)
categories
=
context
==
'autodeploy'
?
[
'Auto deploy'
]
:
[
'General'
,
'Pages'
]
categories
=
context
==
'autodeploy'
?
[
'Auto deploy'
]
:
%w(General Pages)
super
().
slice
(
*
categories
)
end
end
...
...
lib/gitlab/url_sanitizer.rb
View file @
7d4b52b2
module
Gitlab
class
UrlSanitizer
def
self
.
sanitize
(
content
)
regexp
=
URI
::
Parser
.
new
.
make_regexp
(
[
'http'
,
'https'
,
'ssh'
,
'git'
]
)
regexp
=
URI
::
Parser
.
new
.
make_regexp
(
%w(http https ssh git)
)
content
.
gsub
(
regexp
)
{
|
url
|
new
(
url
).
masked_url
}
rescue
Addressable
::
URI
::
InvalidURIError
...
...
spec/controllers/profiles/personal_access_tokens_spec.rb
View file @
7d4b52b2
...
...
@@ -32,10 +32,10 @@ def created_token
context
"scopes"
do
it
"allows creation of a token with scopes"
do
post
:create
,
personal_access_token:
{
name:
FFaker
::
Product
.
brand
,
scopes:
[
'api'
,
'read_user'
]
}
post
:create
,
personal_access_token:
{
name:
FFaker
::
Product
.
brand
,
scopes:
%w(api read_user)
}
expect
(
created_token
).
not_to
be_nil
expect
(
created_token
.
scopes
).
to
eq
(
[
'api'
,
'read_user'
]
)
expect
(
created_token
.
scopes
).
to
eq
(
%w(api read_user)
)
end
it
"allows creation of a token with no scopes"
do
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
7d4b52b2
...
...
@@ -773,7 +773,7 @@ def go(format: 'html')
section
[
'lines'
].
each
do
|
line
|
if
section
[
'conflict'
]
expect
(
line
[
'type'
]).
to
be_in
(
[
'old'
,
'new'
]
)
expect
(
line
[
'type'
]).
to
be_in
(
%w(old new)
)
expect
(
line
.
values_at
(
'old_line'
,
'new_line'
)).
to
contain_exactly
(
nil
,
a_kind_of
(
Integer
))
else
if
line
[
'type'
].
nil?
...
...
spec/features/issues/bulk_assignment_labels_spec.rb
View file @
7d4b52b2
...
...
@@ -55,7 +55,7 @@
context
'to all issues'
do
before
do
check
'check_all_issues'
open_labels_dropdown
[
'bug'
,
'feature'
]
open_labels_dropdown
%w(bug feature)
update_issues
end
...
...
@@ -70,7 +70,7 @@
context
'to a issue'
do
before
do
check
"selected_issue_
#{
issue1
.
id
}
"
open_labels_dropdown
[
'bug'
,
'feature'
]
open_labels_dropdown
%w(bug feature)
update_issues
end
...
...
@@ -112,7 +112,7 @@
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
check
'check_all_issues'
unmark_labels_in_dropdown
[
'bug'
,
'feature'
]
unmark_labels_in_dropdown
%w(bug feature)
update_issues
end
...
...
spec/features/issues_spec.rb
View file @
7d4b52b2
...
...
@@ -150,7 +150,7 @@
describe
'Filter issue'
do
before
do
[
'foobar'
,
'barbaz'
,
'gitlab'
]
.
each
do
|
title
|
%w(foobar barbaz gitlab)
.
each
do
|
title
|
create
(
:issue
,
author:
@user
,
assignee:
@user
,
...
...
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
View file @
7d4b52b2
...
...
@@ -37,7 +37,7 @@
page
.
within
(
'.issues-holder'
)
do
issue_titles
=
all
(
'.issues-list .issue-title-text'
).
map
(
&
:text
)
expect
(
issue_titles
).
to
eq
(
[
'issue_4'
,
'issue_3'
,
'issue_5'
,
'issue_2'
,
'issue_1'
]
)
expect
(
issue_titles
).
to
eq
(
%w(issue_4 issue_3 issue_5 issue_2 issue_1)
)
end
end
end
...
...
@@ -77,7 +77,7 @@
expect
(
issue_titles
[
0
..
1
]).
to
contain_exactly
(
'issue_5'
,
'issue_8'
)
expect
(
issue_titles
[
2
..
4
]).
to
contain_exactly
(
'issue_1'
,
'issue_3'
,
'issue_7'
)
expect
(
issue_titles
[
5
..-
1
]).
to
eq
(
[
'issue_2'
,
'issue_4'
,
'issue_6'
]
)
expect
(
issue_titles
[
5
..-
1
]).
to
eq
(
%w(issue_2 issue_4 issue_6)
)
end
end
end
...
...
spec/helpers/auth_helper_spec.rb
View file @
7d4b52b2
...
...
@@ -55,7 +55,7 @@
context
'all the button based providers are disabled via application_setting'
do
it
'returns false'
do
stub_application_setting
(
disabled_oauth_sign_in_sources:
[
'github'
,
'twitter'
]
disabled_oauth_sign_in_sources:
%w(github twitter)
)
expect
(
helper
.
button_based_providers_enabled?
).
to
be
false
...
...
spec/helpers/issuables_helper_spec.rb
View file @
7d4b52b2
...
...
@@ -51,7 +51,7 @@
utf8:
'✓'
,
author_id:
'11'
,
assignee_id:
'18'
,
label_name:
[
'bug'
,
'discussion'
,
'documentation'
]
,
label_name:
%w(bug discussion documentation)
,
milestone_title:
'v4.0'
,
sort:
'due_date_asc'
,
namespace_id:
'gitlab-org'
,
...
...
spec/helpers/issues_helper_spec.rb
View file @
7d4b52b2
...
...
@@ -113,7 +113,7 @@
describe
"awards_sort"
do
it
"sorts a hash so thumbsup and thumbsdown are always on top"
do
data
=
{
"thumbsdown"
=>
"some value"
,
"lifter"
=>
"some value"
,
"thumbsup"
=>
"some value"
}
expect
(
awards_sort
(
data
).
keys
).
to
eq
(
[
"thumbsup"
,
"thumbsdown"
,
"lifter"
]
)
expect
(
awards_sort
(
data
).
keys
).
to
eq
(
%w(thumbsup thumbsdown lifter)
)
end
end
...
...
spec/lib/bitbucket/collection_spec.rb
View file @
7d4b52b2
...
...
@@ -19,6 +19,6 @@ def items
it
"iterates paginator"
do
collection
=
described_class
.
new
(
TestPaginator
.
new
)
expect
(
collection
.
to_a
).
to
match
(
[
"result_1_page_1"
,
"result_2_page_1"
,
"result_1_page_2"
,
"result_2_page_2"
]
)
expect
(
collection
.
to_a
).
to
match
(
%w(result_1_page_1 result_2_page_1 result_1_page_2 result_2_page_2)
)
end
end
spec/lib/bitbucket/representation/repo_spec.rb
View file @
7d4b52b2
...
...
@@ -29,7 +29,7 @@
end
describe
'#owner_and_slug'
do
it
{
expect
(
described_class
.
new
({
'full_name'
=>
'ben/test'
}).
owner_and_slug
).
to
eq
(
[
'ben'
,
'test'
]
)
}
it
{
expect
(
described_class
.
new
({
'full_name'
=>
'ben/test'
}).
owner_and_slug
).
to
eq
(
%w(ben test)
)
}
end
describe
'#owner'
do
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
7d4b52b2
...
...
@@ -96,7 +96,7 @@ module Ci
it
"returns builds if only has a list of branches including specified"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
only:
[
"master"
,
"deploy"
]
}
rspec:
{
script:
"rspec"
,
type:
type
,
only:
%w(master deploy)
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
...
...
@@ -173,8 +173,8 @@ module Ci
it
"returns build only for specified type"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
"test"
,
only:
[
"master"
,
"deploy"
]
},
staging:
{
script:
"deploy"
,
type:
"deploy"
,
only:
[
"master"
,
"deploy"
]
},
rspec:
{
script:
"rspec"
,
type:
"test"
,
only:
%w(master deploy)
},
staging:
{
script:
"deploy"
,
type:
"deploy"
,
only:
%w(master deploy)
},
production:
{
script:
"deploy"
,
type:
"deploy"
,
only:
[
"master@path"
,
"deploy"
]
},
})
...
...
@@ -252,7 +252,7 @@ module Ci
it
"does not return builds if except has a list of branches including specified"
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
,
type:
type
,
except:
[
"master"
,
"deploy"
]
}
rspec:
{
script:
"rspec"
,
type:
type
,
except:
%w(master deploy)
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
...
...
@@ -580,7 +580,7 @@ module Ci
context
'when syntax is incorrect'
do
context
'when variables defined but invalid'
do
let
(
:variables
)
do
[
'VAR1'
,
'value1'
,
'VAR2'
,
'value2'
]
%w(VAR1 value1 VAR2 value2)
end
it
'raises error'
do
...
...
@@ -909,7 +909,7 @@ module Ci
end
context
'dependencies to builds'
do
let
(
:dependencies
)
{
[
'build1'
,
'build2'
]
}
let
(
:dependencies
)
{
%w(build1 build2)
}
it
{
expect
{
subject
}.
not_to
raise_error
}
end
...
...
@@ -1215,7 +1215,7 @@ module Ci
end
it
"returns errors if job stage is not a defined stage"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
type:
"acceptance"
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
type:
"acceptance"
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
,
path
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"rspec job: stage parameter should be build, test"
)
...
...
@@ -1257,42 +1257,42 @@ module Ci
end
it
"returns errors if job artifacts:name is not an a string"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
name:
1
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
name:
1
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts name should be a string"
)
end
it
"returns errors if job artifacts:when is not an a predefined value"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
when:
1
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
when:
1
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts when should be on_success, on_failure or always"
)
end
it
"returns errors if job artifacts:expire_in is not an a string"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
expire_in:
1
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
expire_in:
1
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts expire in should be a duration"
)
end
it
"returns errors if job artifacts:expire_in is not an a valid duration"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
expire_in:
"7 elephants"
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
expire_in:
"7 elephants"
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts expire in should be a duration"
)
end
it
"returns errors if job artifacts:untracked is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
untracked:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
untracked:
"string"
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts untracked should be a boolean value"
)
end
it
"returns errors if job artifacts:paths is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
artifacts:
{
paths:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
artifacts:
{
paths:
"string"
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:artifacts paths should be an array of strings"
)
...
...
@@ -1320,28 +1320,28 @@ module Ci
end
it
"returns errors if job cache:key is not an a string"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
cache:
{
key:
1
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
cache:
{
key:
1
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:cache:key config should be a string or symbol"
)
end
it
"returns errors if job cache:untracked is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
cache:
{
untracked:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
cache:
{
untracked:
"string"
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:cache:untracked config should be a boolean value"
)
end
it
"returns errors if job cache:paths is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
cache:
{
paths:
"string"
}
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
cache:
{
paths:
"string"
}
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec:cache:paths config should be an array of strings"
)
end
it
"returns errors if job dependencies is not an array of strings"
do
config
=
YAML
.
dump
({
types:
[
"build"
,
"test"
]
,
rspec:
{
script:
"test"
,
dependencies:
"string"
}
})
config
=
YAML
.
dump
({
types:
%w(build test)
,
rspec:
{
script:
"test"
,
dependencies:
"string"
}
})
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"jobs:rspec dependencies should be an array of strings"
)
...
...
spec/lib/extracts_path_spec.rb
View file @
7d4b52b2
...
...
@@ -177,12 +177,12 @@
it
"extracts a valid commit SHA"
do
expect
(
extract_ref
(
'f4b14494ef6abf3d144c28e4af0c20143383e062/CHANGELOG'
)).
to
eq
(
[
'f4b14494ef6abf3d144c28e4af0c20143383e062'
,
'CHANGELOG'
]
%w(f4b14494ef6abf3d144c28e4af0c20143383e062 CHANGELOG)
)
end
it
"falls back to a primitive split for an invalid ref"
do
expect
(
extract_ref
(
'stable/CHANGELOG'
)).
to
eq
(
[
'stable'
,
'CHANGELOG'
]
)
expect
(
extract_ref
(
'stable/CHANGELOG'
)).
to
eq
(
%w(stable CHANGELOG)
)
end
end
end
...
...
spec/lib/gitlab/ci/config/entry/commands_spec.rb
View file @
7d4b52b2
...
...
@@ -4,7 +4,7 @@
let
(
:entry
)
{
described_class
.
new
(
config
)
}
context
'when entry config value is an array'
do
let
(
:config
)
{
[
'ls'
,
'pwd'
]
}
let
(
:config
)
{
%w(ls pwd)
}
describe
'#value'
do
it
'returns array of strings'
do
...
...
spec/lib/gitlab/ci/config/entry/factory_spec.rb
View file @
7d4b52b2
...
...
@@ -8,20 +8,20 @@
context
'when setting a concrete value'
do
it
'creates entry with valid value'
do
entry
=
factory
.
value
(
[
'ls'
,
'pwd'
]
)