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