Commit e60f0ece authored by Sean McGivern's avatar Sean McGivern

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

Remove unnecessary use of freeze

See merge request gitlab-org/gitlab!57057
parents ba21c0de 04d17db7
---
title: Remove unnecessary use of freeze
merge_request: 57057
author: Lee Tickett @leetickett
type: other
...@@ -12,7 +12,7 @@ module EE ...@@ -12,7 +12,7 @@ module EE
include ::Gitlab::Utils::StrongMemoize include ::Gitlab::Utils::StrongMemoize
include IgnorableColumns include IgnorableColumns
GIT_LFS_DOWNLOAD_OPERATION = 'download'.freeze GIT_LFS_DOWNLOAD_OPERATION = 'download'
prepended do prepended do
include Elastic::ProjectsSearch include Elastic::ProjectsSearch
......
...@@ -11,8 +11,8 @@ module EE ...@@ -11,8 +11,8 @@ module EE
include AuditorUserHelper include AuditorUserHelper
DEFAULT_ROADMAP_LAYOUT = 'months'.freeze DEFAULT_ROADMAP_LAYOUT = 'months'
DEFAULT_GROUP_VIEW = 'details'.freeze DEFAULT_GROUP_VIEW = 'details'
MAX_USERNAME_SUGGESTION_ATTEMPTS = 15 MAX_USERNAME_SUGGESTION_ATTEMPTS = 15
prepended do prepended do
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
class Geo::SecondaryUsageData < Geo::TrackingBase class Geo::SecondaryUsageData < Geo::TrackingBase
include Gitlab::Utils::UsageData include Gitlab::Utils::UsageData
GIT_FETCH_EVENT_COUNT_WEEKLY_QUERY = 'round(sum(increase(grpc_server_handled_total{grpc_method=~"SSHUploadPack|PostUploadPack"}[7d])))'.freeze GIT_FETCH_EVENT_COUNT_WEEKLY_QUERY = 'round(sum(increase(grpc_server_handled_total{grpc_method=~"SSHUploadPack|PostUploadPack"}[7d])))'
# Eventually, we'll find a way to auto-load this # Eventually, we'll find a way to auto-load this
# from the metric yaml files that include something # from the metric yaml files that include something
......
...@@ -6,7 +6,7 @@ module Geo ...@@ -6,7 +6,7 @@ module Geo
class TrackingBase < ApplicationRecord class TrackingBase < ApplicationRecord
self.abstract_class = true self.abstract_class = true
NOT_CONFIGURED_MSG = 'Geo secondary database is not configured'.freeze NOT_CONFIGURED_MSG = 'Geo secondary database is not configured'
SecondaryNotConfigured = Class.new(StandardError) SecondaryNotConfigured = Class.new(StandardError)
if ::Gitlab::Geo.geo_database_configured? if ::Gitlab::Geo.geo_database_configured?
......
...@@ -8,8 +8,8 @@ class ProtectedEnvironment::DeployAccessLevel < ApplicationRecord ...@@ -8,8 +8,8 @@ class ProtectedEnvironment::DeployAccessLevel < ApplicationRecord
].freeze ].freeze
HUMAN_ACCESS_LEVELS = { HUMAN_ACCESS_LEVELS = {
Gitlab::Access::MAINTAINER => 'Maintainers'.freeze, Gitlab::Access::MAINTAINER => 'Maintainers',
Gitlab::Access::DEVELOPER => 'Developers + Maintainers'.freeze Gitlab::Access::DEVELOPER => 'Developers + Maintainers'
}.freeze }.freeze
belongs_to :user belongs_to :user
......
...@@ -5,7 +5,7 @@ module Admin ...@@ -5,7 +5,7 @@ module Admin
include ExclusiveLeaseGuard include ExclusiveLeaseGuard
DEFAULT_LEASE_TIMEOUT = 10.minutes.to_i DEFAULT_LEASE_TIMEOUT = 10.minutes.to_i
LEASE_KEY = 'admin/email_service'.freeze LEASE_KEY = 'admin/email_service'
def initialize(recipients, subject, body) def initialize(recipients, subject, body)
@recipients, @subject, @body = recipients, subject, body @recipients, @subject, @body = recipients, subject, body
......
...@@ -4,8 +4,8 @@ module EE ...@@ -4,8 +4,8 @@ module EE
module AutoMergeService module AutoMergeService
extend ActiveSupport::Concern extend ActiveSupport::Concern
STRATEGY_MERGE_TRAIN = 'merge_train'.freeze STRATEGY_MERGE_TRAIN = 'merge_train'
STRATEGY_ADD_TO_MERGE_TRAIN_WHEN_PIPELINE_SUCCEEDS = 'add_to_merge_train_when_pipeline_succeeds'.freeze STRATEGY_ADD_TO_MERGE_TRAIN_WHEN_PIPELINE_SUCCEEDS = 'add_to_merge_train_when_pipeline_succeeds'
EE_STRATEGIES = [STRATEGY_MERGE_TRAIN, STRATEGY_ADD_TO_MERGE_TRAIN_WHEN_PIPELINE_SUCCEEDS].freeze EE_STRATEGIES = [STRATEGY_MERGE_TRAIN, STRATEGY_ADD_TO_MERGE_TRAIN_WHEN_PIPELINE_SUCCEEDS].freeze
class_methods do class_methods do
......
...@@ -6,7 +6,7 @@ module Geo ...@@ -6,7 +6,7 @@ module Geo
include Gitlab::Geo::LogHelpers include Gitlab::Geo::LogHelpers
LEASE_TIMEOUT = 1.hour.freeze LEASE_TIMEOUT = 1.hour.freeze
LEASE_KEY_PREFIX = 'object_pool:create'.freeze LEASE_KEY_PREFIX = 'object_pool:create'
attr_reader :pool_repository attr_reader :pool_repository
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
module Geo module Geo
class MetricsUpdateService class MetricsUpdateService
METRIC_PREFIX = 'geo_'.freeze METRIC_PREFIX = 'geo_'
def execute def execute
return unless Gitlab::Geo.enabled? return unless Gitlab::Geo.enabled?
......
...@@ -4,7 +4,7 @@ module Projects ...@@ -4,7 +4,7 @@ module Projects
class SlackApplicationInstallService < BaseService class SlackApplicationInstallService < BaseService
include Gitlab::Routing include Gitlab::Routing
SLACK_EXCHANGE_TOKEN_URL = 'https://slack.com/api/oauth.access'.freeze SLACK_EXCHANGE_TOKEN_URL = 'https://slack.com/api/oauth.access'
def execute def execute
slack_data = exchange_slack_token slack_data = exchange_slack_token
......
...@@ -8,7 +8,7 @@ class UpdateAllMirrorsWorker # rubocop:disable Scalability/IdempotentWorker ...@@ -8,7 +8,7 @@ class UpdateAllMirrorsWorker # rubocop:disable Scalability/IdempotentWorker
LEASE_TIMEOUT = 5.minutes LEASE_TIMEOUT = 5.minutes
SCHEDULE_WAIT_TIMEOUT = 4.minutes SCHEDULE_WAIT_TIMEOUT = 4.minutes
LEASE_KEY = 'update_all_mirrors'.freeze LEASE_KEY = 'update_all_mirrors'
RESCHEDULE_WAIT = 1.second RESCHEDULE_WAIT = 1.second
def perform def perform
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
module EE module EE
SUBSCRIPTIONS_URL = ::Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL SUBSCRIPTIONS_URL = ::Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL
SUBSCRIPTIONS_COMPARISON_URL = "https://about.gitlab.com/pricing/gitlab-com/feature-comparison".freeze SUBSCRIPTIONS_COMPARISON_URL = "https://about.gitlab.com/pricing/gitlab-com/feature-comparison"
SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql".freeze SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql"
SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes".freeze SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes"
SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage".freeze SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage"
SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans".freeze SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans"
SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_EMAIL', 'gl_com_api@gitlab.com') SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_EMAIL', 'gl_com_api@gitlab.com')
SUBSCRIPTION_PORTAL_ADMIN_TOKEN = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_TOKEN', 'customer_admin_token') SUBSCRIPTION_PORTAL_ADMIN_TOKEN = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_TOKEN', 'customer_admin_token')
CUSTOMER_SUPPORT_URL = 'https://support.gitlab.com'.freeze CUSTOMER_SUPPORT_URL = 'https://support.gitlab.com'
CUSTOMER_LICENSE_SUPPORT_URL = 'https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=360000071293'.freeze CUSTOMER_LICENSE_SUPPORT_URL = 'https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=360000071293'
end end
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
module EE module EE
module Banzai module Banzai
module IssuableExtractor module IssuableExtractor
EPIC_REFERENCE_TYPE = '@data-reference-type="epic"'.freeze EPIC_REFERENCE_TYPE = '@data-reference-type="epic"'
VULNERABILITY_REFERENCE_TYPE = '@data-reference-type="vulnerability"'.freeze VULNERABILITY_REFERENCE_TYPE = '@data-reference-type="vulnerability"'
private private
......
...@@ -8,7 +8,7 @@ module EE ...@@ -8,7 +8,7 @@ module EE
include GrapePathHelpers::NamedRouteMatcher include GrapePathHelpers::NamedRouteMatcher
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
GEO_SERVER_DOCS_URL = 'https://docs.gitlab.com/ee/administration/geo/replication/using_a_geo_server.html'.freeze GEO_SERVER_DOCS_URL = 'https://docs.gitlab.com/ee/administration/geo/replication/using_a_geo_server.html'
private private
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module Auth module Auth
module GroupSaml module GroupSaml
class ResponseStore class ResponseStore
STORAGE_KEY = 'last_saml_debug_response'.freeze STORAGE_KEY = 'last_saml_debug_response'
REDIS_EXPIRY_TIME = 5.minutes REDIS_EXPIRY_TIME = 5.minutes
attr_reader :session_id attr_reader :session_id
......
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
module Security module Security
module Formatters module Formatters
class Dast class Dast
FORMAT_VERSION = '2.0'.freeze FORMAT_VERSION = '2.0'
def initialize(report) def initialize(report)
@report = report @report = report
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
# API calls are handled separately as different API endpoints need to # API calls are handled separately as different API endpoints need to
# stick based on different objects. # stick based on different objects.
class RackMiddleware class RackMiddleware
STICK_OBJECT = 'load_balancing.stick_object'.freeze STICK_OBJECT = 'load_balancing.stick_object'
# Unsticks or continues sticking the current request. # Unsticks or continues sticking the current request.
# #
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Geo module Geo
class BaseRequest class BaseRequest
GITLAB_GEO_AUTH_TOKEN_TYPE = 'GL-Geo'.freeze GITLAB_GEO_AUTH_TOKEN_TYPE = 'GL-Geo'
attr_reader :request_data attr_reader :request_data
......
...@@ -26,8 +26,8 @@ module Gitlab ...@@ -26,8 +26,8 @@ module Gitlab
GEO_JOBS = (COMMON_JOBS + PRIMARY_JOBS + SECONDARY_JOBS).freeze GEO_JOBS = (COMMON_JOBS + PRIMARY_JOBS + SECONDARY_JOBS).freeze
CONFIG_WATCHER = 'geo_sidekiq_cron_config_worker'.freeze CONFIG_WATCHER = 'geo_sidekiq_cron_config_worker'
CONFIG_WATCHER_CLASS = 'Geo::SidekiqCronConfigWorker'.freeze CONFIG_WATCHER_CLASS = 'Geo::SidekiqCronConfigWorker'
def execute def execute
return unless Geo.connected? return unless Geo.connected?
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
module Gitlab module Gitlab
module Mirror module Mirror
# Runs scheduler every minute # Runs scheduler every minute
SCHEDULER_CRON = '* * * * *'.freeze SCHEDULER_CRON = '* * * * *'
PULL_CAPACITY_KEY = 'MIRROR_PULL_CAPACITY'.freeze PULL_CAPACITY_KEY = 'MIRROR_PULL_CAPACITY'
JITTER = 1.minute JITTER = 1.minute
# TODO: Dynamically determine mirror update interval based on total number # TODO: Dynamically determine mirror update interval based on total number
......
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