Skip to content
Snippets Groups Projects
Unverified Commit 5172aa57 authored by Madelein van Niekerk's avatar Madelein van Niekerk
Browse files

Merge branch 'tl-percent-literal-delimiters-models-b-to-e' into 'master'

parents a030dc7c 3a6b247c
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 87 deletions
Loading
Loading
@@ -2,53 +2,6 @@
# Cop supports --autocorrect.
Style/PercentLiteralDelimiters:
Exclude:
- 'app/models/bulk_imports/file_transfer/group_config.rb'
- 'app/models/bulk_imports/file_transfer/project_config.rb'
- 'app/models/ci/build.rb'
- 'app/models/ci/build_runner_session.rb'
- 'app/models/ci/pipeline.rb'
- 'app/models/clusters/platforms/kubernetes.rb'
- 'app/models/commit.rb'
- 'app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb'
- 'app/models/concerns/diff_positionable_note.rb'
- 'app/models/concerns/enums/prometheus_metric.rb'
- 'app/models/concerns/issuable.rb'
- 'app/models/concerns/issue_available_features.rb'
- 'app/models/concerns/mentionable/reference_regexes.rb'
- 'app/models/concerns/noteable.rb'
- 'app/models/concerns/resolvable_note.rb'
- 'app/models/concerns/with_uploads.rb'
- 'app/models/container_registry/event.rb'
- 'app/models/deploy_token.rb'
- 'app/models/description_version.rb'
- 'app/models/design_management.rb'
- 'app/models/diff_note.rb'
- 'app/models/discussion_note.rb'
- 'app/models/draft_note.rb'
- 'app/models/environment.rb'
- 'app/models/event.rb'
- 'app/models/instance_configuration.rb'
- 'app/models/integrations/asana.rb'
- 'app/models/integrations/assembla.rb'
- 'app/models/integrations/base_issue_tracker.rb'
- 'app/models/integrations/base_monitoring.rb'
- 'app/models/integrations/base_slash_commands.rb'
- 'app/models/integrations/base_third_party_wiki.rb'
- 'app/models/integrations/buildkite.rb'
- 'app/models/integrations/campfire.rb'
- 'app/models/integrations/datadog.rb'
- 'app/models/integrations/drone_ci.rb'
- 'app/models/integrations/emails_on_push.rb'
- 'app/models/integrations/external_wiki.rb'
- 'app/models/integrations/jenkins.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/packagist.rb'
- 'app/models/integrations/pivotaltracker.rb'
- 'app/models/integrations/pushover.rb'
- 'app/models/integrations/teamcity.rb'
- 'app/models/integrations/zentao.rb'
- 'app/models/issuable_severity.rb'
- 'app/models/issue.rb'
- 'app/models/lfs_download_object.rb'
- 'app/models/namespace.rb'
- 'app/models/namespace/root_storage_statistics.rb'
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
module BulkImports
module FileTransfer
class GroupConfig < BaseConfig
SKIPPED_RELATIONS = %w(members).freeze
SKIPPED_RELATIONS = %w[members].freeze
 
def import_export_yaml
::Gitlab::ImportExport.group_config_file
Loading
Loading
Loading
Loading
@@ -3,10 +3,10 @@
module BulkImports
module FileTransfer
class ProjectConfig < BaseConfig
SKIPPED_RELATIONS = %w(
SKIPPED_RELATIONS = %w[
project_members
group_members
).freeze
].freeze
 
LFS_OBJECTS_RELATION = 'lfs_objects'
REPOSITORY_BUNDLE_RELATION = 'repository'
Loading
Loading
Loading
Loading
@@ -165,7 +165,7 @@ class Build < Ci::Processable
scope :with_live_trace, -> { where('EXISTS (?)', Ci::BuildTraceChunk.where("#{quoted_table_name}.id = #{Ci::BuildTraceChunk.quoted_table_name}.build_id").select(1)) }
scope :with_stale_live_trace, -> { with_live_trace.finished_before(12.hours.ago) }
scope :finished_before, -> (date) { finished.where('finished_at < ?', date) }
scope :license_management_jobs, -> { where(name: %i(license_management license_scanning)) } # handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
scope :license_management_jobs, -> { where(name: %i[license_management license_scanning]) } # handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
# WARNING: This scope could lead to performance implications for large size of tables `ci_builds` and ci_runners`.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123131
scope :with_runner_type, -> (runner_type) { joins(:runner).where(runner: { runner_type: runner_type }) }
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ class BuildRunnerSession < Ci::ApplicationRecord
partitionable scope: :build
 
validates :build, presence: true
validates :url, public_url: { schemes: %w(https) }
validates :url, public_url: { schemes: %w[https] }
 
def terminal_specification
wss_url = Gitlab::UrlHelpers.as_wss(Addressable::URI.escape(url))
Loading
Loading
Loading
Loading
@@ -162,7 +162,7 @@ class Pipeline < Ci::ApplicationRecord
 
validates :status, presence: { unless: :importing? }
validate :valid_commit_sha, unless: :importing?
validates :source, exclusion: { in: %w(unknown), unless: :importing? }, on: :create
validates :source, exclusion: { in: %w[unknown], unless: :importing? }, on: :create
 
after_create :keep_around_commits, unless: :importing?
after_find :observe_age_in_minutes, unless: :importing?
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ class Kubernetes < ApplicationRecord
include ReactiveCaching
include NullifyIfBlank
 
RESERVED_NAMESPACES = %w(gitlab-managed-apps).freeze
RESERVED_NAMESPACES = %w[gitlab-managed-apps].freeze
REQUIRED_K8S_MIN_VERSION = 23
 
IGNORED_CONNECTION_EXCEPTIONS = [
Loading
Loading
Loading
Loading
@@ -432,7 +432,7 @@ def cherry_pick_description(user)
end
 
def cherry_pick_message(user)
%{#{message}\n\n#{cherry_pick_description(user)}}
%(#{message}\n\n#{cherry_pick_description(user)})
end
 
def revert_description(user)
Loading
Loading
@@ -444,7 +444,7 @@ def revert_description(user)
end
 
def revert_message(user)
%{Revert "#{title.strip}"\n\n#{revert_description(user)}}
%(Revert "#{title.strip}"\n\n#{revert_description(user)})
end
 
def reverts_commit?(commit, user)
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@ module ConfigScopes
 
class_methods do
def available_ci_access_fields(_project)
%w(agent)
%w[agent]
end
end
end
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ module DiffPositionableNote
validates :position, json_schema: { filename: "position", hash_conversion: true }
end
 
%i(original_position position change_position).each do |meth|
%i[original_position position change_position].each do |meth|
define_method "#{meth}=" do |new_position|
if new_position.is_a?(String)
new_position = begin
Loading
Loading
Loading
Loading
@@ -30,37 +30,37 @@ def self.group_details
# built-in groups
nginx_ingress_vts: {
group_title: _('Response metrics (NGINX Ingress VTS)'),
required_metrics: %w(nginx_upstream_responses_total nginx_upstream_response_msecs_avg),
required_metrics: %w[nginx_upstream_responses_total nginx_upstream_response_msecs_avg],
priority: 10
}.freeze,
nginx_ingress: {
group_title: _('Response metrics (NGINX Ingress)'),
required_metrics: %w(nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum),
required_metrics: %w[nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum],
priority: 10
}.freeze,
ha_proxy: {
group_title: _('Response metrics (HA Proxy)'),
required_metrics: %w(haproxy_frontend_http_requests_total haproxy_frontend_http_responses_total),
required_metrics: %w[haproxy_frontend_http_requests_total haproxy_frontend_http_responses_total],
priority: 10
}.freeze,
aws_elb: {
group_title: _('Response metrics (AWS ELB)'),
required_metrics: %w(aws_elb_request_count_sum aws_elb_latency_average aws_elb_httpcode_backend_5_xx_sum),
required_metrics: %w[aws_elb_request_count_sum aws_elb_latency_average aws_elb_httpcode_backend_5_xx_sum],
priority: 10
}.freeze,
nginx: {
group_title: _('Response metrics (NGINX)'),
required_metrics: %w(nginx_server_requests nginx_server_requestMsec),
required_metrics: %w[nginx_server_requests nginx_server_requestMsec],
priority: 10
}.freeze,
kubernetes: {
group_title: _('System metrics (Kubernetes)'),
required_metrics: %w(container_memory_usage_bytes container_cpu_usage_seconds_total),
required_metrics: %w[container_memory_usage_bytes container_cpu_usage_seconds_total],
priority: 5
}.freeze,
cluster_health: {
group_title: _('Cluster Health'),
required_metrics: %w(container_memory_usage_bytes container_cpu_usage_seconds_total),
required_metrics: %w[container_memory_usage_bytes container_cpu_usage_seconds_total],
priority: 10
}.freeze
}.merge(custom_group_details).freeze
Loading
Loading
Loading
Loading
@@ -33,7 +33,7 @@ module Issuable
TITLE_HTML_LENGTH_MAX = 800
DESCRIPTION_LENGTH_MAX = 1.megabyte
DESCRIPTION_HTML_LENGTH_MAX = 5.megabytes
SEARCHABLE_FIELDS = %w(title description).freeze
SEARCHABLE_FIELDS = %w[title description].freeze
MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS = 200
 
STATE_ID_MAP = {
Loading
Loading
@@ -412,14 +412,14 @@ def grouping_columns(sort)
sort = sort.to_s
grouping_columns = [arel_table[:id]]
 
if %w(milestone_due_desc milestone_due_asc milestone).include?(sort)
if %w[milestone_due_desc milestone_due_asc milestone].include?(sort)
milestone_table = Milestone.arel_table
grouping_columns << milestone_table[:id]
grouping_columns << milestone_table[:due_date]
elsif %w(merged_at_desc merged_at_asc merged_at).include?(sort)
elsif %w[merged_at_desc merged_at_asc merged_at].include?(sort)
grouping_columns << MergeRequest::Metrics.arel_table[:id]
grouping_columns << MergeRequest::Metrics.arel_table[:merged_at]
elsif %w(closed_at_desc closed_at_asc closed_at).include?(sort)
elsif %w[closed_at_desc closed_at_asc closed_at].include?(sort)
grouping_columns << MergeRequest::Metrics.arel_table[:id]
grouping_columns << MergeRequest::Metrics.arel_table[:latest_closed_at]
end
Loading
Loading
Loading
Loading
@@ -10,10 +10,10 @@ module IssueAvailableFeatures
# EE only features are listed on EE::IssueAvailableFeatures
def available_features_for_issue_types
{
assignee: %w(issue incident),
confidentiality: %w(issue incident),
time_tracking: %w(issue incident),
move_and_clone: %w(issue incident)
assignee: %w[issue incident],
confidentiality: %w[issue incident],
time_tracking: %w[issue incident],
move_and_clone: %w[issue incident]
}.with_indifferent_access
end
end
Loading
Loading
Loading
Loading
@@ -28,7 +28,7 @@ def self.default_pattern
def self.external_pattern
strong_memoize(:external_pattern) do
issue_pattern = Integrations::BaseIssueTracker.base_reference_pattern
link_patterns = URI::DEFAULT_PARSER.make_regexp(%w(http https))
link_patterns = URI::DEFAULT_PARSER.make_regexp(%w[http https])
reference_pattern(link_patterns, issue_pattern)
end
end
Loading
Loading
Loading
Loading
@@ -12,17 +12,17 @@ module Noteable
class_methods do
# `Noteable` class names that support replying to individual notes.
def replyable_types
%w(Issue MergeRequest)
%w[Issue MergeRequest]
end
 
# `Noteable` class names that support resolvable notes.
def resolvable_types
%w(Issue MergeRequest DesignManagement::Design)
%w[Issue MergeRequest DesignManagement::Design]
end
 
# `Noteable` class names that support creating/forwarding individual notes.
def email_creatable_types
%w(Issue)
%w[Issue]
end
end
 
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ module ResolvableNote
extend ActiveSupport::Concern
 
# Names of all subclasses of `Note` that can be resolvable.
RESOLVABLE_TYPES = %w(DiffNote DiscussionNote).freeze
RESOLVABLE_TYPES = %w[DiffNote DiscussionNote].freeze
 
included do
belongs_to :resolved_by, class_name: "User"
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ module WithUploads
# Currently there is no simple way how to select only not-mounted
# uploads, it should be all FileUploaders so we select them by
# `uploader` class
FILE_UPLOADERS = %w(PersonalFileUploader NamespaceFileUploader FileUploader).freeze
FILE_UPLOADERS = %w[PersonalFileUploader NamespaceFileUploader FileUploader].freeze
 
included do
around_destroy :ignore_uploads_table_in_transaction
Loading
Loading
Loading
Loading
@@ -4,25 +4,25 @@ module ContainerRegistry
class Event
include Gitlab::Utils::StrongMemoize
 
ALLOWED_ACTIONS = %w(push delete).freeze
ALLOWED_ACTIONS = %w[push delete].freeze
PUSH_ACTION = 'push'
DELETE_ACTION = 'delete'
EVENT_TRACKING_CATEGORY = 'container_registry:notification'
EVENT_PREFIX = 'i_container_registry'
 
ALLOWED_ACTOR_TYPES = %w(
ALLOWED_ACTOR_TYPES = %w[
personal_access_token
build
gitlab_or_ldap
).freeze
].freeze
 
TRACKABLE_ACTOR_EVENTS = %w(
TRACKABLE_ACTOR_EVENTS = %w[
push_tag
delete_tag
push_repository
delete_repository
create_repository
).freeze
].freeze
 
attr_reader :event
 
Loading
Loading
Loading
Loading
@@ -8,8 +8,8 @@ class DeployToken < ApplicationRecord
 
add_authentication_token_field :token, encrypted: :required
 
AVAILABLE_SCOPES = %i(read_repository read_registry write_registry
read_package_registry write_package_registry).freeze
AVAILABLE_SCOPES = %i[read_repository read_registry write_registry
read_package_registry write_package_registry].freeze
GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'
REQUIRED_DEPENDENCY_PROXY_SCOPES = %i[read_registry write_registry].freeze
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ class DescriptionVersion < ApplicationRecord
delegate :resource_parent, to: :issuable
 
def self.issuable_attrs
%i(issue merge_request).freeze
%i[issue merge_request].freeze
end
 
def issuable
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment