Commit 12e0fee2 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'remove-unnecessary-freeze-in-app-services' into 'master'

Avoid calling freeze on already frozen strings in app/services

See merge request gitlab-org/gitlab-ce!32635
parents 6bed0918 ee1633e3
......@@ -2,7 +2,7 @@
module Auth
class ContainerRegistryAuthenticationService < BaseService
AUDIENCE = 'container_registry'.freeze
AUDIENCE = 'container_registry'
def execute(authentication_abilities:)
@authentication_abilities = authentication_abilities
......
# frozen_string_literal: true
class AutoMergeService < BaseService
STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS = 'merge_when_pipeline_succeeds'.freeze
STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS = 'merge_when_pipeline_succeeds'
STRATEGIES = [STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS].freeze
class << self
......
......@@ -2,7 +2,7 @@
module MergeRequests
class RebaseService < MergeRequests::WorkingCopyBaseService
REBASE_ERROR = 'Rebase failed. Please rebase locally'.freeze
REBASE_ERROR = 'Rebase failed. Please rebase locally'
def execute(merge_request)
@merge_request = merge_request
......
......@@ -6,7 +6,7 @@ module Projects
DestroyError = Class.new(StandardError)
DELETED_FLAG = '+deleted'.freeze
DELETED_FLAG = '+deleted'
REPO_REMOVAL_DELAY = 5.minutes.to_i
def async_execute
......
......@@ -5,7 +5,7 @@
module Projects
module LfsPointers
class LfsDownloadLinkListService < BaseService
DOWNLOAD_ACTION = 'download'.freeze
DOWNLOAD_ACTION = 'download'
DownloadLinksError = Class.new(StandardError)
DownloadLinkNotFound = Class.new(StandardError)
......
......@@ -4,7 +4,7 @@
module Projects
module LfsPointers
class LfsListService < BaseService
REV = 'HEAD'.freeze
REV = 'HEAD'
# Retrieve all lfs blob pointers and returns a hash
# with the structure { lfs_file_oid => lfs_file_size }
......
......@@ -8,9 +8,9 @@ module Projects
class LfsObjectDownloadListService < BaseService
include Gitlab::Utils::StrongMemoize
HEAD_REV = 'HEAD'.freeze
HEAD_REV = 'HEAD'
LFS_ENDPOINT_PATTERN = /^\t?url\s*=\s*(.+)$/.freeze
LFS_BATCH_API_ENDPOINT = '/info/lfs/objects/batch'.freeze
LFS_BATCH_API_ENDPOINT = '/info/lfs/objects/batch'
LfsObjectDownloadListError = Class.new(StandardError)
......
......@@ -7,8 +7,8 @@ module Projects
include Gitlab::Utils::StrongMemoize
# Cache keys used to store issues count
PUBLIC_COUNT_KEY = 'public_open_issues_count'.freeze
TOTAL_COUNT_KEY = 'total_open_issues_count'.freeze
PUBLIC_COUNT_KEY = 'public_open_issues_count'
TOTAL_COUNT_KEY = 'total_open_issues_count'
def initialize(project, user = nil)
@user = user
......
......@@ -7,11 +7,11 @@ module Projects
BLOCK_SIZE = 32.kilobytes
MAX_SIZE = 1.terabyte
PUBLIC_DIR = 'public'.freeze
PUBLIC_DIR = 'public'
# this has to be invalid group name,
# as it shares the namespace with groups
TMP_EXTRACT_PATH = '@pages.tmp'.freeze
TMP_EXTRACT_PATH = '@pages.tmp'
attr_reader :build
......
# frozen_string_literal: true
class SubmitUsagePingService
URL = 'https://version.gitlab.com/usage_data'.freeze
URL = 'https://version.gitlab.com/usage_data'
METRICS = %w[leader_issues instance_issues percentage_issues leader_notes instance_notes
percentage_notes leader_milestones instance_milestones percentage_milestones
......
......@@ -2,7 +2,7 @@
module Wikis
class CreateAttachmentService < Files::CreateService
ATTACHMENT_PATH = 'uploads'.freeze
ATTACHMENT_PATH = 'uploads'
MAX_FILENAME_LENGTH = 255
delegate :wiki, to: :project
......
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