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
include ::Gitlab::Utils::StrongMemoize
include IgnorableColumns
GIT_LFS_DOWNLOAD_OPERATION = 'download'.freeze
GIT_LFS_DOWNLOAD_OPERATION = 'download'
prepended do
include Elastic::ProjectsSearch
......
......@@ -11,8 +11,8 @@ module EE
include AuditorUserHelper
DEFAULT_ROADMAP_LAYOUT = 'months'.freeze
DEFAULT_GROUP_VIEW = 'details'.freeze
DEFAULT_ROADMAP_LAYOUT = 'months'
DEFAULT_GROUP_VIEW = 'details'
MAX_USERNAME_SUGGESTION_ATTEMPTS = 15
prepended do
......
......@@ -5,7 +5,7 @@
class Geo::SecondaryUsageData < Geo::TrackingBase
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
# from the metric yaml files that include something
......
......@@ -6,7 +6,7 @@ module Geo
class TrackingBase < ApplicationRecord
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)
if ::Gitlab::Geo.geo_database_configured?
......
......@@ -8,8 +8,8 @@ class ProtectedEnvironment::DeployAccessLevel < ApplicationRecord
].freeze
HUMAN_ACCESS_LEVELS = {
Gitlab::Access::MAINTAINER => 'Maintainers'.freeze,
Gitlab::Access::DEVELOPER => 'Developers + Maintainers'.freeze
Gitlab::Access::MAINTAINER => 'Maintainers',
Gitlab::Access::DEVELOPER => 'Developers + Maintainers'
}.freeze
belongs_to :user
......
......@@ -5,7 +5,7 @@ module Admin
include ExclusiveLeaseGuard
DEFAULT_LEASE_TIMEOUT = 10.minutes.to_i
LEASE_KEY = 'admin/email_service'.freeze
LEASE_KEY = 'admin/email_service'
def initialize(recipients, subject, body)
@recipients, @subject, @body = recipients, subject, body
......
......@@ -4,8 +4,8 @@ module EE
module AutoMergeService
extend ActiveSupport::Concern
STRATEGY_MERGE_TRAIN = 'merge_train'.freeze
STRATEGY_ADD_TO_MERGE_TRAIN_WHEN_PIPELINE_SUCCEEDS = 'add_to_merge_train_when_pipeline_succeeds'.freeze
STRATEGY_MERGE_TRAIN = 'merge_train'
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
class_methods do
......
......@@ -6,7 +6,7 @@ module Geo
include Gitlab::Geo::LogHelpers
LEASE_TIMEOUT = 1.hour.freeze
LEASE_KEY_PREFIX = 'object_pool:create'.freeze
LEASE_KEY_PREFIX = 'object_pool:create'
attr_reader :pool_repository
......
......@@ -2,7 +2,7 @@
module Geo
class MetricsUpdateService
METRIC_PREFIX = 'geo_'.freeze
METRIC_PREFIX = 'geo_'
def execute
return unless Gitlab::Geo.enabled?
......
......@@ -4,7 +4,7 @@ module Projects
class SlackApplicationInstallService < BaseService
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
slack_data = exchange_slack_token
......
......@@ -8,7 +8,7 @@ class UpdateAllMirrorsWorker # rubocop:disable Scalability/IdempotentWorker
LEASE_TIMEOUT = 5.minutes
SCHEDULE_WAIT_TIMEOUT = 4.minutes
LEASE_KEY = 'update_all_mirrors'.freeze
LEASE_KEY = 'update_all_mirrors'
RESCHEDULE_WAIT = 1.second
def perform
......
......@@ -2,13 +2,13 @@
module EE
SUBSCRIPTIONS_URL = ::Gitlab::SubscriptionPortal::SUBSCRIPTIONS_URL
SUBSCRIPTIONS_COMPARISON_URL = "https://about.gitlab.com/pricing/gitlab-com/feature-comparison".freeze
SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql".freeze
SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes".freeze
SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage".freeze
SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans".freeze
SUBSCRIPTIONS_COMPARISON_URL = "https://about.gitlab.com/pricing/gitlab-com/feature-comparison"
SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql"
SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes"
SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage"
SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans"
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')
CUSTOMER_SUPPORT_URL = 'https://support.gitlab.com'.freeze
CUSTOMER_LICENSE_SUPPORT_URL = 'https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=360000071293'.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'
end
......@@ -3,8 +3,8 @@
module EE
module Banzai
module IssuableExtractor
EPIC_REFERENCE_TYPE = '@data-reference-type="epic"'.freeze
VULNERABILITY_REFERENCE_TYPE = '@data-reference-type="vulnerability"'.freeze
EPIC_REFERENCE_TYPE = '@data-reference-type="epic"'
VULNERABILITY_REFERENCE_TYPE = '@data-reference-type="vulnerability"'
private
......
......@@ -8,7 +8,7 @@ module EE
include GrapePathHelpers::NamedRouteMatcher
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
......
......@@ -4,7 +4,7 @@ module Gitlab
module Auth
module GroupSaml
class ResponseStore
STORAGE_KEY = 'last_saml_debug_response'.freeze
STORAGE_KEY = 'last_saml_debug_response'
REDIS_EXPIRY_TIME = 5.minutes
attr_reader :session_id
......
......@@ -6,7 +6,7 @@ module Gitlab
module Security
module Formatters
class Dast
FORMAT_VERSION = '2.0'.freeze
FORMAT_VERSION = '2.0'
def initialize(report)
@report = report
......
......@@ -7,7 +7,7 @@ module Gitlab
# API calls are handled separately as different API endpoints need to
# stick based on different objects.
class RackMiddleware
STICK_OBJECT = 'load_balancing.stick_object'.freeze
STICK_OBJECT = 'load_balancing.stick_object'
# Unsticks or continues sticking the current request.
#
......
......@@ -3,7 +3,7 @@
module Gitlab
module Geo
class BaseRequest
GITLAB_GEO_AUTH_TOKEN_TYPE = 'GL-Geo'.freeze
GITLAB_GEO_AUTH_TOKEN_TYPE = 'GL-Geo'
attr_reader :request_data
......
......@@ -26,8 +26,8 @@ module Gitlab
GEO_JOBS = (COMMON_JOBS + PRIMARY_JOBS + SECONDARY_JOBS).freeze
CONFIG_WATCHER = 'geo_sidekiq_cron_config_worker'.freeze
CONFIG_WATCHER_CLASS = 'Geo::SidekiqCronConfigWorker'.freeze
CONFIG_WATCHER = 'geo_sidekiq_cron_config_worker'
CONFIG_WATCHER_CLASS = 'Geo::SidekiqCronConfigWorker'
def execute
return unless Geo.connected?
......
......@@ -3,8 +3,8 @@
module Gitlab
module Mirror
# Runs scheduler every minute
SCHEDULER_CRON = '* * * * *'.freeze
PULL_CAPACITY_KEY = 'MIRROR_PULL_CAPACITY'.freeze
SCHEDULER_CRON = '* * * * *'
PULL_CAPACITY_KEY = 'MIRROR_PULL_CAPACITY'
JITTER = 1.minute
# 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