Commit 16a6cd9d authored by Lee Tickett's avatar Lee Tickett

Remove unnecessary use of freeze

parent 75891f66
---
title: Remove unnecessary use of freeze
merge_request: 57058
author: Lee Tickett @leetickett
type: other
......@@ -5,9 +5,9 @@ module Gitlab
module DatabaseTasks
extend self
DATABASE_CONFIG = 'config/database.yml'.freeze
GEO_DATABASE_CONFIG = 'config/database_geo.yml'.freeze
GEO_DB_DIR = 'ee/db/geo'.freeze
DATABASE_CONFIG = 'config/database.yml'
GEO_DATABASE_CONFIG = 'config/database_geo.yml'
GEO_DB_DIR = 'ee/db/geo'
def method_missing(method_name, *args, &block)
with_geo_db do
......
......@@ -8,7 +8,7 @@ module Gitlab
attr_accessor :previous_id
GEO_EVENT_LOG_GAPS = 'geo:event_log:gaps'.freeze
GEO_EVENT_LOG_GAPS = 'geo:event_log:gaps'
GAP_GRACE_PERIOD = 10.minutes
GAP_OUTDATED_PERIOD = 1.hour
......
......@@ -5,11 +5,11 @@ module Gitlab
class GitSSHProxy
HTTP_READ_TIMEOUT = 60
UPLOAD_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-upload-pack-request'.freeze
UPLOAD_PACK_RESULT_CONTENT_TYPE = 'application/x-git-upload-pack-result'.freeze
UPLOAD_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-upload-pack-request'
UPLOAD_PACK_RESULT_CONTENT_TYPE = 'application/x-git-upload-pack-result'
RECEIVE_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-receive-pack-request'.freeze
RECEIVE_PACK_RESULT_CONTENT_TYPE = 'application/x-git-receive-pack-result'.freeze
RECEIVE_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-receive-pack-request'
RECEIVE_PACK_RESULT_CONTENT_TYPE = 'application/x-git-receive-pack-result'
MustBeASecondaryNode = Class.new(StandardError)
......
......@@ -4,7 +4,7 @@ module Gitlab
module Geo
module LogCursor
class Daemon
VERSION = '0.2.0'.freeze
VERSION = '0.2.0'
BATCH_SIZE = 250
SECONDARY_CHECK_INTERVAL = 60
MAX_ERROR_DURATION = 1800
......
......@@ -4,9 +4,9 @@ module Gitlab
module Geo
module LogCursor
module Lease
NAMESPACE = 'geo:gitlab'.freeze
NAMESPACE = 'geo:gitlab'
LEASE_TIMEOUT = 30.seconds.freeze
LEASE_KEY = 'geo_log_cursor_processed'.freeze
LEASE_KEY = 'geo_log_cursor_processed'
def self.exclusive_lease
@lease ||= Gitlab::ExclusiveLease.new(LEASE_KEY, timeout: LEASE_TIMEOUT)
......
......@@ -4,7 +4,7 @@ module Gitlab
module Geo
module Replication
USER_UPLOADS_OBJECT_TYPES = %i[attachment avatar file import_export namespace_file personal_file favicon design_management/design_v432x230].freeze
FILE_NOT_FOUND_GEO_CODE = 'FILE_NOT_FOUND'.freeze
FILE_NOT_FOUND_GEO_CODE = 'FILE_NOT_FOUND'
def self.object_type_from_user_uploads?(object_type)
USER_UPLOADS_OBJECT_TYPES.include?(object_type.to_sym)
......
......@@ -6,7 +6,7 @@ module Gitlab
class << self
include Gitlab::Routing
GITLAB_ORG_NAMESPACE = 'gitlab-org'.freeze
GITLAB_ORG_NAMESPACE = 'gitlab-org'
def execute
unless Gitlab.com?
......
......@@ -3,7 +3,7 @@
module Gitlab
module SPDX
class CatalogueGateway
URL = 'https://spdx.org/licenses/licenses.json'.freeze
URL = 'https://spdx.org/licenses/licenses.json'
OFFLINE_CATALOGUE = Rails.root.join('vendor/spdx.json').freeze
def fetch
......
......@@ -5,7 +5,7 @@ module SystemCheck
class AuthorizedKeysCheck < ::SystemCheck::BaseCheck
set_name 'OpenSSH configured to use AuthorizedKeysCommand'
AUTHORIZED_KEYS_DOCS = 'doc/administration/operations/fast_ssh_key_lookup.md'.freeze
AUTHORIZED_KEYS_DOCS = 'doc/administration/operations/fast_ssh_key_lookup.md'
OPENSSH_AUTHORIZED_KEYS_CMD_REGEXP = %r{
^AuthorizedKeysCommand # line starts with
\s+ # one space or more
......@@ -24,7 +24,7 @@ module SystemCheck
\s* # optional any amount of space character
(?:\#.*)?$ # optional start-comment symbol followed by optionally any character until end of line
}x.freeze
OPENSSH_EXPECTED_COMMAND = '/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check git %u %k'.freeze
OPENSSH_EXPECTED_COMMAND = '/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-authorized-keys-check git %u %k'
def multi_check
unless openssh_config_exists?
......
......@@ -6,12 +6,12 @@ module SystemCheck
set_name 'GitLab Geo secondary database is correctly configured'
set_skip_reason 'not a secondary node'
DATABASE_DOCS = 'doc/gitlab-geo/database.md'.freeze
TROUBLESHOOTING_DOCS = 'doc/gitlab-geo/troubleshooting.md'.freeze
WRONG_CONFIGURATION_MESSAGE = 'Check if you enabled the `geo_secondary_role` or `geo_postgresql` in the gitlab.rb config file.'.freeze
UNHEALTHY_CONNECTION_MESSAGE = 'Check the tracking database configuration as the connection could not be established'.freeze
NO_TABLES_MESSAGE = 'Run the tracking database migrations: gitlab-rake geo:db:migrate'.freeze
REUSING_EXISTING_DATABASE_MESSAGE = 'If you are reusing an existing tracking database, make sure you have reset it.'.freeze
DATABASE_DOCS = 'doc/gitlab-geo/database.md'
TROUBLESHOOTING_DOCS = 'doc/gitlab-geo/troubleshooting.md'
WRONG_CONFIGURATION_MESSAGE = 'Check if you enabled the `geo_secondary_role` or `geo_postgresql` in the gitlab.rb config file.'
UNHEALTHY_CONNECTION_MESSAGE = 'Check the tracking database configuration as the connection could not be established'
NO_TABLES_MESSAGE = 'Run the tracking database migrations: gitlab-rake geo:db:migrate'
REUSING_EXISTING_DATABASE_MESSAGE = 'If you are reusing an existing tracking database, make sure you have reset it.'
def skip?
!Gitlab::Geo.secondary?
......
......@@ -5,8 +5,8 @@ module SystemCheck
class HttpConnectionCheck < SystemCheck::BaseCheck
set_name 'GitLab Geo HTTP(S) connectivity'
NOT_SECONDARY_NODE = 'not a secondary node'.freeze
GEO_NOT_ENABLED = 'Geo is not enabled'.freeze
NOT_SECONDARY_NODE = 'not a secondary node'
GEO_NOT_ENABLED = 'Geo is not enabled'
def skip?
unless Gitlab::Geo.enabled?
......
......@@ -23,7 +23,7 @@ module API
helpers ::API::Helpers::InternalHelpers
UNKNOWN_CHECK_RESULT_ERROR = 'Unknown check result'.freeze
UNKNOWN_CHECK_RESULT_ERROR = 'Unknown check result'
VALID_PAT_SCOPES = Set.new(
Gitlab::Auth::API_SCOPES + Gitlab::Auth::REPOSITORY_SCOPES + Gitlab::Auth::REGISTRY_SCOPES
......
......@@ -18,7 +18,7 @@ module API
# Used to differentiate Jira Cloud requests from Jira Server requests
# Jira Cloud user agent format: Jira DVCS Connector Vertigo/version
# Jira Server user agent format: Jira DVCS Connector/version
JIRA_DVCS_CLOUD_USER_AGENT = 'Jira DVCS Connector Vertigo'.freeze
JIRA_DVCS_CLOUD_USER_AGENT = 'Jira DVCS Connector Vertigo'
include PaginationParams
......
......@@ -3,7 +3,7 @@
module BulkImports
module Clients
class Http
API_VERSION = 'v4'.freeze
API_VERSION = 'v4'
DEFAULT_PAGE = 1.freeze
DEFAULT_PER_PAGE = 30.freeze
......
......@@ -14,7 +14,7 @@
# CsvBuilder.new(@posts, columns).render
#
class CsvBuilder
DEFAULT_ORDER_BY = 'id'.freeze
DEFAULT_ORDER_BY = 'id'
DEFAULT_BATCH_SIZE = 1000
PREFIX_REGEX = /^[=\+\-@;]/.freeze
......
......@@ -24,9 +24,9 @@ module Gitlab
PRIVATE_TOKEN_HEADER = 'HTTP_PRIVATE_TOKEN'
PRIVATE_TOKEN_PARAM = :private_token
JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN'.freeze
JOB_TOKEN_HEADER = 'HTTP_JOB_TOKEN'
JOB_TOKEN_PARAM = :job_token
DEPLOY_TOKEN_HEADER = 'HTTP_DEPLOY_TOKEN'.freeze
DEPLOY_TOKEN_HEADER = 'HTTP_DEPLOY_TOKEN'
RUNNER_TOKEN_PARAM = :token
RUNNER_JOB_TOKEN_PARAM = :token
......
......@@ -7,7 +7,7 @@
module Gitlab
class ConanToken
HMAC_KEY = 'gitlab-conan-packages'.freeze
HMAC_KEY = 'gitlab-conan-packages'
attr_reader :access_token_id, :user_id
......
......@@ -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
......
......@@ -3,7 +3,7 @@
module Gitlab
module Pages
VERSION = File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
INTERNAL_API_REQUEST_HEADER = 'Gitlab-Pages-Api-Request'.freeze
INTERNAL_API_REQUEST_HEADER = 'Gitlab-Pages-Api-Request'
MAX_SIZE = 1.terabyte
include JwtAuthenticatable
......
# frozen_string_literal: true
class LearnGitlab
PROJECT_NAME = 'Learn GitLab'.freeze
BOARD_NAME = 'GitLab onboarding'.freeze
LABEL_NAME = 'Novice'.freeze
PROJECT_NAME = 'Learn GitLab'
BOARD_NAME = 'GitLab onboarding'
LABEL_NAME = 'Novice'
def initialize(current_user)
@current_user = current_user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment