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
4edfad96
Commit
4edfad96
authored
Aug 15, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Layout/TrailingWhitespace cop and auto-correct offenses
parent
05151f76
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
99 additions
and
100 deletions
+99
-100
.rubocop.yml
.rubocop.yml
+4
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+1
-1
app/controllers/omniauth_callbacks_controller.rb
app/controllers/omniauth_callbacks_controller.rb
+2
-2
app/controllers/projects/cycle_analytics/events_controller.rb
...controllers/projects/cycle_analytics/events_controller.rb
+12
-12
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-2
app/helpers/pipeline_schedules_helper.rb
app/helpers/pipeline_schedules_helper.rb
+5
-5
app/models/blob_viewer/notebook.rb
app/models/blob_viewer/notebook.rb
+1
-1
app/models/deploy_keys_project.rb
app/models/deploy_keys_project.rb
+1
-1
app/models/redirect_route.rb
app/models/redirect_route.rb
+1
-1
app/serializers/project_entity.rb
app/serializers/project_entity.rb
+1
-1
app/serializers/tree_root_entity.rb
app/serializers/tree_root_entity.rb
+1
-1
config/initializers/0_acts_as_taggable.rb
config/initializers/0_acts_as_taggable.rb
+1
-1
config/initializers/static_files.rb
config/initializers/static_files.rb
+5
-5
config/initializers/trusted_proxies.rb
config/initializers/trusted_proxies.rb
+1
-1
config/routes/repository.rb
config/routes/repository.rb
+1
-1
db/migrate/20161020075830_default_request_access_projects.rb
db/migrate/20161020075830_default_request_access_projects.rb
+1
-1
db/post_migrate/20170503004427_update_retried_for_ci_build.rb
...ost_migrate/20170503004427_update_retried_for_ci_build.rb
+1
-1
db/post_migrate/20170523083112_migrate_old_artifacts.rb
db/post_migrate/20170523083112_migrate_old_artifacts.rb
+3
-3
features/steps/profile/emails.rb
features/steps/profile/emails.rb
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/protected_branches.rb
lib/api/protected_branches.rb
+1
-1
lib/banzai/filter/image_lazy_load_filter.rb
lib/banzai/filter/image_lazy_load_filter.rb
+2
-2
lib/constraints/project_url_constrainer.rb
lib/constraints/project_url_constrainer.rb
+1
-1
lib/declarative_policy/base.rb
lib/declarative_policy/base.rb
+1
-1
lib/gitlab/auth/ip_rate_limiter.rb
lib/gitlab/auth/ip_rate_limiter.rb
+6
-6
lib/gitlab/ci/build/artifacts/metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+1
-1
lib/gitlab/git/blob.rb
lib/gitlab/git/blob.rb
+1
-1
lib/gitlab/import_export/attributes_finder.rb
lib/gitlab/import_export/attributes_finder.rb
+1
-1
lib/gitlab/ldap/auth_hash.rb
lib/gitlab/ldap/auth_hash.rb
+1
-1
lib/gitlab/middleware/rails_queue_duration.rb
lib/gitlab/middleware/rails_queue_duration.rb
+1
-1
lib/gitlab/slash_commands/presenters/help.rb
lib/gitlab/slash_commands/presenters/help.rb
+1
-1
lib/tasks/gitlab/gitaly.rake
lib/tasks/gitlab/gitaly.rake
+1
-1
spec/features/admin/admin_settings_spec.rb
spec/features/admin/admin_settings_spec.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+1
-1
spec/features/milestones/show_spec.rb
spec/features/milestones/show_spec.rb
+1
-1
spec/features/projects/files/undo_template_spec.rb
spec/features/projects/files/undo_template_spec.rb
+1
-1
spec/javascripts/fixtures/prometheus_service.rb
spec/javascripts/fixtures/prometheus_service.rb
+1
-1
spec/javascripts/fixtures/services.rb
spec/javascripts/fixtures/services.rb
+1
-1
spec/lib/gitlab/ci/trace/stream_spec.rb
spec/lib/gitlab/ci/trace/stream_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
+2
-2
spec/lib/gitlab/key_fingerprint_spec.rb
spec/lib/gitlab/key_fingerprint_spec.rb
+2
-2
spec/lib/gitlab/ldap/auth_hash_spec.rb
spec/lib/gitlab/ldap/auth_hash_spec.rb
+6
-6
spec/lib/gitlab/o_auth/user_spec.rb
spec/lib/gitlab/o_auth/user_spec.rb
+1
-1
spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
+2
-2
spec/migrations/migrate_old_artifacts_spec.rb
spec/migrations/migrate_old_artifacts_spec.rb
+2
-2
spec/requests/api/protected_branches_spec.rb
spec/requests/api/protected_branches_spec.rb
+2
-2
spec/requests/api/settings_spec.rb
spec/requests/api/settings_spec.rb
+1
-1
spec/requests/ci/api/builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+1
-1
spec/services/web_hook_service_spec.rb
spec/services/web_hook_service_spec.rb
+1
-1
spec/support/generate-seed-repo-rb
spec/support/generate-seed-repo-rb
+6
-6
spec/support/matchers/access_matchers_for_controller.rb
spec/support/matchers/access_matchers_for_controller.rb
+1
-1
spec/tasks/gitlab/gitaly_rake_spec.rb
spec/tasks/gitlab/gitaly_rake_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
4edfad96
...
@@ -251,6 +251,10 @@ Layout/Tab:
...
@@ -251,6 +251,10 @@ Layout/Tab:
Layout/TrailingBlankLines
:
Layout/TrailingBlankLines
:
Enabled
:
true
Enabled
:
true
# Avoid trailing whitespace.
Layout/TrailingWhitespace
:
Enabled
:
true
# Style #######################################################################
# Style #######################################################################
# Check the naming of accessor methods for get_/set_.
# Check the naming of accessor methods for get_/set_.
...
...
.rubocop_todo.yml
View file @
4edfad96
...
@@ -57,11 +57,6 @@ Layout/SpaceInsideParens:
...
@@ -57,11 +57,6 @@ Layout/SpaceInsideParens:
Layout/SpaceInsidePercentLiteralDelimiters
:
Layout/SpaceInsidePercentLiteralDelimiters
:
Enabled
:
false
Enabled
:
false
# Offense count: 89
# Cop supports --auto-correct.
Layout/TrailingWhitespace
:
Enabled
:
false
# Offense count: 272
# Offense count: 272
RSpec/EmptyLineAfterFinalLet
:
RSpec/EmptyLineAfterFinalLet
:
Enabled
:
false
Enabled
:
false
...
...
app/controllers/groups/application_controller.rb
View file @
4edfad96
...
@@ -34,7 +34,7 @@ class Groups::ApplicationController < ApplicationController
...
@@ -34,7 +34,7 @@ class Groups::ApplicationController < ApplicationController
def
build_canonical_path
(
group
)
def
build_canonical_path
(
group
)
params
[
:group_id
]
=
group
.
to_param
params
[
:group_id
]
=
group
.
to_param
url_for
(
params
)
url_for
(
params
)
end
end
end
end
app/controllers/omniauth_callbacks_controller.rb
View file @
4edfad96
...
@@ -142,13 +142,13 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
...
@@ -142,13 +142,13 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def
oauth
def
oauth
@oauth
||=
request
.
env
[
'omniauth.auth'
]
@oauth
||=
request
.
env
[
'omniauth.auth'
]
end
end
def
fail_login
def
fail_login
error_message
=
@user
.
errors
.
full_messages
.
to_sentence
error_message
=
@user
.
errors
.
full_messages
.
to_sentence
return
redirect_to
omniauth_error_path
(
oauth
[
'provider'
],
error:
error_message
)
return
redirect_to
omniauth_error_path
(
oauth
[
'provider'
],
error:
error_message
)
end
end
def
fail_ldap_login
def
fail_ldap_login
flash
[
:alert
]
=
'Access denied for your LDAP account.'
flash
[
:alert
]
=
'Access denied for your LDAP account.'
...
...
app/controllers/projects/cycle_analytics/events_controller.rb
View file @
4edfad96
...
@@ -2,7 +2,7 @@ module Projects
...
@@ -2,7 +2,7 @@ module Projects
module
CycleAnalytics
module
CycleAnalytics
class
EventsController
<
Projects
::
ApplicationController
class
EventsController
<
Projects
::
ApplicationController
include
CycleAnalyticsParams
include
CycleAnalyticsParams
before_action
:authorize_read_cycle_analytics!
before_action
:authorize_read_cycle_analytics!
before_action
:authorize_read_build!
,
only:
[
:test
,
:staging
]
before_action
:authorize_read_build!
,
only:
[
:test
,
:staging
]
before_action
:authorize_read_issue!
,
only:
[
:issue
,
:production
]
before_action
:authorize_read_issue!
,
only:
[
:issue
,
:production
]
...
@@ -11,33 +11,33 @@ module Projects
...
@@ -11,33 +11,33 @@ module Projects
def
issue
def
issue
render_events
(
cycle_analytics
[
:issue
].
events
)
render_events
(
cycle_analytics
[
:issue
].
events
)
end
end
def
plan
def
plan
render_events
(
cycle_analytics
[
:plan
].
events
)
render_events
(
cycle_analytics
[
:plan
].
events
)
end
end
def
code
def
code
render_events
(
cycle_analytics
[
:code
].
events
)
render_events
(
cycle_analytics
[
:code
].
events
)
end
end
def
test
def
test
options
(
events_params
)[
:branch
]
=
events_params
[
:branch_name
]
options
(
events_params
)[
:branch
]
=
events_params
[
:branch_name
]
render_events
(
cycle_analytics
[
:test
].
events
)
render_events
(
cycle_analytics
[
:test
].
events
)
end
end
def
review
def
review
render_events
(
cycle_analytics
[
:review
].
events
)
render_events
(
cycle_analytics
[
:review
].
events
)
end
end
def
staging
def
staging
render_events
(
cycle_analytics
[
:staging
].
events
)
render_events
(
cycle_analytics
[
:staging
].
events
)
end
end
def
production
def
production
render_events
(
cycle_analytics
[
:production
].
events
)
render_events
(
cycle_analytics
[
:production
].
events
)
end
end
private
private
def
render_events
(
events
)
def
render_events
(
events
)
...
@@ -46,14 +46,14 @@ module Projects
...
@@ -46,14 +46,14 @@ module Projects
format
.
json
{
render
json:
{
events:
events
}
}
format
.
json
{
render
json:
{
events:
events
}
}
end
end
end
end
def
cycle_analytics
def
cycle_analytics
@cycle_analytics
||=
::
CycleAnalytics
.
new
(
project
,
options
(
events_params
))
@cycle_analytics
||=
::
CycleAnalytics
.
new
(
project
,
options
(
events_params
))
end
end
def
events_params
def
events_params
return
{}
unless
params
[
:events
].
present?
return
{}
unless
params
[
:events
].
present?
params
[
:events
].
permit
(
:start_date
,
:branch_name
)
params
[
:events
].
permit
(
:start_date
,
:branch_name
)
end
end
end
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
4edfad96
...
@@ -218,8 +218,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -218,8 +218,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
if
can?
(
current_user
,
:read_environment
,
environment
)
&&
environment
.
has_metrics?
if
can?
(
current_user
,
:read_environment
,
environment
)
&&
environment
.
has_metrics?
metrics_project_environment_deployment_path
(
environment
.
project
,
environment
,
deployment
)
metrics_project_environment_deployment_path
(
environment
.
project
,
environment
,
deployment
)
end
end
metrics_monitoring_url
=
metrics_monitoring_url
=
if
can?
(
current_user
,
:read_environment
,
environment
)
if
can?
(
current_user
,
:read_environment
,
environment
)
environment_metrics_path
(
environment
)
environment_metrics_path
(
environment
)
end
end
...
...
app/helpers/pipeline_schedules_helper.rb
View file @
4edfad96
module
PipelineSchedulesHelper
module
PipelineSchedulesHelper
def
timezone_data
def
timezone_data
ActiveSupport
::
TimeZone
.
all
.
map
do
|
timezone
|
ActiveSupport
::
TimeZone
.
all
.
map
do
|
timezone
|
{
{
name:
timezone
.
name
,
name:
timezone
.
name
,
offset:
timezone
.
utc_offset
,
offset:
timezone
.
utc_offset
,
identifier:
timezone
.
tzinfo
.
identifier
identifier:
timezone
.
tzinfo
.
identifier
}
}
end
end
end
end
...
...
app/models/blob_viewer/notebook.rb
View file @
4edfad96
...
@@ -2,7 +2,7 @@ module BlobViewer
...
@@ -2,7 +2,7 @@ module BlobViewer
class
Notebook
<
Base
class
Notebook
<
Base
include
Rich
include
Rich
include
ClientSide
include
ClientSide
self
.
partial_name
=
'notebook'
self
.
partial_name
=
'notebook'
self
.
extensions
=
%w(ipynb)
self
.
extensions
=
%w(ipynb)
self
.
binary
=
false
self
.
binary
=
false
...
...
app/models/deploy_keys_project.rb
View file @
4edfad96
...
@@ -12,7 +12,7 @@ class DeployKeysProject < ActiveRecord::Base
...
@@ -12,7 +12,7 @@ class DeployKeysProject < ActiveRecord::Base
def
destroy_orphaned_deploy_key
def
destroy_orphaned_deploy_key
return
unless
self
.
deploy_key
.
destroyed_when_orphaned?
&&
self
.
deploy_key
.
orphaned?
return
unless
self
.
deploy_key
.
destroyed_when_orphaned?
&&
self
.
deploy_key
.
orphaned?
self
.
deploy_key
.
destroy
self
.
deploy_key
.
destroy
end
end
end
end
app/models/redirect_route.rb
View file @
4edfad96
...
@@ -14,7 +14,7 @@ class RedirectRoute < ActiveRecord::Base
...
@@ -14,7 +14,7 @@ class RedirectRoute < ActiveRecord::Base
else
else
'redirect_routes.path = ? OR redirect_routes.path LIKE ?'
'redirect_routes.path = ? OR redirect_routes.path LIKE ?'
end
end
where
(
wheres
,
path
,
"
#{
sanitize_sql_like
(
path
)
}
/%"
)
where
(
wheres
,
path
,
"
#{
sanitize_sql_like
(
path
)
}
/%"
)
end
end
end
end
app/serializers/project_entity.rb
View file @
4edfad96
class
ProjectEntity
<
Grape
::
Entity
class
ProjectEntity
<
Grape
::
Entity
include
RequestAwareEntity
include
RequestAwareEntity
expose
:id
expose
:id
expose
:name
expose
:name
...
...
app/serializers/tree_root_entity.rb
View file @
4edfad96
# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`.
# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`.
class
TreeRootEntity
<
Grape
::
Entity
class
TreeRootEntity
<
Grape
::
Entity
expose
:path
expose
:path
expose
:trees
,
using:
TreeEntity
expose
:trees
,
using:
TreeEntity
expose
:blobs
,
using:
BlobEntity
expose
:blobs
,
using:
BlobEntity
expose
:submodules
,
using:
SubmoduleEntity
expose
:submodules
,
using:
SubmoduleEntity
...
...
config/initializers/0_acts_as_taggable.rb
View file @
4edfad96
...
@@ -5,5 +5,5 @@ ActsAsTaggableOn.strict_case_match = true
...
@@ -5,5 +5,5 @@ ActsAsTaggableOn.strict_case_match = true
ActsAsTaggableOn
.
tags_counter
=
false
ActsAsTaggableOn
.
tags_counter
=
false
# validate that counter cache is disabled
# validate that counter cache is disabled
raise
"Counter cache is not disabled"
if
raise
"Counter cache is not disabled"
if
ActsAsTaggableOn
::
Tagging
.
reflections
[
"tag"
].
options
[
:counter_cache
]
ActsAsTaggableOn
::
Tagging
.
reflections
[
"tag"
].
options
[
:counter_cache
]
config/initializers/static_files.rb
View file @
4edfad96
app
=
Rails
.
application
app
=
Rails
.
application
if
app
.
config
.
serve_static_files
if
app
.
config
.
serve_static_files
# The `ActionDispatch::Static` middleware intercepts requests for static files
# The `ActionDispatch::Static` middleware intercepts requests for static files
# by checking if they exist in the `/public` directory.
# by checking if they exist in the `/public` directory.
# We're replacing it with our `Gitlab::Middleware::Static` that does the same,
# We're replacing it with our `Gitlab::Middleware::Static` that does the same,
# except ignoring `/uploads`, letting those go through to the GitLab Rails app.
# except ignoring `/uploads`, letting those go through to the GitLab Rails app.
app
.
config
.
middleware
.
swap
(
app
.
config
.
middleware
.
swap
(
ActionDispatch
::
Static
,
ActionDispatch
::
Static
,
Gitlab
::
Middleware
::
Static
,
Gitlab
::
Middleware
::
Static
,
app
.
paths
[
"public"
].
first
,
app
.
paths
[
"public"
].
first
,
app
.
config
.
static_cache_control
app
.
config
.
static_cache_control
)
)
...
...
config/initializers/trusted_proxies.rb
View file @
4edfad96
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# as the ActionDispatch::Request object. This is necessary for libraries
# as the ActionDispatch::Request object. This is necessary for libraries
# like rack_attack where they don't use ActionDispatch, and we want them
# like rack_attack where they don't use ActionDispatch, and we want them
# to block/throttle requests on private networks.
# to block/throttle requests on private networks.
# Rack Attack specific issue: https://github.com/kickstarter/rack-attack/issues/145
# Rack Attack specific issue: https://github.com/kickstarter/rack-attack/issues/145
module
Rack
module
Rack
class
Request
class
Request
def
trusted_proxy?
(
ip
)
def
trusted_proxy?
(
ip
)
...
...
config/routes/repository.rb
View file @
4edfad96
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
resource
:repository
,
only:
[
:create
]
do
resource
:repository
,
only:
[
:create
]
do
member
do
member
do
get
':ref/archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
,
ref:
/.+/
},
action:
'archive'
,
as:
'archive'
get
':ref/archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
,
ref:
/.+/
},
action:
'archive'
,
as:
'archive'
# deprecated since GitLab 9.5
# deprecated since GitLab 9.5
get
'archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
},
as:
'archive_alternative'
get
'archive'
,
constraints:
{
format:
Gitlab
::
PathRegex
.
archive_formats_regex
},
as:
'archive_alternative'
end
end
...
...
db/migrate/20161020075830_default_request_access_projects.rb
View file @
4edfad96
class
DefaultRequestAccessProjects
<
ActiveRecord
::
Migration
class
DefaultRequestAccessProjects
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
DOWNTIME
=
false
def
up
def
up
change_column_default
:projects
,
:request_access_enabled
,
false
change_column_default
:projects
,
:request_access_enabled
,
false
end
end
...
...
db/post_migrate/20170503004427_update_retried_for_ci_build.rb
View file @
4edfad96
...
@@ -21,7 +21,7 @@ class UpdateRetriedForCiBuild < ActiveRecord::Migration
...
@@ -21,7 +21,7 @@ class UpdateRetriedForCiBuild < ActiveRecord::Migration
private
private
def
up_mysql
def
up_mysql
# This is a trick to overcome MySQL limitation:
# This is a trick to overcome MySQL limitation:
# Mysql2::Error: Table 'ci_builds' is specified twice, both as a target for 'UPDATE' and as a separate source for data
# Mysql2::Error: Table 'ci_builds' is specified twice, both as a target for 'UPDATE' and as a separate source for data
# However, this leads to create a temporary table from `max(ci_builds.id)` which is slow and do full database update
# However, this leads to create a temporary table from `max(ci_builds.id)` which is slow and do full database update
execute
<<-
SQL
.
strip_heredoc
execute
<<-
SQL
.
strip_heredoc
...
...
db/post_migrate/20170523083112_migrate_old_artifacts.rb
View file @
4edfad96
...
@@ -7,7 +7,7 @@ class MigrateOldArtifacts < ActiveRecord::Migration
...
@@ -7,7 +7,7 @@ class MigrateOldArtifacts < ActiveRecord::Migration
# This uses special heuristic to find potential candidates for data migration
# This uses special heuristic to find potential candidates for data migration
# Read more about this here: https://gitlab.com/gitlab-org/gitlab-ce/issues/32036#note_30422345
# Read more about this here: https://gitlab.com/gitlab-org/gitlab-ce/issues/32036#note_30422345
def
up
def
up
builds_with_artifacts
.
find_each
do
|
build
|
builds_with_artifacts
.
find_each
do
|
build
|
build
.
migrate_artifacts!
build
.
migrate_artifacts!
...
@@ -51,14 +51,14 @@ class MigrateOldArtifacts < ActiveRecord::Migration
...
@@ -51,14 +51,14 @@ class MigrateOldArtifacts < ActiveRecord::Migration
private
private
def
source_artifacts_path
def
source_artifacts_path
@source_artifacts_path
||=
@source_artifacts_path
||=
File
.
join
(
Gitlab
.
config
.
artifacts
.
path
,
File
.
join
(
Gitlab
.
config
.
artifacts
.
path
,
created_at
.
utc
.
strftime
(
'%Y_%m'
),
created_at
.
utc
.
strftime
(
'%Y_%m'
),
ci_id
.
to_s
,
id
.
to_s
)
ci_id
.
to_s
,
id
.
to_s
)
end
end
def
target_artifacts_path
def
target_artifacts_path
@target_artifacts_path
||=
@target_artifacts_path
||=
File
.
join
(
Gitlab
.
config
.
artifacts
.
path
,
File
.
join
(
Gitlab
.
config
.
artifacts
.
path
,
created_at
.
utc
.
strftime
(
'%Y_%m'
),
created_at
.
utc
.
strftime
(
'%Y_%m'
),
project_id
.
to_s
,
id
.
to_s
)
project_id
.
to_s
,
id
.
to_s
)
...
...
features/steps/profile/emails.rb
View file @
4edfad96
...
@@ -28,7 +28,7 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
...
@@ -28,7 +28,7 @@ class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
expect
(
email
).
to
be_nil
expect
(
email
).
to
be_nil
expect
(
page
).
not_to
have_content
(
"my@email.com"
)
expect
(
page
).
not_to
have_content
(
"my@email.com"
)
end
end
step
'I click link "Remove" for "my@email.com"'
do
step
'I click link "Remove" for "my@email.com"'
do
# there should only be one remove button at this time
# there should only be one remove button at this time
click_link
"Remove"
click_link
"Remove"
...
...
lib/api/entities.rb
View file @
4edfad96
...
@@ -83,7 +83,7 @@ module API
...
@@ -83,7 +83,7 @@ module API
expose
:created_at
,
:last_activity_at
expose
:created_at
,
:last_activity_at
end
end
class
Project
<
BasicProjectDetails
class
Project
<
BasicProjectDetails
include
::
API
::
Helpers
::
RelatedResourcesHelpers
include
::
API
::
Helpers
::
RelatedResourcesHelpers
expose
:_links
do
expose
:_links
do
...
...
lib/api/protected_branches.rb
View file @
4edfad96
...
@@ -61,7 +61,7 @@ module API
...
@@ -61,7 +61,7 @@ module API
service_args
=
[
user_project
,
current_user
,
protected_branch_params
]
service_args
=
[
user_project
,
current_user
,
protected_branch_params
]
protected_branch
=
::
ProtectedBranches
::
CreateService
.
new
(
*
service_args
).
execute
protected_branch
=
::
ProtectedBranches
::
CreateService
.
new
(
*
service_args
).
execute
if
protected_branch
.
persisted?
if
protected_branch
.
persisted?
present
protected_branch
,
with:
Entities
::
ProtectedBranch
,
project:
user_project
present
protected_branch
,
with:
Entities
::
ProtectedBranch
,
project:
user_project
else
else
...
...
lib/banzai/filter/image_lazy_load_filter.rb
View file @
4edfad96
...
@@ -6,9 +6,9 @@ module Banzai
...
@@ -6,9 +6,9 @@ module Banzai
doc
.
xpath
(
'descendant-or-self::img'
).
each
do
|
img
|
doc
.
xpath
(
'descendant-or-self::img'
).
each
do
|
img
|
img
[
'class'
]
||=
''
<<
'lazy'
img
[
'class'
]
||=
''
<<
'lazy'
img
[
'data-src'
]
=
img
[
'src'
]
img
[
'data-src'
]
=
img
[
'src'
]
img
[
'src'
]
=
LazyImageTagHelper
.
placeholder_image
img
[
'src'
]
=
LazyImageTagHelper
.
placeholder_image
end
end
doc
doc
end
end
end
end
...
...
lib/constraints/project_url_constrainer.rb
View file @
4edfad96
...
@@ -7,7 +7,7 @@ class ProjectUrlConstrainer
...
@@ -7,7 +7,7 @@ class ProjectUrlConstrainer
return
false
unless
DynamicPathValidator
.
valid_project_path?
(
full_path
)
return
false
unless
DynamicPathValidator
.
valid_project_path?
(
full_path
)
# We intentionally allow SELECT(*) here so result of this query can be used
# We intentionally allow SELECT(*) here so result of this query can be used
# as cache for further Project.find_by_full_path calls within request
# as cache for further Project.find_by_full_path calls within request
Project
.
find_by_full_path
(
full_path
,
follow_redirects:
request
.
get?
).
present?
Project
.
find_by_full_path
(
full_path
,
follow_redirects:
request
.
get?
).
present?
end
end
end
end
lib/declarative_policy/base.rb
View file @
4edfad96
...
@@ -221,7 +221,7 @@ module DeclarativePolicy
...
@@ -221,7 +221,7 @@ module DeclarativePolicy
end
end
# computes the given ability and prints a helpful debugging output
# computes the given ability and prints a helpful debugging output
# showing which
# showing which
def
debug
(
ability
,
*
a
)
def
debug
(
ability
,
*
a
)
runner
(
ability
).
debug
(
*
a
)
runner
(
ability
).
debug
(
*
a
)
end
end
...
...
lib/gitlab/auth/ip_rate_limiter.rb
View file @
4edfad96
...
@@ -11,11 +11,11 @@ module Gitlab
...
@@ -11,11 +11,11 @@ module Gitlab
def
enabled?
def
enabled?
config
.
enabled
config
.
enabled
end
end
def
reset!
def
reset!
Rack
::
Attack
::
Allow2Ban
.
reset
(
ip
,
config
)
Rack
::
Attack
::
Allow2Ban
.
reset
(
ip
,
config
)
end
end
def
register_fail!
def
register_fail!
# Allow2Ban.filter will return false if this IP has not failed too often yet
# Allow2Ban.filter will return false if this IP has not failed too often yet
@banned
=
Rack
::
Attack
::
Allow2Ban
.
filter
(
ip
,
config
)
do
@banned
=
Rack
::
Attack
::
Allow2Ban
.
filter
(
ip
,
config
)
do
...
@@ -23,17 +23,17 @@ module Gitlab
...
@@ -23,17 +23,17 @@ module Gitlab
ip_can_be_banned?
ip_can_be_banned?
end
end
end
end
def
banned?
def
banned?
@banned
@banned
end
end
private
private
def
config
def
config
Gitlab
.
config
.
rack_attack
.
git_basic_auth
Gitlab
.
config
.
rack_attack
.
git_basic_auth
end
end
def
ip_can_be_banned?
def
ip_can_be_banned?
config
.
ip_whitelist
.
exclude?
(
ip
)
config
.
ip_whitelist
.
exclude?
(
ip
)
end
end
...
...
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
4edfad96
...
@@ -60,7 +60,7 @@ module Gitlab
...
@@ -60,7 +60,7 @@ module Gitlab
begin
begin
path
=
read_string
(
gz
).
force_encoding
(
'UTF-8'
)
path
=
read_string
(
gz
).
force_encoding
(
'UTF-8'
)
meta
=
read_string
(
gz
).
force_encoding
(
'UTF-8'
)
meta
=
read_string
(
gz
).
force_encoding
(
'UTF-8'
)
next
unless
path
.
valid_encoding?
&&
meta
.
valid_encoding?
next
unless
path
.
valid_encoding?
&&
meta
.
valid_encoding?
next
unless
path
=~
match_pattern
next
unless
path
=~
match_pattern
next
if
path
=~
INVALID_PATH_PATTERN
next
if
path
=~
INVALID_PATH_PATTERN
...
...
lib/gitlab/git/blob.rb
View file @
4edfad96
...
@@ -54,7 +54,7 @@ module Gitlab
...
@@ -54,7 +54,7 @@ module Gitlab
# [[commit_sha, path], [commit_sha, path], ...]. If blob_size_limit < 0 then the
# [[commit_sha, path], [commit_sha, path], ...]. If blob_size_limit < 0 then the
# full blob contents are returned. If blob_size_limit >= 0 then each blob will
# full blob contents are returned. If blob_size_limit >= 0 then each blob will
# contain no more than limit bytes in its data attribute.
# contain no more than limit bytes in its data attribute.
#
#
# Keep in mind that this method may allocate a lot of memory. It is up
# Keep in mind that this method may allocate a lot of memory. It is up
# to the caller to limit the number of blobs and blob_size_limit.
# to the caller to limit the number of blobs and blob_size_limit.
#
#
...
...
lib/gitlab/import_export/attributes_finder.rb
View file @
4edfad96
module
Gitlab
module
Gitlab
module
ImportExport
module
ImportExport
class
AttributesFinder
class
AttributesFinder
def
initialize
(
included_attributes
:,
excluded_attributes
:,
methods
:)
def
initialize
(
included_attributes
:,
excluded_attributes
:,
methods
:)
@included_attributes
=
included_attributes
||
{}
@included_attributes
=
included_attributes
||
{}
@excluded_attributes
=
excluded_attributes
||
{}
@excluded_attributes
=
excluded_attributes
||
{}
...
...
lib/gitlab/ldap/auth_hash.rb
View file @
4edfad96
...
@@ -17,7 +17,7 @@ module Gitlab
...
@@ -17,7 +17,7 @@ module Gitlab
value
=
value
.
first
if
value
value
=
value
.
first
if
value
break
if
value
.
present?
break
if
value
.
present?
end
end
return
super
unless
value
return
super
unless
value
Gitlab
::
Utils
.
force_utf8
(
value
)
Gitlab
::
Utils
.
force_utf8
(
value
)
...
...
lib/gitlab/middleware/rails_queue_duration.rb
View file @
4edfad96
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
def
initialize
(
app
)
def
initialize
(
app
)
@app
=
app
@app
=
app
end
end
def
call
(
env
)
def
call
(
env
)
trans
=
Gitlab
::
Metrics
.
current_transaction
trans
=
Gitlab
::
Metrics
.
current_transaction
proxy_start
=
env
[
'HTTP_GITLAB_WORKHORSE_PROXY_START'
].
presence
proxy_start
=
env
[
'HTTP_GITLAB_WORKHORSE_PROXY_START'
].
presence
...
...
lib/gitlab/slash_commands/presenters/help.rb
View file @
4edfad96
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,7 @@ module Gitlab
if
text
.
start_with?
(
'help'
)
if
text
.
start_with?
(
'help'
)
header_with_list
(
"Available commands"
,
full_commands
(
trigger
))
header_with_list
(
"Available commands"
,
full_commands
(
trigger
))
else
else
header_with_list
(
"Unknown command, these commands are available"
,
full_commands
(
trigger
))
header_with_list
(
"Unknown command, these commands are available"
,
full_commands
(
trigger
))
end
end
end
end
...
...
lib/tasks/gitlab/gitaly.rake
View file @
4edfad96
...
@@ -18,7 +18,7 @@ namespace :gitlab do
...
@@ -18,7 +18,7 @@ namespace :gitlab do
command
=
status
.
zero?
?
[
'gmake'
]
:
[
'make'
]
command
=
status
.
zero?
?
[
'gmake'
]
:
[
'make'
]
if
Rails
.
env
.
test?
if
Rails
.
env
.
test?
command
+=
%W[BUNDLE_PATH=
#{
Bundler
.
bundle_path
}
]
command
+=
%W[BUNDLE_PATH=
#{
Bundler
.
bundle_path
}
]
end
end
Dir
.
chdir
(
args
.
dir
)
do
Dir
.
chdir
(
args
.
dir
)
do
...
...
spec/features/admin/admin_settings_spec.rb
View file @
4edfad96
...
@@ -74,7 +74,7 @@ feature 'Admin updates settings' do
...
@@ -74,7 +74,7 @@ feature 'Admin updates settings' do
context
'sign-in restrictions'
,
:js
do
context
'sign-in restrictions'
,
:js
do
it
'de-activates oauth sign-in source'
do
it
'de-activates oauth sign-in source'
do
find
(
'.btn'
,
text:
'GitLab.com'
).
click
find
(
'.btn'
,
text:
'GitLab.com'
).
click
expect
(
find
(
'.btn'
,
text:
'GitLab.com'
)).
not_to
have_css
(
'.active'
)
expect
(
find
(
'.btn'
,
text:
'GitLab.com'
)).
not_to
have_css
(
'.active'
)
end
end
end
end
...
...
spec/features/issues_spec.rb
View file @
4edfad96
...
@@ -708,7 +708,7 @@ describe 'Issues' do
...
@@ -708,7 +708,7 @@ describe 'Issues' do
end
end
describe
'confidential issue#show'
,
js:
true
do
describe
'confidential issue#show'
,
js:
true
do
it
'shows confidential sibebar information as confidential and can be turned off'
do
it
'shows confidential sibebar information as confidential and can be turned off'
do
issue
=
create
(
:issue
,
:confidential
,
project:
project
)
issue
=
create
(
:issue
,
:confidential
,
project:
project
)
visit
project_issue_path
(
project
,
issue
)
visit
project_issue_path
(
project
,
issue
)
...
...
spec/features/milestones/show_spec.rb
View file @
4edfad96
...
@@ -8,7 +8,7 @@ describe 'Milestone show' do
...
@@ -8,7 +8,7 @@ describe 'Milestone show' do
let
(
:issue_params
)
{
{
project:
project
,
assignees:
[
user
],
author:
user
,
milestone:
milestone
,
labels:
labels
}
}
let
(
:issue_params
)
{
{
project:
project
,
assignees:
[
user
],
author:
user
,
milestone:
milestone
,
labels:
labels
}
}
before
do
before
do
project
.
add_user
(
user
,
:developer
)
project
.
add_user
(
user
,
:developer
)
sign_in
(
user
)
sign_in
(
user
)
end
end
...
...
spec/features/projects/files/undo_template_spec.rb
View file @
4edfad96
...
@@ -20,7 +20,7 @@ feature 'Template Undo Button', js: true do
...
@@ -20,7 +20,7 @@ feature 'Template Undo Button', js: true do
end
end
end
end
context
'creating a non-matching file'
do
context
'creating a non-matching file'
do
before
do
before
do
visit
project_new_blob_path
(
project
,
'master'
)
visit
project_new_blob_path
(
project
,
'master'
)
select_file_template_type
(
'LICENSE'
)
select_file_template_type
(
'LICENSE'
)
...
...
spec/javascripts/fixtures/prometheus_service.rb
View file @
4edfad96
...
@@ -7,7 +7,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
...
@@ -7,7 +7,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'services-project'
)
}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'services-project'
)
}
let!
(
:service
)
{
create
(
:prometheus_service
,
project:
project
)
}
let!
(
:service
)
{
create
(
:prometheus_service
,
project:
project
)
}
render_views
render_views
before
(
:all
)
do
before
(
:all
)
do
...
...
spec/javascripts/fixtures/services.rb
View file @
4edfad96
...
@@ -7,7 +7,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
...
@@ -7,7 +7,7 @@ describe Projects::ServicesController, '(JavaScript fixtures)', type: :controlle
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'services-project'
)
}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'services-project'
)
}
let!
(
:service
)
{
create
(
:custom_issue_tracker_service
,
project:
project
,
title:
'Custom Issue Tracker'
)
}
let!
(
:service
)
{
create
(
:custom_issue_tracker_service
,
project:
project
,
title:
'Custom Issue Tracker'
)
}
render_views
render_views
...
...
spec/lib/gitlab/ci/trace/stream_spec.rb
View file @
4edfad96
...
@@ -295,7 +295,7 @@ describe Gitlab::Ci::Trace::Stream do
...
@@ -295,7 +295,7 @@ describe Gitlab::Ci::Trace::Stream do
end
end
context
'malicious regexp'
do
context
'malicious regexp'
do
let
(
:data
)
{
malicious_text
}
let
(
:data
)
{
malicious_text
}
let
(
:regex
)
{
malicious_regexp
}
let
(
:regex
)
{
malicious_regexp
}
include_examples
'malicious regexp'
include_examples
'malicious regexp'
...
...
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
View file @
4edfad96
...
@@ -6,10 +6,10 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
...
@@ -6,10 +6,10 @@ describe Gitlab::CycleAnalytics::BaseEventFetcher do
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:start_time_attrs
)
{
Issue
.
arel_table
[
:created_at
]
}
let
(
:start_time_attrs
)
{
Issue
.
arel_table
[
:created_at
]
}
let
(
:end_time_attrs
)
{
[
Issue
::
Metrics
.
arel_table
[
:first_associated_with_milestone_at
]]
}
let
(
:end_time_attrs
)
{
[
Issue
::
Metrics
.
arel_table
[
:first_associated_with_milestone_at
]]
}
let
(
:options
)
do
let
(
:options
)
do
{
start_time_attrs:
start_time_attrs
,
{
start_time_attrs:
start_time_attrs
,
end_time_attrs:
end_time_attrs
,
end_time_attrs:
end_time_attrs
,
from:
30
.
days
.
ago
}
from:
30
.
days
.
ago
}
end
end
subject
do
subject
do
...
...
spec/lib/gitlab/key_fingerprint_spec.rb
View file @
4edfad96
...
@@ -30,8 +30,8 @@ describe Gitlab::KeyFingerprint, lib: true do
...
@@ -30,8 +30,8 @@ describe Gitlab::KeyFingerprint, lib: true do
MD5_FINGERPRINTS
=
{
MD5_FINGERPRINTS
=
{
rsa:
'06:b2:8a:92:df:0e:11:2c:ca:7b:8f:a4:ba:6e:4b:fd'
,
rsa:
'06:b2:8a:92:df:0e:11:2c:ca:7b:8f:a4:ba:6e:4b:fd'
,
ecdsa:
'45:ff:5b:98:9a:b6:8a:41:13:c1:30:8b:09:5e:7b:4e'
,
ecdsa:
'45:ff:5b:98:9a:b6:8a:41:13:c1:30:8b:09:5e:7b:4e'
,
ed25519:
'2e:65:6a:c8:cf:bf:b2:8b:9a:bd:6d:9f:11:5c:12:16'
,
ed25519:
'2e:65:6a:c8:cf:bf:b2:8b:9a:bd:6d:9f:11:5c:12:16'
,
dss:
'57:98:86:02:5f:9c:f4:9b:ad:5a:1e:51:92:0e:fd:2b'
dss:
'57:98:86:02:5f:9c:f4:9b:ad:5a:1e:51:92:0e:fd:2b'
}.
freeze
}.
freeze
...
...
spec/lib/gitlab/ldap/auth_hash_spec.rb
View file @
4edfad96
...
@@ -4,8 +4,8 @@ describe Gitlab::LDAP::AuthHash do
...
@@ -4,8 +4,8 @@ describe Gitlab::LDAP::AuthHash do
let
(
:auth_hash
)
do
let
(
:auth_hash
)
do
described_class
.
new
(
described_class
.
new
(
OmniAuth
::
AuthHash
.
new
(
OmniAuth
::
AuthHash
.
new
(
uid:
'123456'
,
uid:
'123456'
,
provider:
'ldapmain'
,
provider:
'ldapmain'
,
info:
info
,
info:
info
,
extra:
{
extra:
{
raw_info:
raw_info
raw_info:
raw_info
...
@@ -33,11 +33,11 @@ describe Gitlab::LDAP::AuthHash do
...
@@ -33,11 +33,11 @@ describe Gitlab::LDAP::AuthHash do
context
"without overridden attributes"
do
context
"without overridden attributes"
do
it
"has the correct username"
do
it
"has the correct username"
do
expect
(
auth_hash
.
username
).
to
eq
(
"123456"
)
expect
(
auth_hash
.
username
).
to
eq
(
"123456"
)
end
end
it
"has the correct name"
do
it
"has the correct name"
do
expect
(
auth_hash
.
name
).
to
eq
(
"Smith, J."
)
expect
(
auth_hash
.
name
).
to
eq
(
"Smith, J."
)
end
end
end
end
...
@@ -54,11 +54,11 @@ describe Gitlab::LDAP::AuthHash do
...
@@ -54,11 +54,11 @@ describe Gitlab::LDAP::AuthHash do
end
end
it
"has the correct username"
do
it
"has the correct username"
do
expect
(
auth_hash
.
username
).
to
eq
(
"johnsmith@example.com"
)
expect
(
auth_hash
.
username
).
to
eq
(
"johnsmith@example.com"
)
end
end
it
"has the correct name"
do
it
"has the correct name"
do
expect
(
auth_hash
.
name
).
to
eq
(
"John Smith"
)
expect
(
auth_hash
.
name
).
to
eq
(
"John Smith"
)
end
end
end
end
end
end
spec/lib/gitlab/o_auth/user_spec.rb
View file @
4edfad96
...
@@ -481,7 +481,7 @@ describe Gitlab::OAuth::User do
...
@@ -481,7 +481,7 @@ describe Gitlab::OAuth::User do
email:
'admin@othermail.com'
email:
'admin@othermail.com'
}
}
end
end
it
'generates the username with a counter'
do
it
'generates the username with a counter'
do
expect
(
gl_user
.
username
).
to
eq
(
'admin1'
)
expect
(
gl_user
.
username
).
to
eq
(
'admin1'
)
end
end
...
...
spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb
View file @
4edfad96
...
@@ -24,7 +24,7 @@ describe Gitlab::Prometheus::AdditionalMetricsParser do
...
@@ -24,7 +24,7 @@ describe Gitlab::Prometheus::AdditionalMetricsParser do
queries: [{ query_range: 'query_range_empty' }]
queries: [{ query_range: 'query_range_empty' }]
- group: group_b
- group: group_b
priority: 1
priority: 1
metrics:
metrics:
- title: title
- title: title
required_metrics: ['metric_a']
required_metrics: ['metric_a']
weight: 1
weight: 1
...
@@ -148,7 +148,7 @@ describe Gitlab::Prometheus::AdditionalMetricsParser do
...
@@ -148,7 +148,7 @@ describe Gitlab::Prometheus::AdditionalMetricsParser do
- group: group_a
- group: group_a
priority: 1
priority: 1
metrics:
metrics:
- title:
- title:
required_metrics: []
required_metrics: []
weight: 1
weight: 1
queries: []
queries: []
...
...
spec/migrations/migrate_old_artifacts_spec.rb
View file @
4edfad96
...
@@ -10,7 +10,7 @@ describe MigrateOldArtifacts do
...
@@ -10,7 +10,7 @@ describe MigrateOldArtifacts do
before
do
before
do
allow
(
Gitlab
.
config
.
artifacts
).
to
receive
(
:path
).
and_return
(
directory
)
allow
(
Gitlab
.
config
.
artifacts
).
to
receive
(
:path
).
and_return
(
directory
)
end
end
after
do
after
do
FileUtils
.
remove_entry_secure
(
directory
)
FileUtils
.
remove_entry_secure
(
directory
)
end
end
...
@@ -95,7 +95,7 @@ describe MigrateOldArtifacts do
...
@@ -95,7 +95,7 @@ describe MigrateOldArtifacts do
FileUtils
.
copy
(
FileUtils
.
copy
(
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts.zip'
),
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts.zip'
),
File
.
join
(
legacy_path
(
build
),
"ci_build_artifacts.zip"
))
File
.
join
(
legacy_path
(
build
),
"ci_build_artifacts.zip"
))
FileUtils
.
copy
(
FileUtils
.
copy
(
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts_metadata.gz'
),
Rails
.
root
.
join
(
'spec/fixtures/ci_build_artifacts_metadata.gz'
),
File
.
join
(
legacy_path
(
build
),
"ci_build_artifacts_metadata.gz"
))
File
.
join
(
legacy_path
(
build
),
"ci_build_artifacts_metadata.gz"
))
...
...
spec/requests/api/protected_branches_spec.rb
View file @
4edfad96
...
@@ -96,7 +96,7 @@ describe API::ProtectedBranches do
...
@@ -96,7 +96,7 @@ describe API::ProtectedBranches do
describe
'POST /projects/:id/protected_branches'
do
describe
'POST /projects/:id/protected_branches'
do
let
(
:branch_name
)
{
'new_branch'
}
let
(
:branch_name
)
{
'new_branch'
}
context
'when authenticated as a master'
do
context
'when authenticated as a master'
do
before
do
before
do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
end
end
...
@@ -221,7 +221,7 @@ describe API::ProtectedBranches do
...
@@ -221,7 +221,7 @@ describe API::ProtectedBranches do
context
'when branch has a wildcard in its name'
do
context
'when branch has a wildcard in its name'
do
let
(
:protected_name
)
{
'feature*'
}
let
(
:protected_name
)
{
'feature*'
}
it
"unprotects a wildcard branch"
do
it
"unprotects a wildcard branch"
do
delete
api
(
"/projects/
#{
project
.
id
}
/protected_branches/
#{
branch_name
}
"
,
user
)
delete
api
(
"/projects/
#{
project
.
id
}
/protected_branches/
#{
branch_name
}
"
,
user
)
...
...
spec/requests/api/settings_spec.rb
View file @
4edfad96
...
@@ -45,7 +45,7 @@ describe API::Settings, 'Settings' do
...
@@ -45,7 +45,7 @@ describe API::Settings, 'Settings' do
help_page_hide_commercial_content:
true
,
help_page_hide_commercial_content:
true
,
help_page_support_url:
'http://example.com/help'
,
help_page_support_url:
'http://example.com/help'
,
project_export_enabled:
false
project_export_enabled:
false
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
[
'default_projects_limit'
]).
to
eq
(
3
)
expect
(
json_response
[
'default_projects_limit'
]).
to
eq
(
3
)
expect
(
json_response
[
'password_authentication_enabled'
]).
to
be_falsey
expect
(
json_response
[
'password_authentication_enabled'
]).
to
be_falsey
...
...
spec/requests/ci/api/builds_spec.rb
View file @
4edfad96
...
@@ -130,7 +130,7 @@ describe Ci::API::Builds do
...
@@ -130,7 +130,7 @@ describe Ci::API::Builds do
register_builds
info:
{
platform: :darwin
}
register_builds
info:
{
platform: :darwin
}
expect
(
response
).
to
have_http_status
(
201
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
"options"
]).
to
be_empty
expect
(
json_response
[
"options"
]).
to
be_empty
end
end
end
end
...
...
spec/services/web_hook_service_spec.rb
View file @
4edfad96
...
@@ -144,7 +144,7 @@ describe WebHookService do
...
@@ -144,7 +144,7 @@ describe WebHookService do
describe
'#async_execute'
do
describe
'#async_execute'
do
let
(
:system_hook
)
{
create
(
:system_hook
)
}
let
(
:system_hook
)
{
create
(
:system_hook
)
}
it
'enqueue WebHookWorker'
do
it
'enqueue WebHookWorker'
do
expect
(
Sidekiq
::
Client
).
to
receive
(
:enqueue
).
with
(
WebHookWorker
,
project_hook
.
id
,
data
,
'push_hooks'
)
expect
(
Sidekiq
::
Client
).
to
receive
(
:enqueue
).
with
(
WebHookWorker
,
project_hook
.
id
,
data
,
'push_hooks'
)
...
...
spec/support/generate-seed-repo-rb
View file @
4edfad96
#!/usr/bin/env ruby
#!/usr/bin/env ruby
#
#
# # generate-seed-repo-rb
# # generate-seed-repo-rb
#
#
# This script generates the seed_repo.rb file used by lib/gitlab/git
# This script generates the seed_repo.rb file used by lib/gitlab/git
# tests. The seed_repo.rb file needs to be updated anytime there is a
# tests. The seed_repo.rb file needs to be updated anytime there is a
# Git push to https://gitlab.com/gitlab-org/gitlab-git-test.
# Git push to https://gitlab.com/gitlab-org/gitlab-git-test.
#
#
# Usage:
# Usage:
#
#
# ./spec/support/generate-seed-repo-rb > spec/support/seed_repo.rb
# ./spec/support/generate-seed-repo-rb > spec/support/seed_repo.rb
#
#
#
#
require
'erb'
require
'erb'
require
'tempfile'
require
'tempfile'
...
...
spec/support/matchers/access_matchers_for_controller.rb
View file @
4edfad96
# AccessMatchersForController
# AccessMatchersForController
#
#
# For testing authorize_xxx in controller.
# For testing authorize_xxx in controller.
module
AccessMatchersForController
module
AccessMatchersForController
extend
RSpec
::
Matchers
::
DSL
extend
RSpec
::
Matchers
::
DSL
include
Warden
::
Test
::
Helpers
include
Warden
::
Test
::
Helpers
...
...
spec/tasks/gitlab/gitaly_rake_spec.rb
View file @
4edfad96
...
@@ -89,7 +89,7 @@ describe 'gitlab:gitaly namespace rake task' do
...
@@ -89,7 +89,7 @@ describe 'gitlab:gitaly namespace rake task' do
it
'calls make in the gitaly directory without BUNDLE_PATH'
do
it
'calls make in the gitaly directory without BUNDLE_PATH'
do
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
[
'make'
]).
and_return
(
true
)
expect
(
main_object
).
to
receive
(
:run_command!
).
with
(
command_preamble
+
[
'make'
]).
and_return
(
true
)
run_rake_task
(
'gitlab:gitaly:install'
,
clone_path
)
run_rake_task
(
'gitlab:gitaly:install'
,
clone_path
)
end
end
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