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
b7d8df50
Commit
b7d8df50
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/MutableConstant
parent
3dadf306
Changes
118
Show whitespace changes
Inline
Side-by-side
Showing
118 changed files
with
190 additions
and
192 deletions
+190
-192
.rubocop.yml
.rubocop.yml
+3
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/controllers/admin/system_info_controller.rb
app/controllers/admin/system_info_controller.rb
+2
-2
app/controllers/concerns/service_params.rb
app/controllers/concerns/service_params.rb
+2
-2
app/controllers/jwt_controller.rb
app/controllers/jwt_controller.rb
+1
-1
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-1
app/finders/todos_finder.rb
app/finders/todos_finder.rb
+1
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
app/models/ci/runner.rb
app/models/ci/runner.rb
+2
-2
app/models/commit.rb
app/models/commit.rb
+1
-1
app/models/concerns/cache_markdown_field.rb
app/models/concerns/cache_markdown_field.rb
+1
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+6
-6
app/models/label.rb
app/models/label.rb
+1
-1
app/models/members/group_member.rb
app/models/members/group_member.rb
+1
-1
app/models/members/project_member.rb
app/models/members/project_member.rb
+1
-1
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+1
-1
app/models/notification_setting.rb
app/models/notification_setting.rb
+2
-2
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_feature.rb
app/models/project_feature.rb
+1
-1
app/models/project_services/buildkite_service.rb
app/models/project_services/buildkite_service.rb
+1
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+1
-1
app/models/project_services/pivotaltracker_service.rb
app/models/project_services/pivotaltracker_service.rb
+1
-1
app/models/project_statistics.rb
app/models/project_statistics.rb
+1
-1
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+2
-2
app/models/todo.rb
app/models/todo.rb
+1
-1
app/services/auth/container_registry_authentication_service.rb
...ervices/auth/container_registry_authentication_service.rb
+1
-1
app/services/members/destroy_service.rb
app/services/members/destroy_service.rb
+1
-1
app/services/notes/slash_commands_service.rb
app/services/notes/slash_commands_service.rb
+1
-1
app/services/projects/destroy_service.rb
app/services/projects/destroy_service.rb
+1
-1
app/services/projects/download_service.rb
app/services/projects/download_service.rb
+1
-1
app/services/projects/update_pages_service.rb
app/services/projects/update_pages_service.rb
+1
-1
app/uploaders/uploader_helper.rb
app/uploaders/uploader_helper.rb
+3
-3
app/validators/addressable_url_validator.rb
app/validators/addressable_url_validator.rb
+1
-1
config/initializers/gollum.rb
config/initializers/gollum.rb
+1
-1
config/initializers/workhorse_multipart.rb
config/initializers/workhorse_multipart.rb
+1
-1
config/routes/wiki.rb
config/routes/wiki.rb
+1
-1
db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb
...evelopers_can_merge_to_protected_branches_merge_access.rb
+1
-1
db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb
..._developers_can_push_to_protected_branches_push_access.rb
+1
-1
db/migrate/20160729173930_remove_project_id_from_spam_logs.rb
...igrate/20160729173930_remove_project_id_from_spam_logs.rb
+1
-1
db/migrate/20160823081327_change_merge_error_to_text.rb
db/migrate/20160823081327_change_merge_error_to_text.rb
+1
-1
db/migrate/20160824124900_add_table_issue_metrics.rb
db/migrate/20160824124900_add_table_issue_metrics.rb
+1
-1
db/migrate/20160825052008_add_table_merge_request_metrics.rb
db/migrate/20160825052008_add_table_merge_request_metrics.rb
+1
-1
db/migrate/20160829114652_add_markdown_cache_columns.rb
db/migrate/20160829114652_add_markdown_cache_columns.rb
+1
-1
db/migrate/20160831214543_migrate_project_features.rb
db/migrate/20160831214543_migrate_project_features.rb
+1
-1
db/migrate/20160831223750_remove_features_enabled_from_projects.rb
...e/20160831223750_remove_features_enabled_from_projects.rb
+1
-1
db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
+1
-1
db/migrate/20160913212128_change_artifacts_size_column.rb
db/migrate/20160913212128_change_artifacts_size_column.rb
+1
-1
db/migrate/20160915042921_create_merge_requests_closing_issues.rb
...te/20160915042921_create_merge_requests_closing_issues.rb
+1
-1
db/migrate/20160919144305_add_type_to_labels.rb
db/migrate/20160919144305_add_type_to_labels.rb
+1
-1
db/migrate/20161014173530_create_label_priorities.rb
db/migrate/20161014173530_create_label_priorities.rb
+1
-1
db/migrate/20161017125927_add_unique_index_to_labels.rb
db/migrate/20161017125927_add_unique_index_to_labels.rb
+1
-1
db/migrate/20161018024215_migrate_labels_priority.rb
db/migrate/20161018024215_migrate_labels_priority.rb
+1
-1
db/migrate/20161018024550_remove_priority_from_labels.rb
db/migrate/20161018024550_remove_priority_from_labels.rb
+1
-1
db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb
...ate/20161019190736_migrate_sidekiq_queues_from_default.rb
+2
-2
db/migrate/20161019213545_generate_project_feature_for_projects.rb
...e/20161019213545_generate_project_feature_for_projects.rb
+1
-1
db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
...0161020083353_add_pipeline_id_to_merge_request_metrics.rb
+1
-1
db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
...ate/20161024042317_migrate_mailroom_queue_from_default.rb
+2
-2
db/migrate/20161025231710_migrate_jira_to_gem.rb
db/migrate/20161025231710_migrate_jira_to_gem.rb
+1
-1
db/migrate/20161031174110_migrate_subscriptions_project_id.rb
...igrate/20161031174110_migrate_subscriptions_project_id.rb
+1
-1
db/migrate/20161031181638_add_unique_index_to_subscriptions.rb
...grate/20161031181638_add_unique_index_to_subscriptions.rb
+1
-1
db/migrate/20161103171205_rename_repository_storage_column.rb
...igrate/20161103171205_rename_repository_storage_column.rb
+1
-1
db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb
...rate/20161124141322_migrate_process_commit_worker_jobs.rb
+1
-1
db/migrate/20161130095245_fill_routes_table.rb
db/migrate/20161130095245_fill_routes_table.rb
+1
-1
db/migrate/20161130101252_fill_projects_routes_table.rb
db/migrate/20161130101252_fill_projects_routes_table.rb
+1
-1
db/migrate/20161201160452_migrate_project_statistics.rb
db/migrate/20161201160452_migrate_project_statistics.rb
+1
-1
db/migrate/20161207231620_fixup_environment_name_uniqueness.rb
...grate/20161207231620_fixup_environment_name_uniqueness.rb
+1
-1
db/migrate/20161207231621_create_environment_name_unique_index.rb
...te/20161207231621_create_environment_name_unique_index.rb
+1
-1
db/migrate/20161207231626_add_environment_slug.rb
db/migrate/20161207231626_add_environment_slug.rb
+1
-1
db/migrate/20161209153400_add_unique_index_for_environment_slug.rb
...e/20161209153400_add_unique_index_for_environment_slug.rb
+1
-1
db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
+1
-1
db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
...20161011222551_remove_inactive_jira_service_properties.rb
+1
-1
db/post_migrate/20161221153951_rename_reserved_project_names.rb
...t_migrate/20161221153951_rename_reserved_project_names.rb
+1
-1
lib/api/api_guard.rb
lib/api/api_guard.rb
+1
-1
lib/api/award_emoji.rb
lib/api/award_emoji.rb
+1
-1
lib/api/helpers.rb
lib/api/helpers.rb
+1
-1
lib/api/notes.rb
lib/api/notes.rb
+1
-1
lib/api/todos.rb
lib/api/todos.rb
+1
-1
lib/banzai/filter/autolink_filter.rb
lib/banzai/filter/autolink_filter.rb
+1
-1
lib/bitbucket/connection.rb
lib/bitbucket/connection.rb
+3
-3
lib/ci/ansi2html.rb
lib/ci/ansi2html.rb
+3
-3
lib/ci/api/helpers.rb
lib/ci/api/helpers.rb
+1
-1
lib/container_registry/client.rb
lib/container_registry/client.rb
+1
-1
lib/gitlab/auth.rb
lib/gitlab/auth.rb
+2
-2
lib/gitlab/badge/build/template.rb
lib/gitlab/badge/build/template.rb
+1
-1
lib/gitlab/badge/coverage/template.rb
lib/gitlab/badge/coverage/template.rb
+1
-1
lib/gitlab/ci/config/entry/artifacts.rb
lib/gitlab/ci/config/entry/artifacts.rb
+1
-1
lib/gitlab/ci/config/entry/cache.rb
lib/gitlab/ci/config/entry/cache.rb
+1
-1
lib/gitlab/ci/config/entry/environment.rb
lib/gitlab/ci/config/entry/environment.rb
+1
-1
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+1
-1
lib/gitlab/diff/inline_diff_marker.rb
lib/gitlab/diff/inline_diff_marker.rb
+1
-1
lib/gitlab/downtime_check/message.rb
lib/gitlab/downtime_check/message.rb
+2
-2
lib/gitlab/email/handler.rb
lib/gitlab/email/handler.rb
+1
-1
lib/gitlab/exclusive_lease.rb
lib/gitlab/exclusive_lease.rb
+1
-1
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+1
-1
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+3
-3
lib/gitlab/import_export.rb
lib/gitlab/import_export.rb
+1
-1
lib/gitlab/metrics/rack_middleware.rb
lib/gitlab/metrics/rack_middleware.rb
+3
-3
lib/gitlab/metrics/subscribers/action_view.rb
lib/gitlab/metrics/subscribers/action_view.rb
+1
-1
lib/gitlab/metrics/transaction.rb
lib/gitlab/metrics/transaction.rb
+1
-1
lib/gitlab/middleware/multipart.rb
lib/gitlab/middleware/multipart.rb
+1
-1
lib/gitlab/redis.rb
lib/gitlab/redis.rb
+5
-5
lib/gitlab/reference_extractor.rb
lib/gitlab/reference_extractor.rb
+1
-1
lib/gitlab/request_profiler.rb
lib/gitlab/request_profiler.rb
+1
-1
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+4
-4
rubocop/cop/gem_fetcher.rb
rubocop/cop/gem_fetcher.rb
+2
-2
rubocop/cop/migration/add_column.rb
rubocop/cop/migration/add_column.rb
+2
-2
rubocop/cop/migration/add_column_with_default.rb
rubocop/cop/migration/add_column_with_default.rb
+1
-1
rubocop/cop/migration/add_concurrent_foreign_key.rb
rubocop/cop/migration/add_concurrent_foreign_key.rb
+1
-1
rubocop/cop/migration/add_index.rb
rubocop/cop/migration/add_index.rb
+1
-1
spec/features/merge_requests/conflicts_spec.rb
spec/features/merge_requests/conflicts_spec.rb
+1
-1
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+1
-1
spec/support/javascript_fixtures_helpers.rb
spec/support/javascript_fixtures_helpers.rb
+1
-1
spec/support/jira_service_helper.rb
spec/support/jira_service_helper.rb
+1
-1
spec/support/seed_helper.rb
spec/support/seed_helper.rb
+1
-1
spec/support/seed_repo.rb
spec/support/seed_repo.rb
+38
-38
spec/support/test_env.rb
spec/support/test_env.rb
+2
-2
No files found.
.rubocop.yml
View file @
b7d8df50
...
@@ -308,6 +308,9 @@ Style/MultilineOperationIndentation:
...
@@ -308,6 +308,9 @@ Style/MultilineOperationIndentation:
Style/MultilineTernaryOperator
:
Style/MultilineTernaryOperator
:
Enabled
:
true
Enabled
:
true
Style/MutableConstant
:
Enabled
:
true
# Favor unless over if for negative conditions (or control flow or).
# Favor unless over if for negative conditions (or control flow or).
Style/NegatedIf
:
Style/NegatedIf
:
Enabled
:
true
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
b7d8df50
...
@@ -471,11 +471,6 @@ Style/MultilineIfModifier:
...
@@ -471,11 +471,6 @@ Style/MultilineIfModifier:
-
'
app/models/project_wiki.rb'
-
'
app/models/project_wiki.rb'
-
'
lib/gitlab/workhorse.rb'
-
'
lib/gitlab/workhorse.rb'
# Offense count: 187
# Cop supports --auto-correct.
Style/MutableConstant
:
Enabled
:
false
# Offense count: 8
# Offense count: 8
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/NestedParenthesizedCalls
:
Style/NestedParenthesizedCalls
:
...
...
app/controllers/admin/system_info_controller.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ class Admin::SystemInfoController < Admin::ApplicationController
...
@@ -3,7 +3,7 @@ class Admin::SystemInfoController < Admin::ApplicationController
'nobrowse'
,
'nobrowse'
,
'read-only'
,
'read-only'
,
'ro'
'ro'
]
]
.
freeze
EXCLUDED_MOUNT_TYPES
=
[
EXCLUDED_MOUNT_TYPES
=
[
'autofs'
,
'autofs'
,
...
@@ -27,7 +27,7 @@ class Admin::SystemInfoController < Admin::ApplicationController
...
@@ -27,7 +27,7 @@ class Admin::SystemInfoController < Admin::ApplicationController
'tmpfs'
,
'tmpfs'
,
'tracefs'
,
'tracefs'
,
'vfat'
'vfat'
]
]
.
freeze
def
show
def
show
@cpus
=
Vmstat
.
cpu
rescue
nil
@cpus
=
Vmstat
.
cpu
rescue
nil
...
...
app/controllers/concerns/service_params.rb
View file @
b7d8df50
...
@@ -59,10 +59,10 @@ module ServiceParams
...
@@ -59,10 +59,10 @@ module ServiceParams
:user_key
,
:user_key
,
:username
,
:username
,
:webhook
:webhook
]
]
.
freeze
# Parameters to ignore if no value is specified
# Parameters to ignore if no value is specified
FILTER_BLANK_PARAMS
=
[
:password
]
FILTER_BLANK_PARAMS
=
[
:password
]
.
freeze
def
service_params
def
service_params
dynamic_params
=
@service
.
event_channel_names
+
@service
.
event_names
dynamic_params
=
@service
.
event_channel_names
+
@service
.
event_names
...
...
app/controllers/jwt_controller.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class JwtController < ApplicationController
...
@@ -5,7 +5,7 @@ class JwtController < ApplicationController
SERVICES
=
{
SERVICES
=
{
Auth
::
ContainerRegistryAuthenticationService
::
AUDIENCE
=>
Auth
::
ContainerRegistryAuthenticationService
,
Auth
::
ContainerRegistryAuthenticationService
::
AUDIENCE
=>
Auth
::
ContainerRegistryAuthenticationService
,
}
}
.
freeze
def
auth
def
auth
service
=
SERVICES
[
params
[
:service
]]
service
=
SERVICES
[
params
[
:service
]]
...
...
app/finders/issuable_finder.rb
View file @
b7d8df50
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
# iids: integer[]
# iids: integer[]
#
#
class
IssuableFinder
class
IssuableFinder
NONE
=
'0'
NONE
=
'0'
.
freeze
attr_accessor
:current_user
,
:params
attr_accessor
:current_user
,
:params
...
...
app/finders/todos_finder.rb
View file @
b7d8df50
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#
#
class
TodosFinder
class
TodosFinder
NONE
=
'0'
NONE
=
'0'
.
freeze
attr_accessor
:current_user
,
:params
attr_accessor
:current_user
,
:params
...
...
app/helpers/issuables_helper.rb
View file @
b7d8df50
...
@@ -198,7 +198,7 @@ module IssuablesHelper
...
@@ -198,7 +198,7 @@ module IssuablesHelper
@counts
[
issuable_type
][
state
]
@counts
[
issuable_type
][
state
]
end
end
IRRELEVANT_PARAMS_FOR_CACHE_KEY
=
%i[utf8 sort page]
IRRELEVANT_PARAMS_FOR_CACHE_KEY
=
%i[utf8 sort page]
.
freeze
private_constant
:IRRELEVANT_PARAMS_FOR_CACHE_KEY
private_constant
:IRRELEVANT_PARAMS_FOR_CACHE_KEY
def
issuables_state_counter_cache_key
(
issuable_type
,
state
)
def
issuables_state_counter_cache_key
(
issuable_type
,
state
)
...
...
app/models/application_setting.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class ApplicationSetting < ActiveRecord::Base
...
@@ -5,7 +5,7 @@ class ApplicationSetting < ActiveRecord::Base
add_authentication_token_field
:runners_registration_token
add_authentication_token_field
:runners_registration_token
add_authentication_token_field
:health_check_access_token
add_authentication_token_field
:health_check_access_token
CACHE_KEY
=
'application_setting.last'
CACHE_KEY
=
'application_setting.last'
.
freeze
DOMAIN_LIST_SEPARATOR
=
%r{
\s
*[,;]
\s
* # comma or semicolon, optionally surrounded by whitespace
DOMAIN_LIST_SEPARATOR
=
%r{
\s
*[,;]
\s
* # comma or semicolon, optionally surrounded by whitespace
| # or
| # or
\s
# any whitespace character
\s
# any whitespace character
...
...
app/models/ci/runner.rb
View file @
b7d8df50
...
@@ -4,8 +4,8 @@ module Ci
...
@@ -4,8 +4,8 @@ module Ci
RUNNER_QUEUE_EXPIRY_TIME
=
60
.
minutes
RUNNER_QUEUE_EXPIRY_TIME
=
60
.
minutes
LAST_CONTACT_TIME
=
1
.
hour
.
ago
LAST_CONTACT_TIME
=
1
.
hour
.
ago
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
AVAILABLE_SCOPES
=
%w[specific shared active paused online]
.
freeze
FORM_EDITABLE
=
%i[description tag_list active run_untagged locked]
FORM_EDITABLE
=
%i[description tag_list active run_untagged locked]
.
freeze
has_many
:builds
has_many
:builds
has_many
:runner_projects
,
dependent: :destroy
has_many
:runner_projects
,
dependent: :destroy
...
...
app/models/commit.rb
View file @
b7d8df50
...
@@ -22,7 +22,7 @@ class Commit
...
@@ -22,7 +22,7 @@ class Commit
DIFF_HARD_LIMIT_LINES
=
50000
DIFF_HARD_LIMIT_LINES
=
50000
# The SHA can be between 7 and 40 hex characters.
# The SHA can be between 7 and 40 hex characters.
COMMIT_SHA_PATTERN
=
'\h{7,40}'
COMMIT_SHA_PATTERN
=
'\h{7,40}'
.
freeze
class
<<
self
class
<<
self
def
decorate
(
commits
,
project
)
def
decorate
(
commits
,
project
)
...
...
app/models/concerns/cache_markdown_field.rb
View file @
b7d8df50
...
@@ -45,7 +45,7 @@ module CacheMarkdownField
...
@@ -45,7 +45,7 @@ module CacheMarkdownField
Project
Project
Release
Release
Snippet
Snippet
]
]
.
freeze
def
self
.
caching_classes
def
self
.
caching_classes
CACHING_CLASSES
.
map
(
&
:constantize
)
CACHING_CLASSES
.
map
(
&
:constantize
)
...
...
app/models/concerns/has_status.rb
View file @
b7d8df50
module
HasStatus
module
HasStatus
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
DEFAULT_STATUS
=
'created'
DEFAULT_STATUS
=
'created'
.
freeze
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
AVAILABLE_STATUSES
=
%w[created pending running success failed canceled skipped]
.
freeze
STARTED_STATUSES
=
%w[running success failed skipped]
STARTED_STATUSES
=
%w[running success failed skipped]
.
freeze
ACTIVE_STATUSES
=
%w[pending running]
ACTIVE_STATUSES
=
%w[pending running]
.
freeze
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
.
freeze
ORDERED_STATUSES
=
%w[failed pending running canceled success skipped]
ORDERED_STATUSES
=
%w[failed pending running canceled success skipped]
.
freeze
class_methods
do
class_methods
do
def
status_sql
def
status_sql
...
...
app/models/label.rb
View file @
b7d8df50
...
@@ -11,7 +11,7 @@ class Label < ActiveRecord::Base
...
@@ -11,7 +11,7 @@ class Label < ActiveRecord::Base
cache_markdown_field
:description
,
pipeline: :single_line
cache_markdown_field
:description
,
pipeline: :single_line
DEFAULT_COLOR
=
'#428BCA'
DEFAULT_COLOR
=
'#428BCA'
.
freeze
default_value_for
:color
,
DEFAULT_COLOR
default_value_for
:color
,
DEFAULT_COLOR
...
...
app/models/members/group_member.rb
View file @
b7d8df50
class
GroupMember
<
Member
class
GroupMember
<
Member
SOURCE_TYPE
=
'Namespace'
SOURCE_TYPE
=
'Namespace'
.
freeze
belongs_to
:group
,
foreign_key:
'source_id'
belongs_to
:group
,
foreign_key:
'source_id'
...
...
app/models/members/project_member.rb
View file @
b7d8df50
class
ProjectMember
<
Member
class
ProjectMember
<
Member
SOURCE_TYPE
=
'Project'
SOURCE_TYPE
=
'Project'
.
freeze
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
...
...
app/models/merge_request_diff.rb
View file @
b7d8df50
...
@@ -7,7 +7,7 @@ class MergeRequestDiff < ActiveRecord::Base
...
@@ -7,7 +7,7 @@ class MergeRequestDiff < ActiveRecord::Base
COMMITS_SAFE_SIZE
=
100
COMMITS_SAFE_SIZE
=
100
# Valid types of serialized diffs allowed by Gitlab::Git::Diff
# Valid types of serialized diffs allowed by Gitlab::Git::Diff
VALID_CLASSES
=
[
Hash
,
Rugged
::
Patch
,
Rugged
::
Diff
::
Delta
]
VALID_CLASSES
=
[
Hash
,
Rugged
::
Patch
,
Rugged
::
Diff
::
Delta
]
.
freeze
belongs_to
:merge_request
belongs_to
:merge_request
...
...
app/models/notification_setting.rb
View file @
b7d8df50
...
@@ -35,11 +35,11 @@ class NotificationSetting < ActiveRecord::Base
...
@@ -35,11 +35,11 @@ class NotificationSetting < ActiveRecord::Base
:merge_merge_request
,
:merge_merge_request
,
:failed_pipeline
,
:failed_pipeline
,
:success_pipeline
:success_pipeline
]
]
.
freeze
EXCLUDED_WATCHER_EVENTS
=
[
EXCLUDED_WATCHER_EVENTS
=
[
:success_pipeline
:success_pipeline
]
]
.
freeze
store
:events
,
accessors:
EMAIL_EVENTS
,
coder:
JSON
store
:events
,
accessors:
EMAIL_EVENTS
,
coder:
JSON
...
...
app/models/project.rb
View file @
b7d8df50
...
@@ -22,7 +22,7 @@ class Project < ActiveRecord::Base
...
@@ -22,7 +22,7 @@ class Project < ActiveRecord::Base
class
BoardLimitExceeded
<
StandardError
;
end
class
BoardLimitExceeded
<
StandardError
;
end
NUMBER_OF_PERMITTED_BOARDS
=
1
NUMBER_OF_PERMITTED_BOARDS
=
1
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
UNKNOWN_IMPORT_URL
=
'http://unknown.git'
.
freeze
cache_markdown_field
:description
,
pipeline: :description
cache_markdown_field
:description
,
pipeline: :description
...
...
app/models/project_feature.rb
View file @
b7d8df50
...
@@ -18,7 +18,7 @@ class ProjectFeature < ActiveRecord::Base
...
@@ -18,7 +18,7 @@ class ProjectFeature < ActiveRecord::Base
PRIVATE
=
10
PRIVATE
=
10
ENABLED
=
20
ENABLED
=
20
FEATURES
=
%i(issues merge_requests wiki snippets builds repository)
FEATURES
=
%i(issues merge_requests wiki snippets builds repository)
.
freeze
class
<<
self
class
<<
self
def
access_level_attribute
(
feature
)
def
access_level_attribute
(
feature
)
...
...
app/models/project_services/buildkite_service.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ require "addressable/uri"
...
@@ -3,7 +3,7 @@ require "addressable/uri"
class
BuildkiteService
<
CiService
class
BuildkiteService
<
CiService
include
ReactiveService
include
ReactiveService
ENDPOINT
=
"https://buildkite.com"
ENDPOINT
=
"https://buildkite.com"
.
freeze
prop_accessor
:project_url
,
:token
prop_accessor
:project_url
,
:token
boolean_accessor
:enable_ssl_verification
boolean_accessor
:enable_ssl_verification
...
...
app/models/project_services/hipchat_service.rb
View file @
b7d8df50
...
@@ -6,7 +6,7 @@ class HipchatService < Service
...
@@ -6,7 +6,7 @@ class HipchatService < Service
a b i strong em br img pre code
a b i strong em br img pre code
table th tr td caption colgroup col thead tbody tfoot
table th tr td caption colgroup col thead tbody tfoot
ul ol li dl dt dd
ul ol li dl dt dd
]
]
.
freeze
prop_accessor
:token
,
:room
,
:server
,
:color
,
:api_version
prop_accessor
:token
,
:room
,
:server
,
:color
,
:api_version
boolean_accessor
:notify_only_broken_builds
,
:notify
boolean_accessor
:notify_only_broken_builds
,
:notify
...
...
app/models/project_services/pivotaltracker_service.rb
View file @
b7d8df50
class
PivotaltrackerService
<
Service
class
PivotaltrackerService
<
Service
include
HTTParty
include
HTTParty
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
.
freeze
prop_accessor
:token
,
:restrict_to_branch
prop_accessor
:token
,
:restrict_to_branch
validates
:token
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/project_statistics.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ class ProjectStatistics < ActiveRecord::Base
...
@@ -4,7 +4,7 @@ class ProjectStatistics < ActiveRecord::Base
before_save
:update_storage_size
before_save
:update_storage_size
STORAGE_COLUMNS
=
[
:repository_size
,
:lfs_objects_size
,
:build_artifacts_size
]
STORAGE_COLUMNS
=
[
:repository_size
,
:lfs_objects_size
,
:build_artifacts_size
]
.
freeze
STATISTICS_COLUMNS
=
[
:commit_count
]
+
STORAGE_COLUMNS
STATISTICS_COLUMNS
=
[
:commit_count
]
+
STORAGE_COLUMNS
def
total_repository_size
def
total_repository_size
...
...
app/models/project_wiki.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class ProjectWiki
...
@@ -5,7 +5,7 @@ class ProjectWiki
'Markdown'
=>
:markdown
,
'Markdown'
=>
:markdown
,
'RDoc'
=>
:rdoc
,
'RDoc'
=>
:rdoc
,
'AsciiDoc'
=>
:asciidoc
'AsciiDoc'
=>
:asciidoc
}
unless
defined?
(
MARKUPS
)
}
.
freeze
unless
defined?
(
MARKUPS
)
class
CouldNotCreateWikiError
<
StandardError
;
end
class
CouldNotCreateWikiError
<
StandardError
;
end
...
...
app/models/repository.rb
View file @
b7d8df50
...
@@ -18,7 +18,7 @@ class Repository
...
@@ -18,7 +18,7 @@ class Repository
CACHED_METHODS
=
%i(size commit_count readme version contribution_guide
CACHED_METHODS
=
%i(size commit_count readme version contribution_guide
changelog license_blob license_key gitignore koding_yml
changelog license_blob license_key gitignore koding_yml
gitlab_ci_yml branch_names tag_names branch_count
gitlab_ci_yml branch_names tag_names branch_count
tag_count avatar exists? empty? root_ref)
tag_count avatar exists? empty? root_ref)
.
freeze
# Certain method caches should be refreshed when certain types of files are
# Certain method caches should be refreshed when certain types of files are
# changed. This Hash maps file types (as returned by Gitlab::FileDetector) to
# changed. This Hash maps file types (as returned by Gitlab::FileDetector) to
...
@@ -33,7 +33,7 @@ class Repository
...
@@ -33,7 +33,7 @@ class Repository
koding: :koding_yml
,
koding: :koding_yml
,
gitlab_ci: :gitlab_ci_yml
,
gitlab_ci: :gitlab_ci_yml
,
avatar: :avatar
avatar: :avatar
}
}
.
freeze
# Wraps around the given method and caches its output in Redis and an instance
# Wraps around the given method and caches its output in Redis and an instance
# variable.
# variable.
...
...
app/models/todo.rb
View file @
b7d8df50
...
@@ -17,7 +17,7 @@ class Todo < ActiveRecord::Base
...
@@ -17,7 +17,7 @@ class Todo < ActiveRecord::Base
APPROVAL_REQUIRED
=>
:approval_required
,
APPROVAL_REQUIRED
=>
:approval_required
,
UNMERGEABLE
=>
:unmergeable
,
UNMERGEABLE
=>
:unmergeable
,
DIRECTLY_ADDRESSED
=>
:directly_addressed
DIRECTLY_ADDRESSED
=>
:directly_addressed
}
}
.
freeze
belongs_to
:author
,
class_name:
"User"
belongs_to
:author
,
class_name:
"User"
belongs_to
:note
belongs_to
:note
...
...
app/services/auth/container_registry_authentication_service.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ module Auth
...
@@ -2,7 +2,7 @@ module Auth
class
ContainerRegistryAuthenticationService
<
BaseService
class
ContainerRegistryAuthenticationService
<
BaseService
include
Gitlab
::
CurrentSettings
include
Gitlab
::
CurrentSettings
AUDIENCE
=
'container_registry'
AUDIENCE
=
'container_registry'
.
freeze
def
execute
(
authentication_abilities
:)
def
execute
(
authentication_abilities
:)
@authentication_abilities
=
authentication_abilities
@authentication_abilities
=
authentication_abilities
...
...
app/services/members/destroy_service.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ module Members
...
@@ -4,7 +4,7 @@ module Members
attr_accessor
:source
attr_accessor
:source
ALLOWED_SCOPES
=
%i[members requesters all]
ALLOWED_SCOPES
=
%i[members requesters all]
.
freeze
def
initialize
(
source
,
current_user
,
params
=
{})
def
initialize
(
source
,
current_user
,
params
=
{})
@source
=
source
@source
=
source
...
...
app/services/notes/slash_commands_service.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ module Notes
...
@@ -3,7 +3,7 @@ module Notes
UPDATE_SERVICES
=
{
UPDATE_SERVICES
=
{
'Issue'
=>
Issues
::
UpdateService
,
'Issue'
=>
Issues
::
UpdateService
,
'MergeRequest'
=>
MergeRequests
::
UpdateService
'MergeRequest'
=>
MergeRequests
::
UpdateService
}
}
.
freeze
def
self
.
noteable_update_service
(
note
)
def
self
.
noteable_update_service
(
note
)
UPDATE_SERVICES
[
note
.
noteable_type
]
UPDATE_SERVICES
[
note
.
noteable_type
]
...
...
app/services/projects/destroy_service.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ module Projects
...
@@ -4,7 +4,7 @@ module Projects
class
DestroyError
<
StandardError
;
end
class
DestroyError
<
StandardError
;
end
DELETED_FLAG
=
'+deleted'
DELETED_FLAG
=
'+deleted'
.
freeze
def
async_execute
def
async_execute
project
.
transaction
do
project
.
transaction
do
...
...
app/services/projects/download_service.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ module Projects
...
@@ -2,7 +2,7 @@ module Projects
class
DownloadService
<
BaseService
class
DownloadService
<
BaseService
WHITELIST
=
[
WHITELIST
=
[
/^[^.]+\.fogbugz.com$/
/^[^.]+\.fogbugz.com$/
]
]
.
freeze
def
initialize
(
project
,
url
)
def
initialize
(
project
,
url
)
@project
,
@url
=
project
,
url
@project
,
@url
=
project
,
url
...
...
app/services/projects/update_pages_service.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ module Projects
...
@@ -2,7 +2,7 @@ module Projects
class
UpdatePagesService
<
BaseService
class
UpdatePagesService
<
BaseService
BLOCK_SIZE
=
32
.
kilobytes
BLOCK_SIZE
=
32
.
kilobytes
MAX_SIZE
=
1
.
terabyte
MAX_SIZE
=
1
.
terabyte
SITE_PATH
=
'public/'
SITE_PATH
=
'public/'
.
freeze
attr_reader
:build
attr_reader
:build
...
...
app/uploaders/uploader_helper.rb
View file @
b7d8df50
# Extra methods for uploader
# Extra methods for uploader
module
UploaderHelper
module
UploaderHelper
IMAGE_EXT
=
%w[png jpg jpeg gif bmp tiff]
IMAGE_EXT
=
%w[png jpg jpeg gif bmp tiff]
.
freeze
# We recommend using the .mp4 format over .mov. Videos in .mov format can
# We recommend using the .mp4 format over .mov. Videos in .mov format can
# still be used but you really need to make sure they are served with the
# still be used but you really need to make sure they are served with the
# proper MIME type video/mp4 and not video/quicktime or your videos won't play
# proper MIME type video/mp4 and not video/quicktime or your videos won't play
# on IE >= 9.
# on IE >= 9.
# http://archive.sublimevideo.info/20150912/docs.sublimevideo.net/troubleshooting.html
# http://archive.sublimevideo.info/20150912/docs.sublimevideo.net/troubleshooting.html
VIDEO_EXT
=
%w[mp4 m4v mov webm ogv]
VIDEO_EXT
=
%w[mp4 m4v mov webm ogv]
.
freeze
# These extension types can contain dangerous code and should only be embedded inline with
# These extension types can contain dangerous code and should only be embedded inline with
# proper filtering. They should always be tagged as "Content-Disposition: attachment", not "inline".
# proper filtering. They should always be tagged as "Content-Disposition: attachment", not "inline".
DANGEROUS_EXT
=
%w[svg]
DANGEROUS_EXT
=
%w[svg]
.
freeze
def
image?
def
image?
extension_match?
(
IMAGE_EXT
)
extension_match?
(
IMAGE_EXT
)
...
...
app/validators/addressable_url_validator.rb
View file @
b7d8df50
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
# end
# end
#
#
class
AddressableUrlValidator
<
ActiveModel
::
EachValidator
class
AddressableUrlValidator
<
ActiveModel
::
EachValidator
DEFAULT_OPTIONS
=
{
protocols:
%w(http https ssh git)
}
DEFAULT_OPTIONS
=
{
protocols:
%w(http https ssh git)
}
.
freeze
def
validate_each
(
record
,
attribute
,
value
)
def
validate_each
(
record
,
attribute
,
value
)
unless
valid_url?
(
value
)
unless
valid_url?
(
value
)
...
...
config/initializers/gollum.rb
View file @
b7d8df50
module
Gollum
module
Gollum
GIT_ADAPTER
=
"rugged"
GIT_ADAPTER
=
"rugged"
.
freeze
end
end
require
"gollum-lib"
require
"gollum-lib"
...
...
config/initializers/workhorse_multipart.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ end
...
@@ -10,7 +10,7 @@ end
#
#
module
Gitlab
module
Gitlab
module
StrongParameterScalars
module
StrongParameterScalars
GITLAB_PERMITTED_SCALAR_TYPES
=
[
::
UploadedFile
]
GITLAB_PERMITTED_SCALAR_TYPES
=
[
::
UploadedFile
]
.
freeze
def
permitted_scalar?
(
value
)
def
permitted_scalar?
(
value
)
super
||
GITLAB_PERMITTED_SCALAR_TYPES
.
any?
{
|
type
|
value
.
is_a?
(
type
)
}
super
||
GITLAB_PERMITTED_SCALAR_TYPES
.
any?
{
|
type
|
value
.
is_a?
(
type
)
}
...
...
config/routes/wiki.rb
View file @
b7d8df50
WIKI_SLUG_ID
=
{
id:
/\S+/
}
unless
defined?
WIKI_SLUG_ID
WIKI_SLUG_ID
=
{
id:
/\S+/
}
.
freeze
unless
defined?
WIKI_SLUG_ID
scope
(
controller: :wikis
)
do
scope
(
controller: :wikis
)
do
scope
(
path:
'wikis'
,
as: :wikis
)
do
scope
(
path:
'wikis'
,
as: :wikis
)
do
...
...
db/migrate/20160705055254_move_from_developers_can_merge_to_protected_branches_merge_access.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
class
MoveFromDevelopersCanMergeToProtectedBranchesMergeAccess
<
ActiveRecord
::
Migration
class
MoveFromDevelopersCanMergeToProtectedBranchesMergeAccess
<
ActiveRecord
::
Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
HEREDOC
DOWNTIME_REASON
=
<<-
HEREDOC
.
freeze
We're creating a `merge_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
We're creating a `merge_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
is running, we might be left with a `protected_branch` _without_ an associated `merge_access_level`. The `protected_branches`
is running, we might be left with a `protected_branch` _without_ an associated `merge_access_level`. The `protected_branches`
table must not change while this is running, so downtime is required.
table must not change while this is running, so downtime is required.
...
...
db/migrate/20160705055308_move_from_developers_can_push_to_protected_branches_push_access.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
class
MoveFromDevelopersCanPushToProtectedBranchesPushAccess
<
ActiveRecord
::
Migration
class
MoveFromDevelopersCanPushToProtectedBranchesPushAccess
<
ActiveRecord
::
Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
HEREDOC
DOWNTIME_REASON
=
<<-
HEREDOC
.
freeze
We're creating a `push_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
We're creating a `push_access_level` for each `protected_branch`. If a user creates a `protected_branch` while this
is running, we might be left with a `protected_branch` _without_ an associated `push_access_level`. The `protected_branches`
is running, we might be left with a `protected_branch` _without_ an associated `push_access_level`. The `protected_branches`
table must not change while this is running, so downtime is required.
table must not change while this is running, so downtime is required.
...
...
db/migrate/20160729173930_remove_project_id_from_spam_logs.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ class RemoveProjectIdFromSpamLogs < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class RemoveProjectIdFromSpamLogs < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Removing a column that contains data that is not used anywhere.'
DOWNTIME_REASON
=
'Removing a column that contains data that is not used anywhere.'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20160823081327_change_merge_error_to_text.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class ChangeMergeErrorToText < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class ChangeMergeErrorToText < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration requires downtime because it alters a column from varchar(255) to text.'
DOWNTIME_REASON
=
'This migration requires downtime because it alters a column from varchar(255) to text.'
.
freeze
def
change
def
change
change_column
:merge_requests
,
:merge_error
,
:text
,
limit:
65535
change_column
:merge_requests
,
:merge_error
,
:text
,
limit:
65535
...
...
db/migrate/20160824124900_add_table_issue_metrics.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ class AddTableIssueMetrics < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class AddTableIssueMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Adding foreign key'
DOWNTIME_REASON
=
'Adding foreign key'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20160825052008_add_table_merge_request_metrics.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ class AddTableMergeRequestMetrics < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class AddTableMergeRequestMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Adding foreign key'
DOWNTIME_REASON
=
'Adding foreign key'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20160829114652_add_markdown_cache_columns.rb
View file @
b7d8df50
...
@@ -26,7 +26,7 @@ class AddMarkdownCacheColumns < ActiveRecord::Migration
...
@@ -26,7 +26,7 @@ class AddMarkdownCacheColumns < ActiveRecord::Migration
projects:
[
:description
],
projects:
[
:description
],
releases:
[
:description
],
releases:
[
:description
],
snippets:
[
:title
,
:content
],
snippets:
[
:title
,
:content
],
}
}
.
freeze
def
change
def
change
COLUMNS
.
each
do
|
table
,
columns
|
COLUMNS
.
each
do
|
table
,
columns
|
...
...
db/migrate/20160831214543_migrate_project_features.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ class MigrateProjectFeatures < ActiveRecord::Migration
...
@@ -3,7 +3,7 @@ class MigrateProjectFeatures < ActiveRecord::Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
DOWNTIME_REASON
=
<<-
EOT
<<-
EOT
.
freeze
Migrating issues_enabled, merge_requests_enabled, wiki_enabled, builds_enabled, snippets_enabled fields from projects to
Migrating issues_enabled, merge_requests_enabled, wiki_enabled, builds_enabled, snippets_enabled fields from projects to
a new table called project_features.
a new table called project_features.
EOT
EOT
...
...
db/migrate/20160831223750_remove_features_enabled_from_projects.rb
View file @
b7d8df50
...
@@ -7,7 +7,7 @@ class RemoveFeaturesEnabledFromProjects < ActiveRecord::Migration
...
@@ -7,7 +7,7 @@ class RemoveFeaturesEnabledFromProjects < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
"Removing fields from database requires downtine."
DOWNTIME_REASON
=
"Removing fields from database requires downtine."
.
freeze
def
up
def
up
remove_column
:projects
,
:issues_enabled
remove_column
:projects
,
:issues_enabled
...
...
db/migrate/20160913162434_remove_projects_pushes_since_gc.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class RemoveProjectsPushesSinceGc < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class RemoveProjectsPushesSinceGc < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration removes an existing column'
DOWNTIME_REASON
=
'This migration removes an existing column'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20160913212128_change_artifacts_size_column.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ class ChangeArtifactsSizeColumn < ActiveRecord::Migration
...
@@ -3,7 +3,7 @@ class ChangeArtifactsSizeColumn < ActiveRecord::Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Changing an integer column size requires a full table rewrite.'
DOWNTIME_REASON
=
'Changing an integer column size requires a full table rewrite.'
.
freeze
def
up
def
up
change_column
:ci_builds
,
:artifacts_size
,
:integer
,
limit:
8
change_column
:ci_builds
,
:artifacts_size
,
:integer
,
limit:
8
...
...
db/migrate/20160915042921_create_merge_requests_closing_issues.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class CreateMergeRequestsClosingIssues < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Adding foreign keys'
DOWNTIME_REASON
=
'Adding foreign keys'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20160919144305_add_type_to_labels.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class AddTypeToLabels < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class AddTypeToLabels < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Labels will not work as expected until this migration is complete.'
DOWNTIME_REASON
=
'Labels will not work as expected until this migration is complete.'
.
freeze
def
change
def
change
add_column
:labels
,
:type
,
:string
add_column
:labels
,
:type
,
:string
...
...
db/migrate/20161014173530_create_label_priorities.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class CreateLabelPriorities < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class CreateLabelPriorities < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration adds foreign keys'
DOWNTIME_REASON
=
'This migration adds foreign keys'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161017125927_add_unique_index_to_labels.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class AddUniqueIndexToLabels < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class AddUniqueIndexToLabels < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration removes duplicated labels.'
DOWNTIME_REASON
=
'This migration removes duplicated labels.'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161018024215_migrate_labels_priority.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class MigrateLabelsPriority < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class MigrateLabelsPriority < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Prioritized labels will not work as expected until this migration is complete.'
DOWNTIME_REASON
=
'Prioritized labels will not work as expected until this migration is complete.'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161018024550_remove_priority_from_labels.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class RemovePriorityFromLabels < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class RemovePriorityFromLabels < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration removes an existing column'
DOWNTIME_REASON
=
'This migration removes an existing column'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161019190736_migrate_sidekiq_queues_from_default.rb
View file @
b7d8df50
...
@@ -8,7 +8,7 @@ class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
...
@@ -8,7 +8,7 @@ class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
EOF
DOWNTIME_REASON
=
<<-
EOF
.
freeze
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
migration completes.
...
@@ -71,7 +71,7 @@ class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
...
@@ -71,7 +71,7 @@ class MigrateSidekiqQueuesFromDefault < ActiveRecord::Migration
'StuckCiBuildsWorker'
=>
:cronjob
,
'StuckCiBuildsWorker'
=>
:cronjob
,
'UpdateMergeRequestsWorker'
=>
:update_merge_requests
'UpdateMergeRequestsWorker'
=>
:update_merge_requests
}
}
}
}
.
freeze
def
up
def
up
Sidekiq
.
redis
do
|
redis
|
Sidekiq
.
redis
do
|
redis
|
...
...
db/migrate/20161019213545_generate_project_feature_for_projects.rb
View file @
b7d8df50
class
GenerateProjectFeatureForProjects
<
ActiveRecord
::
Migration
class
GenerateProjectFeatureForProjects
<
ActiveRecord
::
Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
HEREDOC
DOWNTIME_REASON
=
<<-
HEREDOC
.
freeze
Application was eager loading project_feature for all projects generating an extra query
Application was eager loading project_feature for all projects generating an extra query
everytime a project was fetched. We removed that behavior to avoid the extra query, this migration
everytime a project was fetched. We removed that behavior to avoid the extra query, this migration
makes sure all projects have a project_feature record associated.
makes sure all projects have a project_feature record associated.
...
...
db/migrate/20161020083353_add_pipeline_id_to_merge_request_metrics.rb
View file @
b7d8df50
...
@@ -12,7 +12,7 @@ class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration
...
@@ -12,7 +12,7 @@ class AddPipelineIdToMergeRequestMetrics < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Adding a foreign key'
DOWNTIME_REASON
=
'Adding a foreign key'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20161024042317_migrate_mailroom_queue_from_default.rb
View file @
b7d8df50
...
@@ -8,7 +8,7 @@ class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
...
@@ -8,7 +8,7 @@ class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
EOF
DOWNTIME_REASON
=
<<-
EOF
.
freeze
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Moving Sidekiq jobs from queues requires Sidekiq to be stopped. Not stopping
Sidekiq will result in the loss of jobs that are scheduled after this
Sidekiq will result in the loss of jobs that are scheduled after this
migration completes.
migration completes.
...
@@ -25,7 +25,7 @@ class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
...
@@ -25,7 +25,7 @@ class MigrateMailroomQueueFromDefault < ActiveRecord::Migration
incoming_email:
{
incoming_email:
{
'EmailReceiverWorker'
=>
:email_receiver
'EmailReceiverWorker'
=>
:email_receiver
}
}
}
}
.
freeze
def
up
def
up
Sidekiq
.
redis
do
|
redis
|
Sidekiq
.
redis
do
|
redis
|
...
...
db/migrate/20161025231710_migrate_jira_to_gem.rb
View file @
b7d8df50
class
MigrateJiraToGem
<
ActiveRecord
::
Migration
class
MigrateJiraToGem
<
ActiveRecord
::
Migration
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
<<-
HEREDOC
DOWNTIME_REASON
=
<<-
HEREDOC
.
freeze
Refactor all Jira services properties(serialized field) to use new jira-ruby gem.
Refactor all Jira services properties(serialized field) to use new jira-ruby gem.
There were properties on old Jira service that are not needed anymore after the
There were properties on old Jira service that are not needed anymore after the
service refactoring: api_url, project_url, new_issue_url, issues_url.
service refactoring: api_url, project_url, new_issue_url, issues_url.
...
...
db/migrate/20161031174110_migrate_subscriptions_project_id.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Subscriptions will not work as expected until this migration is complete.'
DOWNTIME_REASON
=
'Subscriptions will not work as expected until this migration is complete.'
.
freeze
def
up
def
up
execute
<<-
EOF
.
strip_heredoc
execute
<<-
EOF
.
strip_heredoc
...
...
db/migrate/20161031181638_add_unique_index_to_subscriptions.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class AddUniqueIndexToSubscriptions < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class AddUniqueIndexToSubscriptions < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'This migration requires downtime because it changes a column to not accept null values.'
DOWNTIME_REASON
=
'This migration requires downtime because it changes a column to not accept null values.'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161103171205_rename_repository_storage_column.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ class RenameRepositoryStorageColumn < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class RenameRepositoryStorageColumn < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
'Renaming the application_settings.repository_storage column'
DOWNTIME_REASON
=
'Renaming the application_settings.repository_storage column'
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/migrate/20161124141322_migrate_process_commit_worker_jobs.rb
View file @
b7d8df50
...
@@ -25,7 +25,7 @@ class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration
...
@@ -25,7 +25,7 @@ class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration
end
end
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Existing workers will error until they are using a newer version of the code'
DOWNTIME_REASON
=
'Existing workers will error until they are using a newer version of the code'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20161130095245_fill_routes_table.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class FillRoutesTable < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class FillRoutesTable < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'No new namespaces should be created during data copy'
DOWNTIME_REASON
=
'No new namespaces should be created during data copy'
.
freeze
def
up
def
up
execute
<<-
EOF
execute
<<-
EOF
...
...
db/migrate/20161130101252_fill_projects_routes_table.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class FillProjectsRoutesTable < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class FillProjectsRoutesTable < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'No new projects should be created during data copy'
DOWNTIME_REASON
=
'No new projects should be created during data copy'
.
freeze
def
up
def
up
if
Gitlab
::
Database
.
postgresql?
if
Gitlab
::
Database
.
postgresql?
...
...
db/migrate/20161201160452_migrate_project_statistics.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Removes two columns from the projects table'
DOWNTIME_REASON
=
'Removes two columns from the projects table'
.
freeze
def
up
def
up
# convert repository_size in float (megabytes) to integer (bytes),
# convert repository_size in float (megabytes) to integer (bytes),
...
...
db/migrate/20161207231620_fixup_environment_name_uniqueness.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class FixupEnvironmentNameUniqueness < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class FixupEnvironmentNameUniqueness < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Renaming non-unique environments'
DOWNTIME_REASON
=
'Renaming non-unique environments'
.
freeze
def
up
def
up
environments
=
Arel
::
Table
.
new
(
:environments
)
environments
=
Arel
::
Table
.
new
(
:environments
)
...
...
db/migrate/20161207231621_create_environment_name_unique_index.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ class CreateEnvironmentNameUniqueIndex < ActiveRecord::Migration
...
@@ -4,7 +4,7 @@ class CreateEnvironmentNameUniqueIndex < ActiveRecord::Migration
disable_ddl_transaction!
disable_ddl_transaction!
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Making a non-unique index into a unique index'
DOWNTIME_REASON
=
'Making a non-unique index into a unique index'
.
freeze
def
up
def
up
remove_index
:environments
,
[
:project_id
,
:name
]
remove_index
:environments
,
[
:project_id
,
:name
]
...
...
db/migrate/20161207231626_add_environment_slug.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class AddEnvironmentSlug < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class AddEnvironmentSlug < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Adding NOT NULL column environments.slug with dependent data'
DOWNTIME_REASON
=
'Adding NOT NULL column environments.slug with dependent data'
.
freeze
# Used to generate random suffixes for the slug
# Used to generate random suffixes for the slug
LETTERS
=
'a'
..
'z'
LETTERS
=
'a'
..
'z'
...
...
db/migrate/20161209153400_add_unique_index_for_environment_slug.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration
...
@@ -5,7 +5,7 @@ class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
'Adding a *unique* index to environments.slug'
DOWNTIME_REASON
=
'Adding a *unique* index to environments.slug'
.
freeze
disable_ddl_transaction!
disable_ddl_transaction!
...
...
db/migrate/20170124174637_add_foreign_keys_to_timelogs.rb
View file @
b7d8df50
...
@@ -9,7 +9,7 @@ class AddForeignKeysToTimelogs < ActiveRecord::Migration
...
@@ -9,7 +9,7 @@ class AddForeignKeysToTimelogs < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# migration requires downtime.
DOWNTIME_REASON
=
''
DOWNTIME_REASON
=
''
.
freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# you must disable the use of transactions as these methods can not run in an
...
...
db/post_migrate/20161011222551_remove_inactive_jira_service_properties.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration
...
@@ -2,7 +2,7 @@ class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
true
DOWNTIME
=
true
DOWNTIME_REASON
=
"Removes all inactive jira_service properties"
DOWNTIME_REASON
=
"Removes all inactive jira_service properties"
.
freeze
def
up
def
up
execute
(
"UPDATE services SET properties = '{}' WHERE services.type = 'JiraService' and services.active = false"
)
execute
(
"UPDATE services SET properties = '{}' WHERE services.type = 'JiraService' and services.active = false"
)
...
...
db/post_migrate/20161221153951_rename_reserved_project_names.rb
View file @
b7d8df50
...
@@ -37,7 +37,7 @@ class RenameReservedProjectNames < ActiveRecord::Migration
...
@@ -37,7 +37,7 @@ class RenameReservedProjectNames < ActiveRecord::Migration
unsubscribes
unsubscribes
update
update
users
users
wikis)
wikis)
.
freeze
def
up
def
up
queues
=
Array
.
new
(
THREAD_COUNT
)
{
Queue
.
new
}
queues
=
Array
.
new
(
THREAD_COUNT
)
{
Queue
.
new
}
...
...
lib/api/api_guard.rb
View file @
b7d8df50
...
@@ -6,7 +6,7 @@ module API
...
@@ -6,7 +6,7 @@ module API
module
APIGuard
module
APIGuard
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
PRIVATE_TOKEN_HEADER
=
"HTTP_PRIVATE_TOKEN"
PRIVATE_TOKEN_HEADER
=
"HTTP_PRIVATE_TOKEN"
.
freeze
PRIVATE_TOKEN_PARAM
=
:private_token
PRIVATE_TOKEN_PARAM
=
:private_token
included
do
|
base
|
included
do
|
base
|
...
...
lib/api/award_emoji.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ module API
...
@@ -3,7 +3,7 @@ module API
include
PaginationParams
include
PaginationParams
before
{
authenticate!
}
before
{
authenticate!
}
AWARDABLES
=
%w[issue merge_request snippet]
AWARDABLES
=
%w[issue merge_request snippet]
.
freeze
resource
:projects
do
resource
:projects
do
AWARDABLES
.
each
do
|
awardable_type
|
AWARDABLES
.
each
do
|
awardable_type
|
...
...
lib/api/helpers.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ module API
...
@@ -3,7 +3,7 @@ module API
include
Gitlab
::
Utils
include
Gitlab
::
Utils
include
Helpers
::
Pagination
include
Helpers
::
Pagination
SUDO_HEADER
=
"HTTP_SUDO"
SUDO_HEADER
=
"HTTP_SUDO"
.
freeze
SUDO_PARAM
=
:sudo
SUDO_PARAM
=
:sudo
def
declared_params
(
options
=
{})
def
declared_params
(
options
=
{})
...
...
lib/api/notes.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ module API
...
@@ -4,7 +4,7 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
NOTEABLE_TYPES
=
[
Issue
,
MergeRequest
,
Snippet
]
NOTEABLE_TYPES
=
[
Issue
,
MergeRequest
,
Snippet
]
.
freeze
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
...
...
lib/api/todos.rb
View file @
b7d8df50
...
@@ -7,7 +7,7 @@ module API
...
@@ -7,7 +7,7 @@ module API
ISSUABLE_TYPES
=
{
ISSUABLE_TYPES
=
{
'merge_requests'
=>
->
(
id
)
{
find_merge_request_with_access
(
id
)
},
'merge_requests'
=>
->
(
id
)
{
find_merge_request_with_access
(
id
)
},
'issues'
=>
->
(
id
)
{
find_project_issue
(
id
)
}
'issues'
=>
->
(
id
)
{
find_project_issue
(
id
)
}
}
}
.
freeze
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
...
...
lib/banzai/filter/autolink_filter.rb
View file @
b7d8df50
...
@@ -37,7 +37,7 @@ module Banzai
...
@@ -37,7 +37,7 @@ module Banzai
and contains(., '://')
and contains(., '://')
and not(starts-with(., 'http'))
and not(starts-with(., 'http'))
and not(starts-with(., 'ftp'))
and not(starts-with(., 'ftp'))
])
])
.
freeze
def
call
def
call
return
doc
if
context
[
:autolink
]
==
false
return
doc
if
context
[
:autolink
]
==
false
...
...
lib/bitbucket/connection.rb
View file @
b7d8df50
module
Bitbucket
module
Bitbucket
class
Connection
class
Connection
DEFAULT_API_VERSION
=
'2.0'
DEFAULT_API_VERSION
=
'2.0'
.
freeze
DEFAULT_BASE_URI
=
'https://api.bitbucket.org/'
DEFAULT_BASE_URI
=
'https://api.bitbucket.org/'
.
freeze
DEFAULT_QUERY
=
{}
DEFAULT_QUERY
=
{}
.
freeze
attr_reader
:expires_at
,
:expires_in
,
:refresh_token
,
:token
attr_reader
:expires_at
,
:expires_in
,
:refresh_token
,
:token
...
...
lib/ci/ansi2html.rb
View file @
b7d8df50
...
@@ -13,7 +13,7 @@ module Ci
...
@@ -13,7 +13,7 @@ module Ci
5
=>
'magenta'
,
5
=>
'magenta'
,
6
=>
'cyan'
,
6
=>
'cyan'
,
7
=>
'white'
,
# not that this is gray in the dark (aka default) color table
7
=>
'white'
,
# not that this is gray in the dark (aka default) color table
}
}
.
freeze
STYLE_SWITCHES
=
{
STYLE_SWITCHES
=
{
bold:
0x01
,
bold:
0x01
,
...
@@ -21,7 +21,7 @@ module Ci
...
@@ -21,7 +21,7 @@ module Ci
underline:
0x04
,
underline:
0x04
,
conceal:
0x08
,
conceal:
0x08
,
cross:
0x10
,
cross:
0x10
,
}
}
.
freeze
def
self
.
convert
(
ansi
,
state
=
nil
)
def
self
.
convert
(
ansi
,
state
=
nil
)
Converter
.
new
.
convert
(
ansi
,
state
)
Converter
.
new
.
convert
(
ansi
,
state
)
...
@@ -86,7 +86,7 @@ module Ci
...
@@ -86,7 +86,7 @@ module Ci
attr_accessor
:offset
,
:n_open_tags
,
:fg_color
,
:bg_color
,
:style_mask
attr_accessor
:offset
,
:n_open_tags
,
:fg_color
,
:bg_color
,
:style_mask
STATE_PARAMS
=
[
:offset
,
:n_open_tags
,
:fg_color
,
:bg_color
,
:style_mask
]
STATE_PARAMS
=
[
:offset
,
:n_open_tags
,
:fg_color
,
:bg_color
,
:style_mask
]
.
freeze
def
convert
(
raw
,
new_state
)
def
convert
(
raw
,
new_state
)
reset_state
reset_state
...
...
lib/ci/api/helpers.rb
View file @
b7d8df50
module
Ci
module
Ci
module
API
module
API
module
Helpers
module
Helpers
BUILD_TOKEN_HEADER
=
"HTTP_BUILD_TOKEN"
BUILD_TOKEN_HEADER
=
"HTTP_BUILD_TOKEN"
.
freeze
BUILD_TOKEN_PARAM
=
:token
BUILD_TOKEN_PARAM
=
:token
UPDATE_RUNNER_EVERY
=
10
*
60
UPDATE_RUNNER_EVERY
=
10
*
60
...
...
lib/container_registry/client.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ module ContainerRegistry
...
@@ -5,7 +5,7 @@ module ContainerRegistry
class
Client
class
Client
attr_accessor
:uri
attr_accessor
:uri
MANIFEST_VERSION
=
'application/vnd.docker.distribution.manifest.v2+json'
MANIFEST_VERSION
=
'application/vnd.docker.distribution.manifest.v2+json'
.
freeze
# Taken from: FaradayMiddleware::FollowRedirects
# Taken from: FaradayMiddleware::FollowRedirects
REDIRECT_CODES
=
Set
.
new
[
301
,
302
,
303
,
307
]
REDIRECT_CODES
=
Set
.
new
[
301
,
302
,
303
,
307
]
...
...
lib/gitlab/auth.rb
View file @
b7d8df50
...
@@ -2,8 +2,8 @@ module Gitlab
...
@@ -2,8 +2,8 @@ module Gitlab
module
Auth
module
Auth
class
MissingPersonalTokenError
<
StandardError
;
end
class
MissingPersonalTokenError
<
StandardError
;
end
SCOPES
=
[
:api
,
:read_user
]
SCOPES
=
[
:api
,
:read_user
]
.
freeze
DEFAULT_SCOPES
=
[
:api
]
DEFAULT_SCOPES
=
[
:api
]
.
freeze
OPTIONAL_SCOPES
=
SCOPES
-
DEFAULT_SCOPES
OPTIONAL_SCOPES
=
SCOPES
-
DEFAULT_SCOPES
class
<<
self
class
<<
self
...
...
lib/gitlab/badge/build/template.rb
View file @
b7d8df50
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
canceled:
'#9f9f9f'
,
canceled:
'#9f9f9f'
,
skipped:
'#9f9f9f'
,
skipped:
'#9f9f9f'
,
unknown:
'#9f9f9f'
unknown:
'#9f9f9f'
}
}
.
freeze
def
initialize
(
badge
)
def
initialize
(
badge
)
@entity
=
badge
.
entity
@entity
=
badge
.
entity
...
...
lib/gitlab/badge/coverage/template.rb
View file @
b7d8df50
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
medium:
'#dfb317'
,
medium:
'#dfb317'
,
low:
'#e05d44'
,
low:
'#e05d44'
,
unknown:
'#9f9f9f'
unknown:
'#9f9f9f'
}
}
.
freeze
def
initialize
(
badge
)
def
initialize
(
badge
)
@entity
=
badge
.
entity
@entity
=
badge
.
entity
...
...
lib/gitlab/ci/config/entry/artifacts.rb
View file @
b7d8df50
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
include
Validatable
include
Validatable
include
Attributable
include
Attributable
ALLOWED_KEYS
=
%i[name untracked paths when expire_in]
ALLOWED_KEYS
=
%i[name untracked paths when expire_in]
.
freeze
attributes
ALLOWED_KEYS
attributes
ALLOWED_KEYS
...
...
lib/gitlab/ci/config/entry/cache.rb
View file @
b7d8df50
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
class
Cache
<
Node
class
Cache
<
Node
include
Configurable
include
Configurable
ALLOWED_KEYS
=
%i[key untracked paths]
ALLOWED_KEYS
=
%i[key untracked paths]
.
freeze
validations
do
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
lib/gitlab/ci/config/entry/environment.rb
View file @
b7d8df50
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
class
Environment
<
Node
class
Environment
<
Node
include
Validatable
include
Validatable
ALLOWED_KEYS
=
%i[name url action on_stop]
ALLOWED_KEYS
=
%i[name url action on_stop]
.
freeze
validations
do
validations
do
validate
do
validate
do
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
b7d8df50
...
@@ -11,7 +11,7 @@ module Gitlab
...
@@ -11,7 +11,7 @@ module Gitlab
ALLOWED_KEYS
=
%i[tags script only except type image services allow_failure
ALLOWED_KEYS
=
%i[tags script only except type image services allow_failure
type stage when artifacts cache dependencies before_script
type stage when artifacts cache dependencies before_script
after_script variables environment coverage]
after_script variables environment coverage]
.
freeze
validations
do
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
lib/gitlab/diff/inline_diff_marker.rb
View file @
b7d8df50
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
MARKDOWN_SYMBOLS
=
{
MARKDOWN_SYMBOLS
=
{
addition:
"+"
,
addition:
"+"
,
deletion:
"-"
deletion:
"-"
}
}
.
freeze
attr_accessor
:raw_line
,
:rich_line
attr_accessor
:raw_line
,
:rich_line
...
...
lib/gitlab/downtime_check/message.rb
View file @
b7d8df50
...
@@ -3,8 +3,8 @@ module Gitlab
...
@@ -3,8 +3,8 @@ module Gitlab
class
Message
class
Message
attr_reader
:path
,
:offline
attr_reader
:path
,
:offline
OFFLINE
=
"
\e
[31moffline
\e
[0m"
OFFLINE
=
"
\e
[31moffline
\e
[0m"
.
freeze
ONLINE
=
"
\e
[32monline
\e
[0m"
ONLINE
=
"
\e
[32monline
\e
[0m"
.
freeze
# path - The file path of the migration.
# path - The file path of the migration.
# offline - When set to `true` the migration will require downtime.
# offline - When set to `true` the migration will require downtime.
...
...
lib/gitlab/email/handler.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ require 'gitlab/email/handler/unsubscribe_handler'
...
@@ -5,7 +5,7 @@ require 'gitlab/email/handler/unsubscribe_handler'
module
Gitlab
module
Gitlab
module
Email
module
Email
module
Handler
module
Handler
HANDLERS
=
[
UnsubscribeHandler
,
CreateNoteHandler
,
CreateIssueHandler
]
HANDLERS
=
[
UnsubscribeHandler
,
CreateNoteHandler
,
CreateIssueHandler
]
.
freeze
def
self
.
for
(
mail
,
mail_key
)
def
self
.
for
(
mail
,
mail_key
)
HANDLERS
.
find
do
|
klass
|
HANDLERS
.
find
do
|
klass
|
...
...
lib/gitlab/exclusive_lease.rb
View file @
b7d8df50
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
# ExclusiveLease.
# ExclusiveLease.
#
#
class
ExclusiveLease
class
ExclusiveLease
LUA_CANCEL_SCRIPT
=
<<-
EOS
LUA_CANCEL_SCRIPT
=
<<-
EOS
.
freeze
local key, uuid = KEYS[1], ARGV[1]
local key, uuid = KEYS[1], ARGV[1]
if redis.call("get", key) == uuid then
if redis.call("get", key) == uuid then
redis.call("del", key)
redis.call("del", key)
...
...
lib/gitlab/file_detector.rb
View file @
b7d8df50
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,7 @@ module Gitlab
koding:
'.koding.yml'
,
koding:
'.koding.yml'
,
gitlab_ci:
'.gitlab-ci.yml'
,
gitlab_ci:
'.gitlab-ci.yml'
,
avatar:
/\Alogo\.(png|jpg|gif)\z/
avatar:
/\Alogo\.(png|jpg|gif)\z/
}
}
.
freeze
# Returns an Array of file types based on the given paths.
# Returns an Array of file types based on the given paths.
#
#
...
...
lib/gitlab/git_access.rb
View file @
b7d8df50
...
@@ -10,10 +10,10 @@ module Gitlab
...
@@ -10,10 +10,10 @@ module Gitlab
deploy_key_upload:
deploy_key_upload:
'This deploy key does not have write access to this project.'
,
'This deploy key does not have write access to this project.'
,
no_repo:
'A repository for this project does not exist yet.'
no_repo:
'A repository for this project does not exist yet.'
}
}
.
freeze
DOWNLOAD_COMMANDS
=
%w{ git-upload-pack git-upload-archive }
DOWNLOAD_COMMANDS
=
%w{ git-upload-pack git-upload-archive }
.
freeze
PUSH_COMMANDS
=
%w{ git-receive-pack }
PUSH_COMMANDS
=
%w{ git-receive-pack }
.
freeze
ALL_COMMANDS
=
DOWNLOAD_COMMANDS
+
PUSH_COMMANDS
ALL_COMMANDS
=
DOWNLOAD_COMMANDS
+
PUSH_COMMANDS
attr_reader
:actor
,
:project
,
:protocol
,
:user_access
,
:authentication_abilities
attr_reader
:actor
,
:project
,
:protocol
,
:user_access
,
:authentication_abilities
...
...
lib/gitlab/import_export.rb
View file @
b7d8df50
...
@@ -3,7 +3,7 @@ module Gitlab
...
@@ -3,7 +3,7 @@ module Gitlab
extend
self
extend
self
# For every version update, the version history in import_export.md has to be kept up to date.
# For every version update, the version history in import_export.md has to be kept up to date.
VERSION
=
'0.1.6'
VERSION
=
'0.1.6'
.
freeze
FILENAME_LIMIT
=
50
FILENAME_LIMIT
=
50
def
export_path
(
relative_path
:)
def
export_path
(
relative_path
:)
...
...
lib/gitlab/metrics/rack_middleware.rb
View file @
b7d8df50
...
@@ -2,8 +2,8 @@ module Gitlab
...
@@ -2,8 +2,8 @@ module Gitlab
module
Metrics
module
Metrics
# Rack middleware for tracking Rails and Grape requests.
# Rack middleware for tracking Rails and Grape requests.
class
RackMiddleware
class
RackMiddleware
CONTROLLER_KEY
=
'action_controller.instance'
CONTROLLER_KEY
=
'action_controller.instance'
.
freeze
ENDPOINT_KEY
=
'api.endpoint'
ENDPOINT_KEY
=
'api.endpoint'
.
freeze
CONTENT_TYPES
=
{
CONTENT_TYPES
=
{
'text/html'
=>
:html
,
'text/html'
=>
:html
,
'text/plain'
=>
:txt
,
'text/plain'
=>
:txt
,
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,7 @@ module Gitlab
'image/jpeg'
=>
:jpeg
,
'image/jpeg'
=>
:jpeg
,
'image/gif'
=>
:gif
,
'image/gif'
=>
:gif
,
'image/svg+xml'
=>
:svg
'image/svg+xml'
=>
:svg
}
}
.
freeze
def
initialize
(
app
)
def
initialize
(
app
)
@app
=
app
@app
=
app
...
...
lib/gitlab/metrics/subscribers/action_view.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
class
ActionView
<
ActiveSupport
::
Subscriber
class
ActionView
<
ActiveSupport
::
Subscriber
attach_to
:action_view
attach_to
:action_view
SERIES
=
'views'
SERIES
=
'views'
.
freeze
def
render_template
(
event
)
def
render_template
(
event
)
track
(
event
)
if
current_transaction
track
(
event
)
if
current_transaction
...
...
lib/gitlab/metrics/transaction.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
THREAD_KEY
=
:_gitlab_metrics_transaction
THREAD_KEY
=
:_gitlab_metrics_transaction
# The series to store events (e.g. Git pushes) in.
# The series to store events (e.g. Git pushes) in.
EVENT_SERIES
=
'events'
EVENT_SERIES
=
'events'
.
freeze
attr_reader
:tags
,
:values
,
:method
,
:metrics
attr_reader
:tags
,
:values
,
:method
,
:metrics
...
...
lib/gitlab/middleware/multipart.rb
View file @
b7d8df50
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
module
Gitlab
module
Gitlab
module
Middleware
module
Middleware
class
Multipart
class
Multipart
RACK_ENV_KEY
=
'HTTP_GITLAB_WORKHORSE_MULTIPART_FIELDS'
RACK_ENV_KEY
=
'HTTP_GITLAB_WORKHORSE_MULTIPART_FIELDS'
.
freeze
class
Handler
class
Handler
def
initialize
(
env
,
message
)
def
initialize
(
env
,
message
)
...
...
lib/gitlab/redis.rb
View file @
b7d8df50
...
@@ -4,11 +4,11 @@ require 'active_support/core_ext/hash/keys'
...
@@ -4,11 +4,11 @@ require 'active_support/core_ext/hash/keys'
module
Gitlab
module
Gitlab
class
Redis
class
Redis
CACHE_NAMESPACE
=
'cache:gitlab'
CACHE_NAMESPACE
=
'cache:gitlab'
.
freeze
SESSION_NAMESPACE
=
'session:gitlab'
SESSION_NAMESPACE
=
'session:gitlab'
.
freeze
SIDEKIQ_NAMESPACE
=
'resque:gitlab'
SIDEKIQ_NAMESPACE
=
'resque:gitlab'
.
freeze
MAILROOM_NAMESPACE
=
'mail_room:gitlab'
MAILROOM_NAMESPACE
=
'mail_room:gitlab'
.
freeze
DEFAULT_REDIS_URL
=
'redis://localhost:6379'
DEFAULT_REDIS_URL
=
'redis://localhost:6379'
.
freeze
CONFIG_FILE
=
File
.
expand_path
(
'../../config/resque.yml'
,
__dir__
)
CONFIG_FILE
=
File
.
expand_path
(
'../../config/resque.yml'
,
__dir__
)
class
<<
self
class
<<
self
...
...
lib/gitlab/reference_extractor.rb
View file @
b7d8df50
module
Gitlab
module
Gitlab
# Extract possible GFM references from an arbitrary String for further processing.
# Extract possible GFM references from an arbitrary String for further processing.
class
ReferenceExtractor
<
Banzai
::
ReferenceExtractor
class
ReferenceExtractor
<
Banzai
::
ReferenceExtractor
REFERABLES
=
%i(user issue label milestone merge_request snippet commit commit_range directly_addressed_user)
REFERABLES
=
%i(user issue label milestone merge_request snippet commit commit_range directly_addressed_user)
.
freeze
attr_accessor
:project
,
:current_user
,
:author
attr_accessor
:project
,
:current_user
,
:author
def
initialize
(
project
,
current_user
=
nil
)
def
initialize
(
project
,
current_user
=
nil
)
...
...
lib/gitlab/request_profiler.rb
View file @
b7d8df50
...
@@ -2,7 +2,7 @@ require 'fileutils'
...
@@ -2,7 +2,7 @@ require 'fileutils'
module
Gitlab
module
Gitlab
module
RequestProfiler
module
RequestProfiler
PROFILES_DIR
=
"
#{
Gitlab
.
config
.
shared
.
path
}
/tmp/requests_profiles"
PROFILES_DIR
=
"
#{
Gitlab
.
config
.
shared
.
path
}
/tmp/requests_profiles"
.
freeze
def
profile_token
def
profile_token
Rails
.
cache
.
fetch
(
'profile-token'
)
do
Rails
.
cache
.
fetch
(
'profile-token'
)
do
...
...
lib/gitlab/workhorse.rb
View file @
b7d8df50
...
@@ -4,10 +4,10 @@ require 'securerandom'
...
@@ -4,10 +4,10 @@ require 'securerandom'
module
Gitlab
module
Gitlab
class
Workhorse
class
Workhorse
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
.
freeze
VERSION_FILE
=
'GITLAB_WORKHORSE_VERSION'
VERSION_FILE
=
'GITLAB_WORKHORSE_VERSION'
.
freeze
INTERNAL_API_CONTENT_TYPE
=
'application/vnd.gitlab-workhorse+json'
INTERNAL_API_CONTENT_TYPE
=
'application/vnd.gitlab-workhorse+json'
.
freeze
INTERNAL_API_REQUEST_HEADER
=
'Gitlab-Workhorse-Api-Request'
INTERNAL_API_REQUEST_HEADER
=
'Gitlab-Workhorse-Api-Request'
.
freeze
# Supposedly the effective key size for HMAC-SHA256 is 256 bits, i.e. 32
# Supposedly the effective key size for HMAC-SHA256 is 256 bits, i.e. 32
# bytes https://tools.ietf.org/html/rfc4868#section-2.6
# bytes https://tools.ietf.org/html/rfc4868#section-2.6
...
...
rubocop/cop/gem_fetcher.rb
View file @
b7d8df50
...
@@ -4,9 +4,9 @@ module RuboCop
...
@@ -4,9 +4,9 @@ module RuboCop
# `Gemfile` in order to avoid additional points of failure beyond
# `Gemfile` in order to avoid additional points of failure beyond
# rubygems.org.
# rubygems.org.
class
GemFetcher
<
RuboCop
::
Cop
::
Cop
class
GemFetcher
<
RuboCop
::
Cop
::
Cop
MSG
=
'Do not use gems from git repositories, only use gems from RubyGems.'
MSG
=
'Do not use gems from git repositories, only use gems from RubyGems.'
.
freeze
GIT_KEYS
=
[
:git
,
:github
]
GIT_KEYS
=
[
:git
,
:github
]
.
freeze
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
gemfile?
(
node
)
return
unless
gemfile?
(
node
)
...
...
rubocop/cop/migration/add_column.rb
View file @
b7d8df50
...
@@ -8,10 +8,10 @@ module RuboCop
...
@@ -8,10 +8,10 @@ module RuboCop
class
AddColumn
<
RuboCop
::
Cop
::
Cop
class
AddColumn
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
WHITELISTED_TABLES
=
[
:application_settings
]
WHITELISTED_TABLES
=
[
:application_settings
]
.
freeze
MSG
=
'`add_column` with a default value requires downtime, '
\
MSG
=
'`add_column` with a default value requires downtime, '
\
'use `add_column_with_default` instead'
'use `add_column_with_default` instead'
.
freeze
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_column_with_default.rb
View file @
b7d8df50
...
@@ -9,7 +9,7 @@ module RuboCop
...
@@ -9,7 +9,7 @@ module RuboCop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_column_with_default` is not reversible so you must manually define '
\
MSG
=
'`add_column_with_default` is not reversible so you must manually define '
\
'the `up` and `down` methods in your migration class, using `remove_column` in `down`'
'the `up` and `down` methods in your migration class, using `remove_column` in `down`'
.
freeze
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_concurrent_foreign_key.rb
View file @
b7d8df50
...
@@ -8,7 +8,7 @@ module RuboCop
...
@@ -8,7 +8,7 @@ module RuboCop
class
AddConcurrentForeignKey
<
RuboCop
::
Cop
::
Cop
class
AddConcurrentForeignKey
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_foreign_key` requires downtime, use `add_concurrent_foreign_key` instead'
MSG
=
'`add_foreign_key` requires downtime, use `add_concurrent_foreign_key` instead'
.
freeze
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_index.rb
View file @
b7d8df50
...
@@ -7,7 +7,7 @@ module RuboCop
...
@@ -7,7 +7,7 @@ module RuboCop
class
AddIndex
<
RuboCop
::
Cop
::
Cop
class
AddIndex
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_index` requires downtime, use `add_concurrent_index` instead'
MSG
=
'`add_index` requires downtime, use `add_concurrent_index` instead'
.
freeze
def
on_def
(
node
)
def
on_def
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
spec/features/merge_requests/conflicts_spec.rb
View file @
b7d8df50
...
@@ -154,7 +154,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
...
@@ -154,7 +154,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
'conflict-binary-file'
=>
'when the conflicts contain a binary file'
,
'conflict-binary-file'
=>
'when the conflicts contain a binary file'
,
'conflict-missing-side'
=>
'when the conflicts contain a file edited in one branch and deleted in another'
,
'conflict-missing-side'
=>
'when the conflicts contain a file edited in one branch and deleted in another'
,
'conflict-non-utf8'
=>
'when the conflicts contain a non-UTF-8 file'
,
'conflict-non-utf8'
=>
'when the conflicts contain a non-UTF-8 file'
,
}
}
.
freeze
UNRESOLVABLE_CONFLICTS
.
each
do
|
source_branch
,
description
|
UNRESOLVABLE_CONFLICTS
.
each
do
|
source_branch
,
description
|
context
description
do
context
description
do
...
...
spec/models/environment_spec.rb
View file @
b7d8df50
...
@@ -311,7 +311,7 @@ describe Environment, models: true do
...
@@ -311,7 +311,7 @@ describe Environment, models: true do
end
end
describe
'#generate_slug'
do
describe
'#generate_slug'
do
SUFFIX
=
"-[a-z0-9]{6}"
SUFFIX
=
"-[a-z0-9]{6}"
.
freeze
{
{
"staging-12345678901234567"
=>
"staging-123456789"
+
SUFFIX
,
"staging-12345678901234567"
=>
"staging-123456789"
+
SUFFIX
,
"9-staging-123456789012345"
=>
"env-9-staging-123"
+
SUFFIX
,
"9-staging-123456789012345"
=>
"env-9-staging-123"
+
SUFFIX
,
...
...
spec/support/javascript_fixtures_helpers.rb
View file @
b7d8df50
...
@@ -5,7 +5,7 @@ require 'gitlab/popen'
...
@@ -5,7 +5,7 @@ require 'gitlab/popen'
module
JavaScriptFixturesHelpers
module
JavaScriptFixturesHelpers
include
Gitlab
::
Popen
include
Gitlab
::
Popen
FIXTURE_PATH
=
'spec/javascripts/fixtures'
FIXTURE_PATH
=
'spec/javascripts/fixtures'
.
freeze
# Public: Removes all fixture files from given directory
# Public: Removes all fixture files from given directory
#
#
...
...
spec/support/jira_service_helper.rb
View file @
b7d8df50
module
JiraServiceHelper
module
JiraServiceHelper
JIRA_URL
=
"http://jira.example.net"
JIRA_URL
=
"http://jira.example.net"
.
freeze
JIRA_API
=
JIRA_URL
+
"/rest/api/2"
JIRA_API
=
JIRA_URL
+
"/rest/api/2"
def
jira_service_settings
def
jira_service_settings
...
...
spec/support/seed_helper.rb
View file @
b7d8df50
...
@@ -7,7 +7,7 @@ TEST_MUTABLE_REPO_PATH = File.join(SEED_REPOSITORY_PATH, "mutable-repo.git")
...
@@ -7,7 +7,7 @@ TEST_MUTABLE_REPO_PATH = File.join(SEED_REPOSITORY_PATH, "mutable-repo.git")
TEST_BROKEN_REPO_PATH
=
File
.
join
(
SEED_REPOSITORY_PATH
,
"broken-repo.git"
)
TEST_BROKEN_REPO_PATH
=
File
.
join
(
SEED_REPOSITORY_PATH
,
"broken-repo.git"
)
module
SeedHelper
module
SeedHelper
GITLAB_URL
=
"https://gitlab.com/gitlab-org/gitlab-git-test.git"
GITLAB_URL
=
"https://gitlab.com/gitlab-org/gitlab-git-test.git"
.
freeze
def
ensure_seeds
def
ensure_seeds
if
File
.
exist?
(
SEED_REPOSITORY_PATH
)
if
File
.
exist?
(
SEED_REPOSITORY_PATH
)
...
...
spec/support/seed_repo.rb
View file @
b7d8df50
...
@@ -25,64 +25,64 @@
...
@@ -25,64 +25,64 @@
module
SeedRepo
module
SeedRepo
module
BigCommit
module
BigCommit
ID
=
"913c66a37b4a45b9769037c55c2d238bd0942d2e"
ID
=
"913c66a37b4a45b9769037c55c2d238bd0942d2e"
.
freeze
PARENT_ID
=
"cfe32cf61b73a0d5e9f13e774abde7ff789b1660"
PARENT_ID
=
"cfe32cf61b73a0d5e9f13e774abde7ff789b1660"
.
freeze
MESSAGE
=
"Files, encoding and much more"
MESSAGE
=
"Files, encoding and much more"
.
freeze
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
.
freeze
FILES_COUNT
=
2
FILES_COUNT
=
2
end
end
module
Commit
module
Commit
ID
=
"570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
ID
=
"570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
.
freeze
PARENT_ID
=
"6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9"
PARENT_ID
=
"6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9"
.
freeze
MESSAGE
=
"Change some files
\n\n
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
\n
"
MESSAGE
=
"Change some files
\n\n
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
\n
"
.
freeze
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
.
freeze
FILES
=
[
"files/ruby/popen.rb"
,
"files/ruby/regex.rb"
]
FILES
=
[
"files/ruby/popen.rb"
,
"files/ruby/regex.rb"
]
.
freeze
FILES_COUNT
=
2
FILES_COUNT
=
2
C_FILE_PATH
=
"files/ruby"
C_FILE_PATH
=
"files/ruby"
.
freeze
C_FILES
=
[
"popen.rb"
,
"regex.rb"
,
"version_info.rb"
]
C_FILES
=
[
"popen.rb"
,
"regex.rb"
,
"version_info.rb"
]
.
freeze
BLOB_FILE
=
%{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n}
BLOB_FILE
=
%{%h3= @key.title\n%hr\n%pre= @key.key\n.actions\n = link_to 'Remove', @key, :confirm => 'Are you sure?', :method => :delete, :class => \"btn danger delete-key\"\n\n\n}
.
freeze
BLOB_FILE_PATH
=
"app/views/keys/show.html.haml"
BLOB_FILE_PATH
=
"app/views/keys/show.html.haml"
.
freeze
end
end
module
EmptyCommit
module
EmptyCommit
ID
=
"b0e52af38d7ea43cf41d8a6f2471351ac036d6c9"
ID
=
"b0e52af38d7ea43cf41d8a6f2471351ac036d6c9"
.
freeze
PARENT_ID
=
"40f4a7a617393735a95a0bb67b08385bc1e7c66d"
PARENT_ID
=
"40f4a7a617393735a95a0bb67b08385bc1e7c66d"
.
freeze
MESSAGE
=
"Empty commit"
MESSAGE
=
"Empty commit"
.
freeze
AUTHOR_FULL_NAME
=
"Rémy Coutable"
AUTHOR_FULL_NAME
=
"Rémy Coutable"
.
freeze
FILES
=
[]
FILES
=
[]
.
freeze
FILES_COUNT
=
FILES
.
count
FILES_COUNT
=
FILES
.
count
end
end
module
EncodingCommit
module
EncodingCommit
ID
=
"40f4a7a617393735a95a0bb67b08385bc1e7c66d"
ID
=
"40f4a7a617393735a95a0bb67b08385bc1e7c66d"
.
freeze
PARENT_ID
=
"66028349a123e695b589e09a36634d976edcc5e8"
PARENT_ID
=
"66028349a123e695b589e09a36634d976edcc5e8"
.
freeze
MESSAGE
=
"Add ISO-8859-encoded file"
MESSAGE
=
"Add ISO-8859-encoded file"
.
freeze
AUTHOR_FULL_NAME
=
"Stan Hu"
AUTHOR_FULL_NAME
=
"Stan Hu"
.
freeze
FILES
=
[
"encoding/iso8859.txt"
]
FILES
=
[
"encoding/iso8859.txt"
]
.
freeze
FILES_COUNT
=
FILES
.
count
FILES_COUNT
=
FILES
.
count
end
end
module
FirstCommit
module
FirstCommit
ID
=
"1a0b36b3cdad1d2ee32457c102a8c0b7056fa863"
ID
=
"1a0b36b3cdad1d2ee32457c102a8c0b7056fa863"
.
freeze
PARENT_ID
=
nil
PARENT_ID
=
nil
MESSAGE
=
"Initial commit"
MESSAGE
=
"Initial commit"
.
freeze
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
AUTHOR_FULL_NAME
=
"Dmitriy Zaporozhets"
.
freeze
FILES
=
[
"LICENSE"
,
".gitignore"
,
"README.md"
]
FILES
=
[
"LICENSE"
,
".gitignore"
,
"README.md"
]
.
freeze
FILES_COUNT
=
3
FILES_COUNT
=
3
end
end
module
LastCommit
module
LastCommit
ID
=
"4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6"
ID
=
"4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6"
.
freeze
PARENT_ID
=
"0e1b353b348f8477bdbec1ef47087171c5032cd9"
PARENT_ID
=
"0e1b353b348f8477bdbec1ef47087171c5032cd9"
.
freeze
MESSAGE
=
"Merge branch 'master' into 'master'"
MESSAGE
=
"Merge branch 'master' into 'master'"
.
freeze
AUTHOR_FULL_NAME
=
"Stan Hu"
AUTHOR_FULL_NAME
=
"Stan Hu"
.
freeze
FILES
=
[
"bin/executable"
]
FILES
=
[
"bin/executable"
]
.
freeze
FILES_COUNT
=
FILES
.
count
FILES_COUNT
=
FILES
.
count
end
end
module
Repo
module
Repo
HEAD
=
"master"
HEAD
=
"master"
.
freeze
BRANCHES
=
%w[
BRANCHES
=
%w[
feature
feature
fix
fix
...
@@ -93,14 +93,14 @@ module SeedRepo
...
@@ -93,14 +93,14 @@ module SeedRepo
gitattributes-updated
gitattributes-updated
master
master
merge-test
merge-test
]
]
.
freeze
TAGS
=
%w[v1.0.0 v1.1.0 v1.2.0 v1.2.1]
TAGS
=
%w[v1.0.0 v1.1.0 v1.2.0 v1.2.1]
.
freeze
end
end
module
RubyBlob
module
RubyBlob
ID
=
"7e3e39ebb9b2bf433b4ad17313770fbe4051649c"
ID
=
"7e3e39ebb9b2bf433b4ad17313770fbe4051649c"
.
freeze
NAME
=
"popen.rb"
NAME
=
"popen.rb"
.
freeze
CONTENT
=
<<-
eos
CONTENT
=
<<-
eos
.
freeze
require 'fileutils'
require 'fileutils'
require 'open3'
require 'open3'
...
...
spec/support/test_env.rb
View file @
b7d8df50
...
@@ -38,7 +38,7 @@ module TestEnv
...
@@ -38,7 +38,7 @@ module TestEnv
'deleted-image-test'
=>
'6c17798'
,
'deleted-image-test'
=>
'6c17798'
,
'wip'
=>
'b9238ee'
,
'wip'
=>
'b9238ee'
,
'csv'
=>
'3dd0896'
'csv'
=>
'3dd0896'
}
}
.
freeze
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
# need to keep all the branches in sync.
# need to keep all the branches in sync.
...
@@ -48,7 +48,7 @@ module TestEnv
...
@@ -48,7 +48,7 @@ module TestEnv
'master'
=>
'5937ac0'
,
'master'
=>
'5937ac0'
,
'remove-submodule'
=>
'2a33e0c'
,
'remove-submodule'
=>
'2a33e0c'
,
'conflict-resolvable-fork'
=>
'404fa3f'
'conflict-resolvable-fork'
=>
'404fa3f'
}
}
.
freeze
# Test environment
# Test environment
#
#
...
...
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