Commit 93c20177 authored by Stan Hu's avatar Stan Hu

Merge branch 'frozen-string-ee-lib-api' into 'master'

Enable some frozen string in ee/lib

See merge request gitlab-org/gitlab-ee!8930
parents d0a1e96a f514f9df
# frozen_string_literal: true
class ParentGroupsFinder class ParentGroupsFinder
attr_accessor :user, :group attr_accessor :user, :group
......
# frozen_string_literal: true
module EE module EE
module UserPreference module UserPreference
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
class GitlabSubscription < ActiveRecord::Base class GitlabSubscription < ActiveRecord::Base
belongs_to :namespace belongs_to :namespace
belongs_to :hosted_plan, class_name: 'Plan' belongs_to :hosted_plan, class_name: 'Plan'
......
# frozen_string_literal: true
module EE module EE
module Projects module Projects
module CleanupService module CleanupService
......
# frozen_string_literal: true
class UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker class UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
......
---
title: Enable some frozen string in ee/lib
merge_request:
author: gfyoung
type: performance
# frozen_string_literal: true
module API module API
class EpicIssues < Grape::API class EpicIssues < Grape::API
before do before do
......
# frozen_string_literal: true
module API module API
class Epics < Grape::API class Epics < Grape::API
before do before do
......
# frozen_string_literal: true
require 'base64' require 'base64'
module API module API
......
# frozen_string_literal: true
module API module API
class GeoNodes < Grape::API class GeoNodes < Grape::API
include PaginationParams include PaginationParams
......
# frozen_string_literal: true
# Simplified version of Github API entities. # Simplified version of Github API entities.
# It's mainly used to mimic Github API and integrate with Jira Development Panel. # It's mainly used to mimic Github API and integrate with Jira Development Panel.
# #
......
# frozen_string_literal: true
module API module API
class IssueLinks < Grape::API class IssueLinks < Grape::API
include PaginationParams include PaginationParams
......
# frozen_string_literal: true
module API module API
class Ldap < Grape::API class Ldap < Grape::API
# Admin users by default should be able to access these API endpoints. # Admin users by default should be able to access these API endpoints.
......
# frozen_string_literal: true
module API module API
class LdapGroupLinks < Grape::API class LdapGroupLinks < Grape::API
before { authenticate! } before { authenticate! }
......
# frozen_string_literal: true
module API module API
class License < Grape::API class License < Grape::API
before { authenticated_as_admin! } before { authenticated_as_admin! }
......
# frozen_string_literal: true
module API module API
class MergeRequestApprovals < ::Grape::API class MergeRequestApprovals < ::Grape::API
before { authenticate_non_get! } before { authenticate_non_get! }
......
# frozen_string_literal: true
module API module API
class ProjectApprovals < ::Grape::API class ProjectApprovals < ::Grape::API
before { authenticate! } before { authenticate! }
......
# frozen_string_literal: true
require_dependency 'declarative_policy' require_dependency 'declarative_policy'
module API module API
......
# frozen_string_literal: true
module API module API
class ProjectPushRule < Grape::API class ProjectPushRule < Grape::API
before { authenticate! } before { authenticate! }
......
# frozen_string_literal: true
module API module API
class Unleash < Grape::API class Unleash < Grape::API
include PaginationParams include PaginationParams
......
# frozen_string_literal: true
# These endpoints partially mimic Github API behavior in order to successfully # These endpoints partially mimic Github API behavior in order to successfully
# integrate with Jira Development Panel. # integrate with Jira Development Panel.
# Endpoints returning an empty list were temporarily added to avoid 404's # Endpoints returning an empty list were temporarily added to avoid 404's
......
# frozen_string_literal: true
module Audit module Audit
class Details class Details
ACTIONS = %i[add remove failed_login change custom_message].freeze ACTIONS = %i[add remove failed_login change custom_message].freeze
...@@ -39,10 +41,12 @@ module Audit ...@@ -39,10 +41,12 @@ module Audit
end end
def text_for_change(value) def text_for_change(value)
"Changed #{value}".tap do |changed_string| changed = ["Changed #{value}"]
changed_string << " from #{@details[:from]}" if @details[:from]
changed_string << " to #{@details[:to]}" if @details[:to] changed << "from #{@details[:from]}" if @details[:from]
end changed << "to #{@details[:to]}" if @details[:to]
changed.join(' ')
end end
end end
end end
# frozen_string_literal: true
module Banzai module Banzai
module Filter module Filter
# HTML filter that removes sensitive information from cross project # HTML filter that removes sensitive information from cross project
......
# frozen_string_literal: true
module Banzai module Banzai
module ReferenceParser module ReferenceParser
module EE module EE
......
# frozen_string_literal: true
# Generates CSV when given a collection and a mapping. # Generates CSV when given a collection and a mapping.
# #
# Example: # Example:
......
# frozen_string_literal: true
module Delay module Delay
# Progressive backoff. It's copied from Sidekiq as is # Progressive backoff. It's copied from Sidekiq as is
def delay(retry_count = 0) def delay(retry_count = 0)
......
# frozen_string_literal: true
module EE module EE
SUBSCRIPTIONS_URL = 'https://customers.gitlab.com'.freeze SUBSCRIPTIONS_URL = 'https://customers.gitlab.com'.freeze
SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans".freeze SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans".freeze
......
# frozen_string_literal: true
module EE module EE
module API module API
module APIGuard module APIGuard
......
# frozen_string_literal: true
module EE module EE
module API module API
class Boards < ::Grape::API class Boards < ::Grape::API
......
# frozen_string_literal: true
module EE module EE
module API module API
module BoardsResponses module BoardsResponses
......
# frozen_string_literal: true
module EE module EE
module API module API
module Entities module Entities
......
# frozen_string_literal: true
module EE module EE
module API module API
class GroupBoards < ::Grape::API class GroupBoards < ::Grape::API
......
# frozen_string_literal: true
module EE module EE
module API module API
module Helpers module Helpers
......
# frozen_string_literal: true
module EE module EE
module API module API
module Helpers module Helpers
......
# frozen_string_literal: true
module EE module EE
module API module API
module Helpers module Helpers
......
# frozen_string_literal: true
module EE module EE
module API module API
module Helpers module Helpers
......
# frozen_string_literal: true
module EE module EE
module API module API
module Issues module Issues
......
# frozen_string_literal: true
module EE module EE
module API module API
module JobArtifacts module JobArtifacts
......
# frozen_string_literal: true
module EE module EE
module API module API
module MergeRequests module MergeRequests
......
# frozen_string_literal: true
module EE module EE
module API module API
module Namespaces module Namespaces
......
# frozen_string_literal: true
module EE module EE
module API module API
module Todos module Todos
......
# frozen_string_literal: true
module EE module EE
module Audit module Audit
class BaseChangesAuditor class BaseChangesAuditor
......
# frozen_string_literal: true
module EE module EE
module Audit module Audit
module Changes module Changes
......
# frozen_string_literal: true
module EE module EE
module Audit module Audit
class GroupChangesAuditor < BaseChangesAuditor class GroupChangesAuditor < BaseChangesAuditor
......
# frozen_string_literal: true
module EE module EE
module Audit module Audit
class ProjectChangesAuditor < BaseChangesAuditor class ProjectChangesAuditor < BaseChangesAuditor
......
# frozen_string_literal: true
module EE module EE
module Banzai module Banzai
module Filter module Filter
......
# frozen_string_literal: true
module EE module EE
module Banzai module Banzai
module Pipeline module Pipeline
......
# frozen_string_literal: true
module EE module EE
module Banzai module Banzai
module Pipeline module Pipeline
......
# frozen_string_literal: true
module EE module EE
module Banzai module Banzai
module Pipeline module Pipeline
......
# frozen_string_literal: true
module EE module EE
module Banzai module Banzai
module ReferenceParser module ReferenceParser
......
# frozen_string_literal: true
# Gitlab::Access module # Gitlab::Access module
# #
# Define allowed roles that can be used # Define allowed roles that can be used
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
# LDAP connection adapter EE mixin # LDAP connection adapter EE mixin
# #
# This module is intended to encapsulate EE-specific adapter methods # This module is intended to encapsulate EE-specific adapter methods
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
require 'net/ldap/dn' require 'net/ldap/dn'
module EE module EE
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
require 'net/ldap/dn' require 'net/ldap/dn'
module EE module EE
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
# LDAP User EE mixin # LDAP User EE mixin
# #
# This module is intended to encapsulate EE-specific User methods # This module is intended to encapsulate EE-specific User methods
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
...@@ -18,7 +20,7 @@ module EE ...@@ -18,7 +20,7 @@ module EE
# does not normalize them as of version 0.3.0, so add the default # does not normalize them as of version 0.3.0, so add the default
# realm ourselves if appropriate # realm ourselves if appropriate
if provider == 'kerberos' && ee_uid.present? if provider == 'kerberos' && ee_uid.present?
ee_uid += "@#{kerberos_default_realm}" unless ee_uid.include?('@') ee_uid = "#{ee_uid}@#{kerberos_default_realm}" unless ee_uid.include?('@')
end end
ee_uid ee_uid
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Auth module Auth
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Ci module Ci
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Database module Database
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module EtagCaching module EtagCaching
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
......
# frozen_string_literal: true
Excon.defaults[:ssl_verify_peer] = false Excon.defaults[:ssl_verify_peer] = false
module EE module EE
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
class Logger < ::Gitlab::Logger class Logger < ::Gitlab::Logger
def self.log_access(access, project_path) def self.log_access(access, project_path)
status = access.has_access? ? "GRANTED" : "DENIED" status = access.has_access? ? "GRANTED" : "DENIED"
message = "#{status} #{access.user.email} access to '#{access.label}'" message = ["#{status} #{access.user.email} access to '#{access.label}'"]
message << " (#{project_path})" if project_path.present? message << "(#{project_path})" if project_path.present?
message << " - #{access.load_type} #{access.loaded_at}" if access.load_type == :cache message << "- #{access.load_type} #{access.loaded_at}" if access.load_type == :cache
info(message) info(message.join(' '))
end end
def self.file_name_noext def self.file_name_noext
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ExternalAuthorization module ExternalAuthorization
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module GeoGitAccess module GeoGitAccess
...@@ -50,7 +52,7 @@ module EE ...@@ -50,7 +52,7 @@ module EE
message = super message = super
if ::Gitlab::Geo.secondary_with_primary? if ::Gitlab::Geo.secondary_with_primary?
message += "\nPlease use the primary node URL instead: #{geo_primary_url_to_repo}.\nFor more information: #{GEO_SERVER_DOCS_URL}" message = "#{message}\nPlease use the primary node URL instead: #{geo_primary_url_to_repo}.\nFor more information: #{GEO_SERVER_DOCS_URL}"
end end
message message
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module GitAccess module GitAccess
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module GitAccessWiki module GitAccessWiki
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module GithubImport module GithubImport
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ImportExport module ImportExport
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ImportExport module ImportExport
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module ImportSources module ImportSources
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Middleware module Middleware
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module OmniauthInitializer module OmniauthInitializer
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Prometheus module Prometheus
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Prometheus module Prometheus
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Rack module Rack
......
# frozen_string_literal: true
module EE module EE
module Gitlab module Gitlab
module Regex module Regex
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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