Commit ce053017 authored by Sean McGivern's avatar Sean McGivern

Merge branch '31343-remove-unnecessary-use-of-freeze3' into 'master'

Remove unnecessary use of freeze

See merge request gitlab-org/gitlab!57058
parents 12613bc1 16a6cd9d
---
title: Remove unnecessary use of freeze
merge_request: 57058
author: Lee Tickett @leetickett
type: other
...@@ -5,9 +5,9 @@ module Gitlab ...@@ -5,9 +5,9 @@ module Gitlab
module DatabaseTasks module DatabaseTasks
extend self extend self
DATABASE_CONFIG = 'config/database.yml'.freeze DATABASE_CONFIG = 'config/database.yml'
GEO_DATABASE_CONFIG = 'config/database_geo.yml'.freeze GEO_DATABASE_CONFIG = 'config/database_geo.yml'
GEO_DB_DIR = 'ee/db/geo'.freeze GEO_DB_DIR = 'ee/db/geo'
def method_missing(method_name, *args, &block) def method_missing(method_name, *args, &block)
with_geo_db do with_geo_db do
......
...@@ -8,7 +8,7 @@ module Gitlab ...@@ -8,7 +8,7 @@ module Gitlab
attr_accessor :previous_id 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_GRACE_PERIOD = 10.minutes
GAP_OUTDATED_PERIOD = 1.hour GAP_OUTDATED_PERIOD = 1.hour
......
...@@ -5,11 +5,11 @@ module Gitlab ...@@ -5,11 +5,11 @@ module Gitlab
class GitSSHProxy class GitSSHProxy
HTTP_READ_TIMEOUT = 60 HTTP_READ_TIMEOUT = 60
UPLOAD_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-upload-pack-request'.freeze UPLOAD_PACK_REQUEST_CONTENT_TYPE = 'application/x-git-upload-pack-request'
UPLOAD_PACK_RESULT_CONTENT_TYPE = 'application/x-git-upload-pack-result'.freeze 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_REQUEST_CONTENT_TYPE = 'application/x-git-receive-pack-request'
RECEIVE_PACK_RESULT_CONTENT_TYPE = 'application/x-git-receive-pack-result'.freeze RECEIVE_PACK_RESULT_CONTENT_TYPE = 'application/x-git-receive-pack-result'
MustBeASecondaryNode = Class.new(StandardError) MustBeASecondaryNode = Class.new(StandardError)
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module Geo module Geo
module LogCursor module LogCursor
class Daemon class Daemon
VERSION = '0.2.0'.freeze VERSION = '0.2.0'
BATCH_SIZE = 250 BATCH_SIZE = 250
SECONDARY_CHECK_INTERVAL = 60 SECONDARY_CHECK_INTERVAL = 60
MAX_ERROR_DURATION = 1800 MAX_ERROR_DURATION = 1800
......
...@@ -4,9 +4,9 @@ module Gitlab ...@@ -4,9 +4,9 @@ module Gitlab
module Geo module Geo
module LogCursor module LogCursor
module Lease module Lease
NAMESPACE = 'geo:gitlab'.freeze NAMESPACE = 'geo:gitlab'
LEASE_TIMEOUT = 30.seconds.freeze LEASE_TIMEOUT = 30.seconds.freeze
LEASE_KEY = 'geo_log_cursor_processed'.freeze LEASE_KEY = 'geo_log_cursor_processed'
def self.exclusive_lease def self.exclusive_lease
@lease ||= Gitlab::ExclusiveLease.new(LEASE_KEY, timeout: LEASE_TIMEOUT) @lease ||= Gitlab::ExclusiveLease.new(LEASE_KEY, timeout: LEASE_TIMEOUT)
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module Geo module Geo
module Replication module Replication
USER_UPLOADS_OBJECT_TYPES = %i[attachment avatar file import_export namespace_file personal_file favicon design_management/design_v432x230].freeze 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) def self.object_type_from_user_uploads?(object_type)
USER_UPLOADS_OBJECT_TYPES.include?(object_type.to_sym) USER_UPLOADS_OBJECT_TYPES.include?(object_type.to_sym)
......
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
class << self class << self
include Gitlab::Routing include Gitlab::Routing
GITLAB_ORG_NAMESPACE = 'gitlab-org'.freeze GITLAB_ORG_NAMESPACE = 'gitlab-org'
def execute def execute
unless Gitlab.com? unless Gitlab.com?
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module SPDX module SPDX
class CatalogueGateway 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 OFFLINE_CATALOGUE = Rails.root.join('vendor/spdx.json').freeze
def fetch def fetch
......
...@@ -5,7 +5,7 @@ module SystemCheck ...@@ -5,7 +5,7 @@ module SystemCheck
class AuthorizedKeysCheck < ::SystemCheck::BaseCheck class AuthorizedKeysCheck < ::SystemCheck::BaseCheck
set_name 'OpenSSH configured to use AuthorizedKeysCommand' 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{ OPENSSH_AUTHORIZED_KEYS_CMD_REGEXP = %r{
^AuthorizedKeysCommand # line starts with ^AuthorizedKeysCommand # line starts with
\s+ # one space or more \s+ # one space or more
...@@ -24,7 +24,7 @@ module SystemCheck ...@@ -24,7 +24,7 @@ module SystemCheck
\s* # optional any amount of space character \s* # optional any amount of space character
(?:\#.*)?$ # optional start-comment symbol followed by optionally any character until end of line (?:\#.*)?$ # optional start-comment symbol followed by optionally any character until end of line
}x.freeze }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 def multi_check
unless openssh_config_exists? unless openssh_config_exists?
......
...@@ -6,12 +6,12 @@ module SystemCheck ...@@ -6,12 +6,12 @@ module SystemCheck
set_name 'GitLab Geo secondary database is correctly configured' set_name 'GitLab Geo secondary database is correctly configured'
set_skip_reason 'not a secondary node' set_skip_reason 'not a secondary node'
DATABASE_DOCS = 'doc/gitlab-geo/database.md'.freeze DATABASE_DOCS = 'doc/gitlab-geo/database.md'
TROUBLESHOOTING_DOCS = 'doc/gitlab-geo/troubleshooting.md'.freeze 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.'.freeze 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'.freeze 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'.freeze 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.'.freeze REUSING_EXISTING_DATABASE_MESSAGE = 'If you are reusing an existing tracking database, make sure you have reset it.'
def skip? def skip?
!Gitlab::Geo.secondary? !Gitlab::Geo.secondary?
......
...@@ -5,8 +5,8 @@ module SystemCheck ...@@ -5,8 +5,8 @@ module SystemCheck
class HttpConnectionCheck < SystemCheck::BaseCheck class HttpConnectionCheck < SystemCheck::BaseCheck
set_name 'GitLab Geo HTTP(S) connectivity' set_name 'GitLab Geo HTTP(S) connectivity'
NOT_SECONDARY_NODE = 'not a secondary node'.freeze NOT_SECONDARY_NODE = 'not a secondary node'
GEO_NOT_ENABLED = 'Geo is not enabled'.freeze GEO_NOT_ENABLED = 'Geo is not enabled'
def skip? def skip?
unless Gitlab::Geo.enabled? unless Gitlab::Geo.enabled?
......
...@@ -23,7 +23,7 @@ module API ...@@ -23,7 +23,7 @@ module API
helpers ::API::Helpers::InternalHelpers helpers ::API::Helpers::InternalHelpers
UNKNOWN_CHECK_RESULT_ERROR = 'Unknown check result'.freeze UNKNOWN_CHECK_RESULT_ERROR = 'Unknown check result'
VALID_PAT_SCOPES = Set.new( VALID_PAT_SCOPES = Set.new(
Gitlab::Auth::API_SCOPES + Gitlab::Auth::REPOSITORY_SCOPES + Gitlab::Auth::REGISTRY_SCOPES Gitlab::Auth::API_SCOPES + Gitlab::Auth::REPOSITORY_SCOPES + Gitlab::Auth::REGISTRY_SCOPES
......
...@@ -18,7 +18,7 @@ module API ...@@ -18,7 +18,7 @@ module API
# Used to differentiate Jira Cloud requests from Jira Server requests # Used to differentiate Jira Cloud requests from Jira Server requests
# Jira Cloud user agent format: Jira DVCS Connector Vertigo/version # Jira Cloud user agent format: Jira DVCS Connector Vertigo/version
# Jira Server user agent format: Jira DVCS Connector/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 include PaginationParams
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module BulkImports module BulkImports
module Clients module Clients
class Http class Http
API_VERSION = 'v4'.freeze API_VERSION = 'v4'
DEFAULT_PAGE = 1.freeze DEFAULT_PAGE = 1.freeze
DEFAULT_PER_PAGE = 30.freeze DEFAULT_PER_PAGE = 30.freeze
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# CsvBuilder.new(@posts, columns).render # CsvBuilder.new(@posts, columns).render
# #
class CsvBuilder class CsvBuilder
DEFAULT_ORDER_BY = 'id'.freeze DEFAULT_ORDER_BY = 'id'
DEFAULT_BATCH_SIZE = 1000 DEFAULT_BATCH_SIZE = 1000
PREFIX_REGEX = /^[=\+\-@;]/.freeze PREFIX_REGEX = /^[=\+\-@;]/.freeze
......
...@@ -24,9 +24,9 @@ module Gitlab ...@@ -24,9 +24,9 @@ module Gitlab
PRIVATE_TOKEN_HEADER = 'HTTP_PRIVATE_TOKEN' PRIVATE_TOKEN_HEADER = 'HTTP_PRIVATE_TOKEN'
PRIVATE_TOKEN_PARAM = :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 JOB_TOKEN_PARAM = :job_token
DEPLOY_TOKEN_HEADER = 'HTTP_DEPLOY_TOKEN'.freeze DEPLOY_TOKEN_HEADER = 'HTTP_DEPLOY_TOKEN'
RUNNER_TOKEN_PARAM = :token RUNNER_TOKEN_PARAM = :token
RUNNER_JOB_TOKEN_PARAM = :token RUNNER_JOB_TOKEN_PARAM = :token
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
module Gitlab module Gitlab
class ConanToken class ConanToken
HMAC_KEY = 'gitlab-conan-packages'.freeze HMAC_KEY = 'gitlab-conan-packages'
attr_reader :access_token_id, :user_id attr_reader :access_token_id, :user_id
......
...@@ -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
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Pages module Pages
VERSION = File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze 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 MAX_SIZE = 1.terabyte
include JwtAuthenticatable include JwtAuthenticatable
......
# frozen_string_literal: true # frozen_string_literal: true
class LearnGitlab class LearnGitlab
PROJECT_NAME = 'Learn GitLab'.freeze PROJECT_NAME = 'Learn GitLab'
BOARD_NAME = 'GitLab onboarding'.freeze BOARD_NAME = 'GitLab onboarding'
LABEL_NAME = 'Novice'.freeze LABEL_NAME = 'Novice'
def initialize(current_user) def initialize(current_user)
@current_user = 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