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
e908e117
Commit
e908e117
authored
Sep 01, 2019
by
dineshpanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling freeze on already frozen strings in lib/gitlab
parent
df6f1dd9
Changes
61
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
119 additions
and
117 deletions
+119
-117
lib/gitlab/auth/unique_ips_limiter.rb
lib/gitlab/auth/unique_ips_limiter.rb
+1
-1
lib/gitlab/auth/user_auth_finders.rb
lib/gitlab/auth/user_auth_finders.rb
+1
-1
lib/gitlab/background_migration/merge_request_assignees_migration_progress_check.rb
...ation/merge_request_assignees_migration_progress_check.rb
+1
-1
lib/gitlab/background_migration/prepare_untracked_uploads.rb
lib/gitlab/background_migration/prepare_untracked_uploads.rb
+4
-4
lib/gitlab/bitbucket_server_import/importer.rb
lib/gitlab/bitbucket_server_import/importer.rb
+1
-1
lib/gitlab/checks/lfs_check.rb
lib/gitlab/checks/lfs_check.rb
+2
-2
lib/gitlab/checks/project_created.rb
lib/gitlab/checks/project_created.rb
+1
-1
lib/gitlab/checks/project_moved.rb
lib/gitlab/checks/project_moved.rb
+1
-1
lib/gitlab/ci/build/port.rb
lib/gitlab/ci/build/port.rb
+2
-2
lib/gitlab/ci/build/step.rb
lib/gitlab/ci/build/step.rb
+3
-3
lib/gitlab/ci/config/entry/cache.rb
lib/gitlab/ci/config/entry/cache.rb
+1
-1
lib/gitlab/ci/config/external/file/template.rb
lib/gitlab/ci/config/external/file/template.rb
+1
-1
lib/gitlab/ci/cron_parser.rb
lib/gitlab/ci/cron_parser.rb
+2
-2
lib/gitlab/ci/reports/test_case.rb
lib/gitlab/ci/reports/test_case.rb
+4
-4
lib/gitlab/cleanup/project_upload_file_finder.rb
lib/gitlab/cleanup/project_upload_file_finder.rb
+3
-3
lib/gitlab/database/sha_attribute.rb
lib/gitlab/database/sha_attribute.rb
+1
-1
lib/gitlab/downtime_check/message.rb
lib/gitlab/downtime_check/message.rb
+2
-2
lib/gitlab/ee_compat_check.rb
lib/gitlab/ee_compat_check.rb
+3
-2
lib/gitlab/etag_caching/store.rb
lib/gitlab/etag_caching/store.rb
+1
-1
lib/gitlab/git.rb
lib/gitlab/git.rb
+3
-3
lib/gitlab/git/lfs_pointer_file.rb
lib/gitlab/git/lfs_pointer_file.rb
+2
-2
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+2
-2
lib/gitlab/git/util.rb
lib/gitlab/git/util.rb
+1
-1
lib/gitlab/github_import/issuable_finder.rb
lib/gitlab/github_import/issuable_finder.rb
+1
-1
lib/gitlab/github_import/label_finder.rb
lib/gitlab/github_import/label_finder.rb
+1
-1
lib/gitlab/github_import/milestone_finder.rb
lib/gitlab/github_import/milestone_finder.rb
+1
-1
lib/gitlab/github_import/page_counter.rb
lib/gitlab/github_import/page_counter.rb
+1
-1
lib/gitlab/github_import/parallel_scheduling.rb
lib/gitlab/github_import/parallel_scheduling.rb
+1
-1
lib/gitlab/github_import/user_finder.rb
lib/gitlab/github_import/user_finder.rb
+3
-3
lib/gitlab/health_checks/gitaly_check.rb
lib/gitlab/health_checks/gitaly_check.rb
+1
-1
lib/gitlab/import_export.rb
lib/gitlab/import_export.rb
+1
-1
lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb
...ort/after_export_strategies/base_after_export_strategy.rb
+1
-1
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
...ort_export/after_export_strategies/web_upload_strategy.rb
+3
-3
lib/gitlab/incoming_email.rb
lib/gitlab/incoming_email.rb
+3
-3
lib/gitlab/job_waiter.rb
lib/gitlab/job_waiter.rb
+1
-1
lib/gitlab/kubernetes/helm.rb
lib/gitlab/kubernetes/helm.rb
+6
-6
lib/gitlab/kubernetes/pod.rb
lib/gitlab/kubernetes/pod.rb
+5
-5
lib/gitlab/logger.rb
lib/gitlab/logger.rb
+1
-1
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/metrics/web_transaction.rb
lib/gitlab/metrics/web_transaction.rb
+2
-2
lib/gitlab/middleware/multipart.rb
lib/gitlab/middleware/multipart.rb
+1
-1
lib/gitlab/middleware/read_only/controller.rb
lib/gitlab/middleware/read_only/controller.rb
+2
-2
lib/gitlab/path_regex.rb
lib/gitlab/path_regex.rb
+3
-3
lib/gitlab/performance_bar.rb
lib/gitlab/performance_bar.rb
+1
-1
lib/gitlab/polling_interval.rb
lib/gitlab/polling_interval.rb
+1
-1
lib/gitlab/private_commit_email.rb
lib/gitlab/private_commit_email.rb
+1
-1
lib/gitlab/profiler.rb
lib/gitlab/profiler.rb
+1
-1
lib/gitlab/prometheus/additional_metrics_parser.rb
lib/gitlab/prometheus/additional_metrics_parser.rb
+1
-1
lib/gitlab/query_limiting/middleware.rb
lib/gitlab/query_limiting/middleware.rb
+2
-2
lib/gitlab/quick_actions/issuable_actions.rb
lib/gitlab/quick_actions/issuable_actions.rb
+3
-2
lib/gitlab/redis/cache.rb
lib/gitlab/redis/cache.rb
+3
-3
lib/gitlab/redis/queues.rb
lib/gitlab/redis/queues.rb
+4
-4
lib/gitlab/redis/shared_state.rb
lib/gitlab/redis/shared_state.rb
+6
-6
lib/gitlab/redis/wrapper.rb
lib/gitlab/redis/wrapper.rb
+2
-2
lib/gitlab/request_profiler.rb
lib/gitlab/request_profiler.rb
+1
-1
lib/gitlab/shard_health_cache.rb
lib/gitlab/shard_health_cache.rb
+1
-1
lib/gitlab/sidekiq_monitor.rb
lib/gitlab/sidekiq_monitor.rb
+1
-1
lib/gitlab/sidekiq_status.rb
lib/gitlab/sidekiq_status.rb
+1
-1
lib/gitlab/url_helpers.rb
lib/gitlab/url_helpers.rb
+1
-1
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+6
-6
No files found.
lib/gitlab/auth/unique_ips_limiter.rb
View file @
e908e117
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
Auth
module
Auth
class
UniqueIpsLimiter
class
UniqueIpsLimiter
USER_UNIQUE_IPS_PREFIX
=
'user_unique_ips'
.
freeze
USER_UNIQUE_IPS_PREFIX
=
'user_unique_ips'
class
<<
self
class
<<
self
def
limit_user_id!
(
user_id
)
def
limit_user_id!
(
user_id
)
...
...
lib/gitlab/auth/user_auth_finders.rb
View file @
e908e117
...
@@ -20,7 +20,7 @@ module Gitlab
...
@@ -20,7 +20,7 @@ module Gitlab
module
UserAuthFinders
module
UserAuthFinders
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
PRIVATE_TOKEN_HEADER
=
'HTTP_PRIVATE_TOKEN'
.
freeze
PRIVATE_TOKEN_HEADER
=
'HTTP_PRIVATE_TOKEN'
PRIVATE_TOKEN_PARAM
=
:private_token
PRIVATE_TOKEN_PARAM
=
:private_token
# Check the Rails session for valid authentication details
# Check the Rails session for valid authentication details
...
...
lib/gitlab/background_migration/merge_request_assignees_migration_progress_check.rb
View file @
e908e117
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
RESCHEDULE_DELAY
=
3
.
hours
RESCHEDULE_DELAY
=
3
.
hours
WORKER
=
'PopulateMergeRequestAssigneesTable'
.
freeze
WORKER
=
'PopulateMergeRequestAssigneesTable'
DeadJobsError
=
Class
.
new
(
StandardError
)
DeadJobsError
=
Class
.
new
(
StandardError
)
def
perform
def
perform
...
...
lib/gitlab/background_migration/prepare_untracked_uploads.rb
View file @
e908e117
...
@@ -10,15 +10,15 @@ module Gitlab
...
@@ -10,15 +10,15 @@ module Gitlab
include
::
Gitlab
::
Utils
::
StrongMemoize
include
::
Gitlab
::
Utils
::
StrongMemoize
FIND_BATCH_SIZE
=
500
FIND_BATCH_SIZE
=
500
RELATIVE_UPLOAD_DIR
=
"uploads"
.
freeze
RELATIVE_UPLOAD_DIR
=
"uploads"
ABSOLUTE_UPLOAD_DIR
=
File
.
join
(
ABSOLUTE_UPLOAD_DIR
=
File
.
join
(
Gitlab
.
config
.
uploads
.
storage_path
,
Gitlab
.
config
.
uploads
.
storage_path
,
RELATIVE_UPLOAD_DIR
RELATIVE_UPLOAD_DIR
)
)
FOLLOW_UP_MIGRATION
=
'PopulateUntrackedUploads'
.
freeze
FOLLOW_UP_MIGRATION
=
'PopulateUntrackedUploads'
START_WITH_ROOT_REGEX
=
%r{
\A
#{
Gitlab
.
config
.
uploads
.
storage_path
}
/}
.
freeze
START_WITH_ROOT_REGEX
=
%r{
\A
#{
Gitlab
.
config
.
uploads
.
storage_path
}
/}
.
freeze
EXCLUDED_HASHED_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/@hashed/*"
.
freeze
EXCLUDED_HASHED_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/@hashed/*"
EXCLUDED_TMP_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/tmp/*"
.
freeze
EXCLUDED_TMP_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/tmp/*"
# This class is used to iterate over batches of
# This class is used to iterate over batches of
# `untracked_files_for_uploads` rows.
# `untracked_files_for_uploads` rows.
...
...
lib/gitlab/bitbucket_server_import/importer.rb
View file @
e908e117
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
attr_reader
:project
,
:project_key
,
:repository_slug
,
:client
,
:errors
,
:users
attr_reader
:project
,
:project_key
,
:repository_slug
,
:client
,
:errors
,
:users
attr_accessor
:logger
attr_accessor
:logger
REMOTE_NAME
=
'bitbucket_server'
.
freeze
REMOTE_NAME
=
'bitbucket_server'
BATCH_SIZE
=
100
BATCH_SIZE
=
100
TempBranch
=
Struct
.
new
(
:name
,
:sha
)
TempBranch
=
Struct
.
new
(
:name
,
:sha
)
...
...
lib/gitlab/checks/lfs_check.rb
View file @
e908e117
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Checks
module
Checks
class
LfsCheck
<
BaseChecker
class
LfsCheck
<
BaseChecker
LOG_MESSAGE
=
"Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab..."
.
freeze
LOG_MESSAGE
=
'Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab...'
ERROR_MESSAGE
=
'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'
.
freeze
ERROR_MESSAGE
=
'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'
def
validate!
def
validate!
return
unless
Feature
.
enabled?
(
:lfs_check
,
default_enabled:
true
)
return
unless
Feature
.
enabled?
(
:lfs_check
,
default_enabled:
true
)
...
...
lib/gitlab/checks/project_created.rb
View file @
e908e117
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
Checks
module
Checks
class
ProjectCreated
<
PostPushMessage
class
ProjectCreated
<
PostPushMessage
PROJECT_CREATED
=
"project_created"
.
freeze
PROJECT_CREATED
=
"project_created"
def
message
def
message
<<~
MESSAGE
<<~
MESSAGE
...
...
lib/gitlab/checks/project_moved.rb
View file @
e908e117
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
Checks
module
Checks
class
ProjectMoved
<
PostPushMessage
class
ProjectMoved
<
PostPushMessage
REDIRECT_NAMESPACE
=
"redirect_namespace"
.
freeze
REDIRECT_NAMESPACE
=
"redirect_namespace"
def
initialize
(
project
,
user
,
protocol
,
redirected_path
)
def
initialize
(
project
,
user
,
protocol
,
redirected_path
)
@redirected_path
=
redirected_path
@redirected_path
=
redirected_path
...
...
lib/gitlab/ci/build/port.rb
View file @
e908e117
...
@@ -4,8 +4,8 @@ module Gitlab
...
@@ -4,8 +4,8 @@ module Gitlab
module
Ci
module
Ci
module
Build
module
Build
class
Port
class
Port
DEFAULT_PORT_NAME
=
'default_port'
.
freeze
DEFAULT_PORT_NAME
=
'default_port'
DEFAULT_PORT_PROTOCOL
=
'http'
.
freeze
DEFAULT_PORT_PROTOCOL
=
'http'
attr_reader
:number
,
:protocol
,
:name
attr_reader
:number
,
:protocol
,
:name
...
...
lib/gitlab/ci/build/step.rb
View file @
e908e117
...
@@ -4,9 +4,9 @@ module Gitlab
...
@@ -4,9 +4,9 @@ module Gitlab
module
Ci
module
Ci
module
Build
module
Build
class
Step
class
Step
WHEN_ON_FAILURE
=
'on_failure'
.
freeze
WHEN_ON_FAILURE
=
'on_failure'
WHEN_ON_SUCCESS
=
'on_success'
.
freeze
WHEN_ON_SUCCESS
=
'on_success'
WHEN_ALWAYS
=
'always'
.
freeze
WHEN_ALWAYS
=
'always'
attr_reader
:name
attr_reader
:name
attr_accessor
:script
,
:timeout
,
:when
,
:allow_failure
attr_accessor
:script
,
:timeout
,
:when
,
:allow_failure
...
...
lib/gitlab/ci/config/entry/cache.rb
View file @
e908e117
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
include
::
Gitlab
::
Config
::
Entry
::
Attributable
include
::
Gitlab
::
Config
::
Entry
::
Attributable
ALLOWED_KEYS
=
%i[key untracked paths policy]
.
freeze
ALLOWED_KEYS
=
%i[key untracked paths policy]
.
freeze
DEFAULT_POLICY
=
'pull-push'
.
freeze
DEFAULT_POLICY
=
'pull-push'
validations
do
validations
do
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
...
...
lib/gitlab/ci/config/external/file/template.rb
View file @
e908e117
...
@@ -8,7 +8,7 @@ module Gitlab
...
@@ -8,7 +8,7 @@ module Gitlab
class
Template
<
Base
class
Template
<
Base
attr_reader
:location
,
:project
attr_reader
:location
,
:project
SUFFIX
=
'.gitlab-ci.yml'
.
freeze
SUFFIX
=
'.gitlab-ci.yml'
def
initialize
(
params
,
context
)
def
initialize
(
params
,
context
)
@location
=
params
[
:template
]
@location
=
params
[
:template
]
...
...
lib/gitlab/ci/cron_parser.rb
View file @
e908e117
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Ci
module
Ci
class
CronParser
class
CronParser
VALID_SYNTAX_SAMPLE_TIME_ZONE
=
'UTC'
.
freeze
VALID_SYNTAX_SAMPLE_TIME_ZONE
=
'UTC'
VALID_SYNTAX_SAMPLE_CRON
=
'* * * * *'
.
freeze
VALID_SYNTAX_SAMPLE_CRON
=
'* * * * *'
def
initialize
(
cron
,
cron_timezone
=
'UTC'
)
def
initialize
(
cron
,
cron_timezone
=
'UTC'
)
@cron
=
cron
@cron
=
cron
...
...
lib/gitlab/ci/reports/test_case.rb
View file @
e908e117
...
@@ -4,10 +4,10 @@ module Gitlab
...
@@ -4,10 +4,10 @@ module Gitlab
module
Ci
module
Ci
module
Reports
module
Reports
class
TestCase
class
TestCase
STATUS_SUCCESS
=
'success'
.
freeze
STATUS_SUCCESS
=
'success'
STATUS_FAILED
=
'failed'
.
freeze
STATUS_FAILED
=
'failed'
STATUS_SKIPPED
=
'skipped'
.
freeze
STATUS_SKIPPED
=
'skipped'
STATUS_ERROR
=
'error'
.
freeze
STATUS_ERROR
=
'error'
STATUS_TYPES
=
[
STATUS_SUCCESS
,
STATUS_FAILED
,
STATUS_SKIPPED
,
STATUS_ERROR
].
freeze
STATUS_TYPES
=
[
STATUS_SUCCESS
,
STATUS_FAILED
,
STATUS_SKIPPED
,
STATUS_ERROR
].
freeze
attr_reader
:name
,
:classname
,
:execution_time
,
:status
,
:file
,
:system_output
,
:stack_trace
,
:key
attr_reader
:name
,
:classname
,
:execution_time
,
:status
,
:file
,
:system_output
,
:stack_trace
,
:key
...
...
lib/gitlab/cleanup/project_upload_file_finder.rb
View file @
e908e117
...
@@ -5,9 +5,9 @@ module Gitlab
...
@@ -5,9 +5,9 @@ module Gitlab
class
ProjectUploadFileFinder
class
ProjectUploadFileFinder
FIND_BATCH_SIZE
=
500
FIND_BATCH_SIZE
=
500
ABSOLUTE_UPLOAD_DIR
=
FileUploader
.
root
.
freeze
ABSOLUTE_UPLOAD_DIR
=
FileUploader
.
root
.
freeze
EXCLUDED_SYSTEM_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/-/*"
.
freeze
EXCLUDED_SYSTEM_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/-/*"
EXCLUDED_HASHED_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/@hashed/*"
.
freeze
EXCLUDED_HASHED_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/@hashed/*"
EXCLUDED_TMP_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/tmp/*"
.
freeze
EXCLUDED_TMP_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/tmp/*"
# Paths are relative to the upload directory
# Paths are relative to the upload directory
def
each_file_batch
(
batch_size:
FIND_BATCH_SIZE
,
&
block
)
def
each_file_batch
(
batch_size:
FIND_BATCH_SIZE
,
&
block
)
...
...
lib/gitlab/database/sha_attribute.rb
View file @
e908e117
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
# using them as if they were stored as string values. This gives you the
# using them as if they were stored as string values. This gives you the
# ease of use of string values, but without the storage overhead.
# ease of use of string values, but without the storage overhead.
class
ShaAttribute
<
BINARY_TYPE
class
ShaAttribute
<
BINARY_TYPE
PACK_FORMAT
=
'H*'
.
freeze
PACK_FORMAT
=
'H*'
# Casts binary data to a SHA1 in hexadecimal.
# Casts binary data to a SHA1 in hexadecimal.
def
deserialize
(
value
)
def
deserialize
(
value
)
...
...
lib/gitlab/downtime_check/message.rb
View file @
e908e117
...
@@ -5,8 +5,8 @@ module Gitlab
...
@@ -5,8 +5,8 @@ module Gitlab
class
Message
class
Message
attr_reader
:path
,
:offline
attr_reader
:path
,
:offline
OFFLINE
=
"
\e
[31moffline
\e
[0m"
.
freeze
OFFLINE
=
"
\e
[31moffline
\e
[0m"
ONLINE
=
"
\e
[32monline
\e
[0m"
.
freeze
ONLINE
=
"
\e
[32monline
\e
[0m"
# 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/ee_compat_check.rb
View file @
e908e117
# coding: utf-8
# frozen_string_literal: true
# frozen_string_literal: true
# rubocop: disable Rails/Output
# rubocop: disable Rails/Output
module
Gitlab
module
Gitlab
# Checks if a set of migrations requires downtime or not.
# Checks if a set of migrations requires downtime or not.
class
EeCompatCheck
class
EeCompatCheck
CANONICAL_CE_PROJECT_URL
=
'https://gitlab.com/gitlab-org/gitlab-ce'
.
freeze
CANONICAL_CE_PROJECT_URL
=
'https://gitlab.com/gitlab-org/gitlab-ce'
CANONICAL_EE_REPO_URL
=
'https://gitlab.com/gitlab-org/gitlab-ee.git'
.
freeze
CANONICAL_EE_REPO_URL
=
'https://gitlab.com/gitlab-org/gitlab-ee.git'
CHECK_DIR
=
Rails
.
root
.
join
(
'ee_compat_check'
)
CHECK_DIR
=
Rails
.
root
.
join
(
'ee_compat_check'
)
IGNORED_FILES_REGEX
=
/VERSION|CHANGELOG\.md|doc\/.+/i
.
freeze
IGNORED_FILES_REGEX
=
/VERSION|CHANGELOG\.md|doc\/.+/i
.
freeze
PLEASE_READ_THIS_BANNER
=
%Q{
PLEASE_READ_THIS_BANNER
=
%Q{
...
...
lib/gitlab/etag_caching/store.rb
View file @
e908e117
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
module
EtagCaching
module
EtagCaching
class
Store
class
Store
EXPIRY_TIME
=
20
.
minutes
EXPIRY_TIME
=
20
.
minutes
SHARED_STATE_NAMESPACE
=
'etag:'
.
freeze
SHARED_STATE_NAMESPACE
=
'etag:'
def
get
(
key
)
def
get
(
key
)
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
get
(
redis_shared_state_key
(
key
))
}
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
get
(
redis_shared_state_key
(
key
))
}
...
...
lib/gitlab/git.rb
View file @
e908e117
...
@@ -7,11 +7,11 @@ module Gitlab
...
@@ -7,11 +7,11 @@ module Gitlab
# The ID of empty tree.
# The ID of empty tree.
# See http://stackoverflow.com/a/40884093/1856239 and
# See http://stackoverflow.com/a/40884093/1856239 and
# https://github.com/git/git/blob/3ad8b5bf26362ac67c9020bf8c30eee54a84f56d/cache.h#L1011-L1012
# https://github.com/git/git/blob/3ad8b5bf26362ac67c9020bf8c30eee54a84f56d/cache.h#L1011-L1012
EMPTY_TREE_ID
=
'4b825dc642cb6eb9a060e54bf8d69288fbee4904'
.
freeze
EMPTY_TREE_ID
=
'4b825dc642cb6eb9a060e54bf8d69288fbee4904'
BLANK_SHA
=
(
'0'
*
40
).
freeze
BLANK_SHA
=
(
'0'
*
40
).
freeze
COMMIT_ID
=
/\A[0-9a-f]{40}\z/
.
freeze
COMMIT_ID
=
/\A[0-9a-f]{40}\z/
.
freeze
TAG_REF_PREFIX
=
"refs/tags/"
.
freeze
TAG_REF_PREFIX
=
"refs/tags/"
BRANCH_REF_PREFIX
=
"refs/heads/"
.
freeze
BRANCH_REF_PREFIX
=
"refs/heads/"
BaseError
=
Class
.
new
(
StandardError
)
BaseError
=
Class
.
new
(
StandardError
)
CommandError
=
Class
.
new
(
BaseError
)
CommandError
=
Class
.
new
(
BaseError
)
...
...
lib/gitlab/git/lfs_pointer_file.rb
View file @
e908e117
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Git
module
Git
class
LfsPointerFile
class
LfsPointerFile
VERSION
=
"https://git-lfs.github.com/spec/v1"
.
freeze
VERSION
=
"https://git-lfs.github.com/spec/v1"
VERSION_LINE
=
"version
#{
VERSION
}
"
.
freeze
VERSION_LINE
=
"version
#{
VERSION
}
"
def
initialize
(
data
)
def
initialize
(
data
)
@data
=
data
@data
=
data
...
...
lib/gitlab/git/repository.rb
View file @
e908e117
...
@@ -15,9 +15,9 @@ module Gitlab
...
@@ -15,9 +15,9 @@ module Gitlab
SEARCH_CONTEXT_LINES
=
3
SEARCH_CONTEXT_LINES
=
3
REV_LIST_COMMIT_LIMIT
=
2_000
REV_LIST_COMMIT_LIMIT
=
2_000
GITALY_INTERNAL_URL
=
'ssh://gitaly/internal.git'
.
freeze
GITALY_INTERNAL_URL
=
'ssh://gitaly/internal.git'
GITLAB_PROJECTS_TIMEOUT
=
Gitlab
.
config
.
gitlab_shell
.
git_timeout
GITLAB_PROJECTS_TIMEOUT
=
Gitlab
.
config
.
gitlab_shell
.
git_timeout
EMPTY_REPOSITORY_CHECKSUM
=
'0000000000000000000000000000000000000000'
.
freeze
EMPTY_REPOSITORY_CHECKSUM
=
'0000000000000000000000000000000000000000'
NoRepository
=
Class
.
new
(
StandardError
)
NoRepository
=
Class
.
new
(
StandardError
)
InvalidRepository
=
Class
.
new
(
StandardError
)
InvalidRepository
=
Class
.
new
(
StandardError
)
...
...
lib/gitlab/git/util.rb
View file @
e908e117
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
module
Gitlab
module
Gitlab
module
Git
module
Git
module
Util
module
Util
LINE_SEP
=
"
\n
"
.
freeze
LINE_SEP
=
"
\n
"
def
self
.
count_lines
(
string
)
def
self
.
count_lines
(
string
)
case
string
[
-
1
]
case
string
[
-
1
]
...
...
lib/gitlab/github_import/issuable_finder.rb
View file @
e908e117
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
attr_reader
:project
,
:object
attr_reader
:project
,
:object
# The base cache key to use for storing/retrieving issuable IDs.
# The base cache key to use for storing/retrieving issuable IDs.
CACHE_KEY
=
'github-import/issuable-finder/%{project}/%{type}/%{iid}'
.
freeze
CACHE_KEY
=
'github-import/issuable-finder/%{project}/%{type}/%{iid}'
# project - An instance of `Project`.
# project - An instance of `Project`.
# object - The object to look up or set a database ID for.
# object - The object to look up or set a database ID for.
...
...
lib/gitlab/github_import/label_finder.rb
View file @
e908e117
...
@@ -6,7 +6,7 @@ module Gitlab
...
@@ -6,7 +6,7 @@ module Gitlab
attr_reader
:project
attr_reader
:project
# The base cache key to use for storing/retrieving label IDs.
# The base cache key to use for storing/retrieving label IDs.
CACHE_KEY
=
'github-import/label-finder/%{project}/%{name}'
.
freeze
CACHE_KEY
=
'github-import/label-finder/%{project}/%{name}'
# project - An instance of `Project`.
# project - An instance of `Project`.
def
initialize
(
project
)
def
initialize
(
project
)
...
...
lib/gitlab/github_import/milestone_finder.rb
View file @
e908e117
...
@@ -6,7 +6,7 @@ module Gitlab
...
@@ -6,7 +6,7 @@ module Gitlab
attr_reader
:project
attr_reader
:project
# The base cache key to use for storing/retrieving milestone IDs.
# The base cache key to use for storing/retrieving milestone IDs.
CACHE_KEY
=
'github-import/milestone-finder/%{project}/%{iid}'
.
freeze
CACHE_KEY
=
'github-import/milestone-finder/%{project}/%{iid}'
# project - An instance of `Project`
# project - An instance of `Project`
def
initialize
(
project
)
def
initialize
(
project
)
...
...
lib/gitlab/github_import/page_counter.rb
View file @
e908e117
...
@@ -9,7 +9,7 @@ module Gitlab
...
@@ -9,7 +9,7 @@ module Gitlab
attr_reader
:cache_key
attr_reader
:cache_key
# The base cache key to use for storing the last page number.
# The base cache key to use for storing the last page number.
CACHE_KEY
=
'github-importer/page-counter/%{project}/%{collection}'
.
freeze
CACHE_KEY
=
'github-importer/page-counter/%{project}/%{collection}'
def
initialize
(
project
,
collection
)
def
initialize
(
project
,
collection
)
@cache_key
=
CACHE_KEY
%
{
project:
project
.
id
,
collection:
collection
}
@cache_key
=
CACHE_KEY
%
{
project:
project
.
id
,
collection:
collection
}
...
...
lib/gitlab/github_import/parallel_scheduling.rb
View file @
e908e117
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
# The base cache key to use for tracking already imported objects.
# The base cache key to use for tracking already imported objects.
ALREADY_IMPORTED_CACHE_KEY
=
ALREADY_IMPORTED_CACHE_KEY
=
'github-importer/already-imported/%{project}/%{collection}'
.
freeze
'github-importer/already-imported/%{project}/%{collection}'
# project - An instance of `Project`.
# project - An instance of `Project`.
# client - An instance of `Gitlab::GithubImport::Client`.
# client - An instance of `Gitlab::GithubImport::Client`.
...
...
lib/gitlab/github_import/user_finder.rb
View file @
e908e117
...
@@ -16,17 +16,17 @@ module Gitlab
...
@@ -16,17 +16,17 @@ module Gitlab
# The base cache key to use for caching user IDs for a given GitHub user
# The base cache key to use for caching user IDs for a given GitHub user
# ID.
# ID.
ID_CACHE_KEY
=
'github-import/user-finder/user-id/%s'
.
freeze
ID_CACHE_KEY
=
'github-import/user-finder/user-id/%s'
# The base cache key to use for caching user IDs for a given GitHub email
# The base cache key to use for caching user IDs for a given GitHub email
# address.
# address.
ID_FOR_EMAIL_CACHE_KEY
=
ID_FOR_EMAIL_CACHE_KEY
=
'github-import/user-finder/id-for-email/%s'
.
freeze
'github-import/user-finder/id-for-email/%s'
# The base cache key to use for caching the Email addresses of GitHub
# The base cache key to use for caching the Email addresses of GitHub
# usernames.
# usernames.
EMAIL_FOR_USERNAME_CACHE_KEY
=
EMAIL_FOR_USERNAME_CACHE_KEY
=
'github-import/user-finder/email-for-username/%s'
.
freeze
'github-import/user-finder/email-for-username/%s'
# project - An instance of `Project`
# project - An instance of `Project`
# client - An instance of `Gitlab::GithubImport::Client`
# client - An instance of `Gitlab::GithubImport::Client`
...
...
lib/gitlab/health_checks/gitaly_check.rb
View file @
e908e117
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
class
GitalyCheck
class
GitalyCheck
extend
BaseAbstractCheck
extend
BaseAbstractCheck
METRIC_PREFIX
=
'gitaly_health_check'
.
freeze
METRIC_PREFIX
=
'gitaly_health_check'
class
<<
self
class
<<
self
def
readiness
def
readiness
...
...
lib/gitlab/import_export.rb
View file @
e908e117
...
@@ -7,7 +7,7 @@ module Gitlab
...
@@ -7,7 +7,7 @@ module Gitlab
# For every version update the version history in these docs must be kept up to date:
# For every version update the version history in these docs must be kept up to date:
# - development/import_export.md
# - development/import_export.md
# - user/project/settings/import_export.md
# - user/project/settings/import_export.md
VERSION
=
'0.2.4'
.
freeze
VERSION
=
'0.2.4'
FILENAME_LIMIT
=
50
FILENAME_LIMIT
=
50
def
export_path
(
relative_path
:)
def
export_path
(
relative_path
:)
...
...
lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb
View file @
e908e117
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
StrategyError
=
Class
.
new
(
StandardError
)
StrategyError
=
Class
.
new
(
StandardError
)
AFTER_EXPORT_LOCK_FILE_NAME
=
'.after_export_action'
.
freeze
AFTER_EXPORT_LOCK_FILE_NAME
=
'.after_export_action'
private
private
...
...
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
View file @
e908e117
...
@@ -4,9 +4,9 @@ module Gitlab
...
@@ -4,9 +4,9 @@ module Gitlab
module
ImportExport
module
ImportExport
module
AfterExportStrategies
module
AfterExportStrategies
class
WebUploadStrategy
<
BaseAfterExportStrategy
class
WebUploadStrategy
<
BaseAfterExportStrategy
PUT_METHOD
=
'PUT'
.
freeze
PUT_METHOD
=
'PUT'
POST_METHOD
=
'POST'
.
freeze
POST_METHOD
=
'POST'
INVALID_HTTP_METHOD
=
'invalid. Only PUT and POST methods allowed.'
.
freeze
INVALID_HTTP_METHOD
=
'invalid. Only PUT and POST methods allowed.'
validates
:url
,
addressable_url:
true
validates
:url
,
addressable_url:
true
...
...
lib/gitlab/incoming_email.rb
View file @
e908e117
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
module
Gitlab
module
Gitlab
module
IncomingEmail
module
IncomingEmail
UNSUBSCRIBE_SUFFIX
=
'-unsubscribe'
.
freeze
UNSUBSCRIBE_SUFFIX
=
'-unsubscribe'
UNSUBSCRIBE_SUFFIX_LEGACY
=
'+unsubscribe'
.
freeze
UNSUBSCRIBE_SUFFIX_LEGACY
=
'+unsubscribe'
WILDCARD_PLACEHOLDER
=
'%{key}'
.
freeze
WILDCARD_PLACEHOLDER
=
'%{key}'
class
<<
self
class
<<
self
def
enabled?
def
enabled?
...
...
lib/gitlab/job_waiter.rb
View file @
e908e117
...
@@ -17,7 +17,7 @@ module Gitlab
...
@@ -17,7 +17,7 @@ module Gitlab
# push to that array when done. Once the waiter has popped `count` items, it
# push to that array when done. Once the waiter has popped `count` items, it
# knows all the jobs are done.
# knows all the jobs are done.
class
JobWaiter
class
JobWaiter
KEY_PREFIX
=
"gitlab:job_waiter"
.
freeze
KEY_PREFIX
=
"gitlab:job_waiter"
def
self
.
notify
(
key
,
jid
)
def
self
.
notify
(
key
,
jid
)
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
lpush
(
key
,
jid
)
}
Gitlab
::
Redis
::
SharedState
.
with
{
|
redis
|
redis
.
lpush
(
key
,
jid
)
}
...
...
lib/gitlab/kubernetes/helm.rb
View file @
e908e117
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
module
Gitlab
module
Gitlab
module
Kubernetes
module
Kubernetes
module
Helm
module
Helm
HELM_VERSION
=
'2.14.3'
.
freeze
HELM_VERSION
=
'2.14.3'
KUBECTL_VERSION
=
'1.11.10'
.
freeze
KUBECTL_VERSION
=
'1.11.10'
NAMESPACE
=
'gitlab-managed-apps'
.
freeze
NAMESPACE
=
'gitlab-managed-apps'
SERVICE_ACCOUNT
=
'tiller'
.
freeze
SERVICE_ACCOUNT
=
'tiller'
CLUSTER_ROLE_BINDING
=
'tiller-admin'
.
freeze
CLUSTER_ROLE_BINDING
=
'tiller-admin'
CLUSTER_ROLE
=
'cluster-admin'
.
freeze
CLUSTER_ROLE
=
'cluster-admin'
end
end
end
end
end
end
lib/gitlab/kubernetes/pod.rb
View file @
e908e117
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
module
Gitlab
module
Gitlab
module
Kubernetes
module
Kubernetes
module
Pod
module
Pod
PENDING
=
'Pending'
.
freeze
PENDING
=
'Pending'
RUNNING
=
'Running'
.
freeze
RUNNING
=
'Running'
SUCCEEDED
=
'Succeeded'
.
freeze
SUCCEEDED
=
'Succeeded'
FAILED
=
'Failed'
.
freeze
FAILED
=
'Failed'
UNKNOWN
=
'Unknown'
.
freeze
UNKNOWN
=
'Unknown'
PHASES
=
[
PENDING
,
RUNNING
,
SUCCEEDED
,
FAILED
,
UNKNOWN
].
freeze
PHASES
=
[
PENDING
,
RUNNING
,
SUCCEEDED
,
FAILED
,
UNKNOWN
].
freeze
end
end
end
end
...
...
lib/gitlab/logger.rb
View file @
e908e117
...
@@ -40,7 +40,7 @@ module Gitlab
...
@@ -40,7 +40,7 @@ module Gitlab
end
end
def
self
.
cache_key
def
self
.
cache_key
'logger:'
.
freeze
+
self
.
full_log_path
.
to_s
'logger:'
+
self
.
full_log_path
.
to_s
end
end
end
end
end
end
lib/gitlab/metrics/subscribers/action_view.rb
View file @
e908e117
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
attach_to
:action_view
attach_to
:action_view
SERIES
=
'views'
.
freeze
SERIES
=
'views'
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 @
e908e117
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,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'
.
freeze
EVENT_SERIES
=
'events'
attr_reader
:tags
,
:values
,
:method
,
:metrics
attr_reader
:tags
,
:values
,
:method
,
:metrics
...
...
lib/gitlab/metrics/web_transaction.rb
View file @
e908e117
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Metrics
module
Metrics
class
WebTransaction
<
Transaction
class
WebTransaction
<
Transaction
CONTROLLER_KEY
=
'action_controller.instance'
.
freeze
CONTROLLER_KEY
=
'action_controller.instance'
ENDPOINT_KEY
=
'api.endpoint'
.
freeze
ENDPOINT_KEY
=
'api.endpoint'
ALLOWED_SUFFIXES
=
Set
.
new
(
%w[json js atom rss xml zip]
)
ALLOWED_SUFFIXES
=
Set
.
new
(
%w[json js atom rss xml zip]
)
def
initialize
(
env
)
def
initialize
(
env
)
...
...
lib/gitlab/middleware/multipart.rb
View file @
e908e117
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
module
Gitlab
module
Gitlab
module
Middleware
module
Middleware
class
Multipart
class
Multipart
RACK_ENV_KEY
=
'HTTP_GITLAB_WORKHORSE_MULTIPART_FIELDS'
.
freeze
RACK_ENV_KEY
=
'HTTP_GITLAB_WORKHORSE_MULTIPART_FIELDS'
class
Handler
class
Handler
def
initialize
(
env
,
message
)
def
initialize
(
env
,
message
)
...
...
lib/gitlab/middleware/read_only/controller.rb
View file @
e908e117
...
@@ -5,9 +5,9 @@ module Gitlab
...
@@ -5,9 +5,9 @@ module Gitlab
class
ReadOnly
class
ReadOnly
class
Controller
class
Controller
DISALLOWED_METHODS
=
%w(POST PATCH PUT DELETE)
.
freeze
DISALLOWED_METHODS
=
%w(POST PATCH PUT DELETE)
.
freeze
APPLICATION_JSON
=
'application/json'
.
freeze
APPLICATION_JSON
=
'application/json'
APPLICATION_JSON_TYPES
=
%W{
#{
APPLICATION_JSON
}
application/vnd.git-lfs+json}
.
freeze
APPLICATION_JSON_TYPES
=
%W{
#{
APPLICATION_JSON
}
application/vnd.git-lfs+json}
.
freeze
ERROR_MESSAGE
=
'You cannot perform write operations on a read-only instance'
.
freeze
ERROR_MESSAGE
=
'You cannot perform write operations on a read-only instance'
WHITELISTED_GIT_ROUTES
=
{
WHITELISTED_GIT_ROUTES
=
{
'projects/git_http'
=>
%w{git_upload_pack git_receive_pack}
'projects/git_http'
=>
%w{git_upload_pack git_receive_pack}
...
...
lib/gitlab/path_regex.rb
View file @
e908e117
...
@@ -125,9 +125,9 @@ module Gitlab
...
@@ -125,9 +125,9 @@ module Gitlab
# allow non-regex validations, etc), `NAMESPACE_FORMAT_REGEX_JS` serves as a Javascript-compatible version of
# allow non-regex validations, etc), `NAMESPACE_FORMAT_REGEX_JS` serves as a Javascript-compatible version of
# `NAMESPACE_FORMAT_REGEX`, with the negative lookbehind assertion removed. This means that the client-side validation
# `NAMESPACE_FORMAT_REGEX`, with the negative lookbehind assertion removed. This means that the client-side validation
# will pass for usernames ending in `.atom` and `.git`, but will be caught by the server-side validation.
# will pass for usernames ending in `.atom` and `.git`, but will be caught by the server-side validation.
PATH_START_CHAR
=
'[a-zA-Z0-9_\.]'
.
freeze
PATH_START_CHAR
=
'[a-zA-Z0-9_\.]'
PATH_REGEX_STR
=
PATH_START_CHAR
+
'[a-zA-Z0-9_\-\.]*'
.
freeze
PATH_REGEX_STR
=
PATH_START_CHAR
+
'[a-zA-Z0-9_\-\.]*'
NAMESPACE_FORMAT_REGEX_JS
=
PATH_REGEX_STR
+
'[a-zA-Z0-9_\-]|[a-zA-Z0-9_]'
.
freeze
NAMESPACE_FORMAT_REGEX_JS
=
PATH_REGEX_STR
+
'[a-zA-Z0-9_\-]|[a-zA-Z0-9_]'
NO_SUFFIX_REGEX
=
/(?<!\.git|\.atom)/
.
freeze
NO_SUFFIX_REGEX
=
/(?<!\.git|\.atom)/
.
freeze
NAMESPACE_FORMAT_REGEX
=
/(?:
#{
NAMESPACE_FORMAT_REGEX_JS
}
)
#{
NO_SUFFIX_REGEX
}
/
.
freeze
NAMESPACE_FORMAT_REGEX
=
/(?:
#{
NAMESPACE_FORMAT_REGEX_JS
}
)
#{
NO_SUFFIX_REGEX
}
/
.
freeze
...
...
lib/gitlab/performance_bar.rb
View file @
e908e117
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
module
PerformanceBar
module
PerformanceBar
ALLOWED_USER_IDS_KEY
=
'performance_bar_allowed_user_ids:v2'
.
freeze
ALLOWED_USER_IDS_KEY
=
'performance_bar_allowed_user_ids:v2'
EXPIRY_TIME_L1_CACHE
=
1
.
minute
EXPIRY_TIME_L1_CACHE
=
1
.
minute
EXPIRY_TIME_L2_CACHE
=
5
.
minutes
EXPIRY_TIME_L2_CACHE
=
5
.
minutes
...
...
lib/gitlab/polling_interval.rb
View file @
e908e117
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
class
PollingInterval
class
PollingInterval
HEADER_NAME
=
'Poll-Interval'
.
freeze
HEADER_NAME
=
'Poll-Interval'
def
self
.
set_header
(
response
,
interval
:)
def
self
.
set_header
(
response
,
interval
:)
if
polling_enabled?
if
polling_enabled?
...
...
lib/gitlab/private_commit_email.rb
View file @
e908e117
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
module
PrivateCommitEmail
module
PrivateCommitEmail
TOKEN
=
"_private"
.
freeze
TOKEN
=
"_private"
class
<<
self
class
<<
self
def
regex
def
regex
...
...
lib/gitlab/profiler.rb
View file @
e908e117
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
Profiler
module
Profiler
FILTERED_STRING
=
'[FILTERED]'
.
freeze
FILTERED_STRING
=
'[FILTERED]'
IGNORE_BACKTRACES
=
%w[
IGNORE_BACKTRACES
=
%w[
lib/gitlab/i18n.rb
lib/gitlab/i18n.rb
...
...
lib/gitlab/prometheus/additional_metrics_parser.rb
View file @
e908e117
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Gitlab
module
Prometheus
module
Prometheus
module
AdditionalMetricsParser
module
AdditionalMetricsParser
CONFIG_ROOT
=
'config/prometheus'
.
freeze
CONFIG_ROOT
=
'config/prometheus'
MUTEX
=
Mutex
.
new
MUTEX
=
Mutex
.
new
extend
self
extend
self
...
...
lib/gitlab/query_limiting/middleware.rb
View file @
e908e117
...
@@ -5,8 +5,8 @@ module Gitlab
...
@@ -5,8 +5,8 @@ module Gitlab
# Middleware for reporting (or raising) when a request performs more than a
# Middleware for reporting (or raising) when a request performs more than a
# certain amount of database queries.
# certain amount of database queries.
class
Middleware
class
Middleware
CONTROLLER_KEY
=
'action_controller.instance'
.
freeze
CONTROLLER_KEY
=
'action_controller.instance'
ENDPOINT_KEY
=
'api.endpoint'
.
freeze
ENDPOINT_KEY
=
'api.endpoint'
def
initialize
(
app
)
def
initialize
(
app
)
@app
=
app
@app
=
app
...
...
lib/gitlab/quick_actions/issuable_actions.rb
View file @
e908e117
# coding: utf-8
# frozen_string_literal: true
# frozen_string_literal: true
module
Gitlab
module
Gitlab
...
@@ -6,8 +7,8 @@ module Gitlab
...
@@ -6,8 +7,8 @@ module Gitlab
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
include
Gitlab
::
QuickActions
::
Dsl
include
Gitlab
::
QuickActions
::
Dsl
SHRUG
=
'¯\\_(ツ)_/¯'
.
freeze
SHRUG
=
'¯\\_(ツ)_/¯'
TABLEFLIP
=
'(╯°□°)╯︵ ┻━┻'
.
freeze
TABLEFLIP
=
'(╯°□°)╯︵ ┻━┻'
included
do
included
do
# Issue, MergeRequest, Epic: quick actions definitions
# Issue, MergeRequest, Epic: quick actions definitions
...
...
lib/gitlab/redis/cache.rb
View file @
e908e117
...
@@ -6,9 +6,9 @@ require_relative 'wrapper' unless defined?(::Rails) && ::Rails.root.present?
...
@@ -6,9 +6,9 @@ require_relative 'wrapper' unless defined?(::Rails) && ::Rails.root.present?
module
Gitlab
module
Gitlab
module
Redis
module
Redis
class
Cache
<
::
Gitlab
::
Redis
::
Wrapper
class
Cache
<
::
Gitlab
::
Redis
::
Wrapper
CACHE_NAMESPACE
=
'cache:gitlab'
.
freeze
CACHE_NAMESPACE
=
'cache:gitlab'
DEFAULT_REDIS_CACHE_URL
=
'redis://localhost:6380'
.
freeze
DEFAULT_REDIS_CACHE_URL
=
'redis://localhost:6380'
REDIS_CACHE_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_CACHE_CONFIG_FILE'
.
freeze
REDIS_CACHE_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_CACHE_CONFIG_FILE'
class
<<
self
class
<<
self
def
default_url
def
default_url
...
...
lib/gitlab/redis/queues.rb
View file @
e908e117
...
@@ -6,10 +6,10 @@ require_relative 'wrapper' unless defined?(::Gitlab::Redis::Wrapper)
...
@@ -6,10 +6,10 @@ require_relative 'wrapper' unless defined?(::Gitlab::Redis::Wrapper)
module
Gitlab
module
Gitlab
module
Redis
module
Redis
class
Queues
<
::
Gitlab
::
Redis
::
Wrapper
class
Queues
<
::
Gitlab
::
Redis
::
Wrapper
SIDEKIQ_NAMESPACE
=
'resque:gitlab'
.
freeze
SIDEKIQ_NAMESPACE
=
'resque:gitlab'
MAILROOM_NAMESPACE
=
'mail_room:gitlab'
.
freeze
MAILROOM_NAMESPACE
=
'mail_room:gitlab'
DEFAULT_REDIS_QUEUES_URL
=
'redis://localhost:6381'
.
freeze
DEFAULT_REDIS_QUEUES_URL
=
'redis://localhost:6381'
REDIS_QUEUES_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_QUEUES_CONFIG_FILE'
.
freeze
REDIS_QUEUES_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_QUEUES_CONFIG_FILE'
class
<<
self
class
<<
self
def
default_url
def
default_url
...
...
lib/gitlab/redis/shared_state.rb
View file @
e908e117
...
@@ -6,12 +6,12 @@ require_relative 'wrapper' unless defined?(::Gitlab::Redis::Wrapper)
...
@@ -6,12 +6,12 @@ require_relative 'wrapper' unless defined?(::Gitlab::Redis::Wrapper)
module
Gitlab
module
Gitlab
module
Redis
module
Redis
class
SharedState
<
::
Gitlab
::
Redis
::
Wrapper
class
SharedState
<
::
Gitlab
::
Redis
::
Wrapper
SESSION_NAMESPACE
=
'session:gitlab'
.
freeze
SESSION_NAMESPACE
=
'session:gitlab'
USER_SESSIONS_NAMESPACE
=
'session:user:gitlab'
.
freeze
USER_SESSIONS_NAMESPACE
=
'session:user:gitlab'
USER_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:user:gitlab'
.
freeze
USER_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:user:gitlab'
IP_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:ip:gitlab'
.
freeze
IP_SESSIONS_LOOKUP_NAMESPACE
=
'session:lookup:ip:gitlab'
DEFAULT_REDIS_SHARED_STATE_URL
=
'redis://localhost:6382'
.
freeze
DEFAULT_REDIS_SHARED_STATE_URL
=
'redis://localhost:6382'
REDIS_SHARED_STATE_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_SHARED_STATE_CONFIG_FILE'
.
freeze
REDIS_SHARED_STATE_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_SHARED_STATE_CONFIG_FILE'
class
<<
self
class
<<
self
def
default_url
def
default_url
...
...
lib/gitlab/redis/wrapper.rb
View file @
e908e117
...
@@ -8,8 +8,8 @@ require 'active_support/core_ext/module/delegation'
...
@@ -8,8 +8,8 @@ require 'active_support/core_ext/module/delegation'
module
Gitlab
module
Gitlab
module
Redis
module
Redis
class
Wrapper
class
Wrapper
DEFAULT_REDIS_URL
=
'redis://localhost:6379'
.
freeze
DEFAULT_REDIS_URL
=
'redis://localhost:6379'
REDIS_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_CONFIG_FILE'
.
freeze
REDIS_CONFIG_ENV_VAR_NAME
=
'GITLAB_REDIS_CONFIG_FILE'
class
<<
self
class
<<
self
delegate
:params
,
:url
,
to: :new
delegate
:params
,
:url
,
to: :new
...
...
lib/gitlab/request_profiler.rb
View file @
e908e117
...
@@ -4,7 +4,7 @@ require 'fileutils'
...
@@ -4,7 +4,7 @@ require 'fileutils'
module
Gitlab
module
Gitlab
module
RequestProfiler
module
RequestProfiler
PROFILES_DIR
=
"
#{
Gitlab
.
config
.
shared
.
path
}
/tmp/requests_profiles"
.
freeze
PROFILES_DIR
=
"
#{
Gitlab
.
config
.
shared
.
path
}
/tmp/requests_profiles"
def
all
def
all
Dir
[
"
#{
PROFILES_DIR
}
/*.{html,txt}"
].
map
do
|
path
|
Dir
[
"
#{
PROFILES_DIR
}
/*.{html,txt}"
].
map
do
|
path
|
...
...
lib/gitlab/shard_health_cache.rb
View file @
e908e117
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
class
ShardHealthCache
class
ShardHealthCache
HEALTHY_SHARDS_KEY
=
'gitlab-healthy-shards'
.
freeze
HEALTHY_SHARDS_KEY
=
'gitlab-healthy-shards'
HEALTHY_SHARDS_TIMEOUT
=
300
HEALTHY_SHARDS_TIMEOUT
=
300
# Clears the Redis set storing the list of healthy shards
# Clears the Redis set storing the list of healthy shards
...
...
lib/gitlab/sidekiq_monitor.rb
View file @
e908e117
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
class
SidekiqMonitor
<
Daemon
class
SidekiqMonitor
<
Daemon
include
::
Gitlab
::
Utils
::
StrongMemoize
include
::
Gitlab
::
Utils
::
StrongMemoize
NOTIFICATION_CHANNEL
=
'sidekiq:cancel:notifications'
.
freeze
NOTIFICATION_CHANNEL
=
'sidekiq:cancel:notifications'
CANCEL_DEADLINE
=
24
.
hours
.
seconds
CANCEL_DEADLINE
=
24
.
hours
.
seconds
RECONNECT_TIME
=
3
.
seconds
RECONNECT_TIME
=
3
.
seconds
...
...
lib/gitlab/sidekiq_status.rb
View file @
e908e117
...
@@ -18,7 +18,7 @@ module Gitlab
...
@@ -18,7 +18,7 @@ module Gitlab
# expire after a certain period of time to prevent storing too many keys in
# expire after a certain period of time to prevent storing too many keys in
# Redis.
# Redis.
module
SidekiqStatus
module
SidekiqStatus
STATUS_KEY
=
'gitlab-sidekiq-status:%s'
.
freeze
STATUS_KEY
=
'gitlab-sidekiq-status:%s'
# The default time (in seconds) after which a status key is expired
# The default time (in seconds) after which a status key is expired
# automatically. The default of 30 minutes should be more than sufficient
# automatically. The default of 30 minutes should be more than sufficient
...
...
lib/gitlab/url_helpers.rb
View file @
e908e117
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Gitlab
class
UrlHelpers
class
UrlHelpers
WSS_PROTOCOL
=
"wss"
.
freeze
WSS_PROTOCOL
=
"wss"
def
self
.
as_wss
(
url
)
def
self
.
as_wss
(
url
)
return
unless
url
.
present?
return
unless
url
.
present?
...
...
lib/gitlab/workhorse.rb
View file @
e908e117
...
@@ -7,13 +7,13 @@ require 'uri'
...
@@ -7,13 +7,13 @@ require 'uri'
module
Gitlab
module
Gitlab
class
Workhorse
class
Workhorse
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
.
freeze
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
VERSION_FILE
=
'GITLAB_WORKHORSE_VERSION'
.
freeze
VERSION_FILE
=
'GITLAB_WORKHORSE_VERSION'
INTERNAL_API_CONTENT_TYPE
=
'application/vnd.gitlab-workhorse+json'
.
freeze
INTERNAL_API_CONTENT_TYPE
=
'application/vnd.gitlab-workhorse+json'
INTERNAL_API_REQUEST_HEADER
=
'Gitlab-Workhorse-Api-Request'
.
freeze
INTERNAL_API_REQUEST_HEADER
=
'Gitlab-Workhorse-Api-Request'
NOTIFICATION_CHANNEL
=
'workhorse:notifications'
.
freeze
NOTIFICATION_CHANNEL
=
'workhorse:notifications'
ALLOWED_GIT_HTTP_ACTIONS
=
%w[git_receive_pack git_upload_pack info_refs]
.
freeze
ALLOWED_GIT_HTTP_ACTIONS
=
%w[git_receive_pack git_upload_pack info_refs]
.
freeze
DETECT_HEADER
=
'Gitlab-Workhorse-Detect-Content-Type'
.
freeze
DETECT_HEADER
=
'Gitlab-Workhorse-Detect-Content-Type'
# 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
...
...
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