Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
a3759fc2e1
commit
fdd5c2a476
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
# Cop supports --autocorrect.
|
||||
Rails/NegateInclude:
|
||||
Details: grace period
|
||||
Exclude:
|
||||
- 'app/finders/projects_finder.rb'
|
||||
- 'app/helpers/application_settings_helper.rb'
|
||||
- 'app/helpers/projects_helper.rb'
|
||||
- 'app/helpers/tree_helper.rb'
|
||||
- 'app/models/integrations/chat_message/pipeline_message.rb'
|
||||
- 'app/models/integrations/field.rb'
|
||||
- 'app/models/label.rb'
|
||||
- 'app/models/merge_request.rb'
|
||||
- 'app/models/milestone.rb'
|
||||
- 'app/services/todo_service.rb'
|
||||
- 'app/services/work_items/parent_links/create_service.rb'
|
||||
- 'config/application.rb'
|
||||
- 'config/initializers/1_settings.rb'
|
||||
- 'danger/roulette/Dangerfile'
|
||||
- 'ee/app/finders/security/pipeline_vulnerabilities_finder.rb'
|
||||
- 'ee/app/models/ee/vulnerability.rb'
|
||||
- 'ee/app/services/epic_issues/create_service.rb'
|
||||
- 'ee/app/services/security/ingestion/tasks/ingest_remediations.rb'
|
||||
- 'ee/app/services/security/security_orchestration_policies/validate_policy_service.rb'
|
||||
- 'lib/api/maven_packages.rb'
|
||||
- 'lib/gitlab/background_migration/legacy_upload_mover.rb'
|
||||
- 'lib/gitlab/ci/build/rules/rule/clause/exists.rb'
|
||||
- 'lib/gitlab/ci/parsers/coverage/sax_document.rb'
|
||||
- 'lib/gitlab/ci/queue/metrics.rb'
|
||||
- 'lib/gitlab/database/each_database.rb'
|
||||
- 'lib/gitlab/email/handler/create_issue_handler.rb'
|
||||
- 'lib/gitlab/email/handler/service_desk_handler.rb'
|
||||
- 'lib/gitlab/graphql/queries.rb'
|
||||
- 'lib/gitlab/import_export/attributes_permitter.rb'
|
||||
- 'lib/gitlab/search_results.rb'
|
||||
- 'lib/gitlab/task_helpers.rb'
|
||||
- 'lib/gitlab/url_blocker.rb'
|
||||
- 'lib/gitlab_edition.rb'
|
||||
- 'qa/qa/page/merge_request/show.rb'
|
||||
- 'qa/qa/runtime/ip_address.rb'
|
||||
- 'qa/qa/support/run.rb'
|
||||
- 'qa/qa/tools/delete_test_users.rb'
|
||||
- 'rubocop/cop/gitlab/feature_available_usage.rb'
|
||||
- 'rubocop/cop/graphql/id_type.rb'
|
||||
- 'rubocop/cop/migration/add_reference.rb'
|
||||
- 'rubocop/cop/rspec/factory_bot/inline_association.rb'
|
||||
- 'scripts/lib/gitlab.rb'
|
||||
- 'scripts/static-analysis'
|
||||
- 'spec/lib/container_registry/blob_spec.rb'
|
||||
- 'spec/lib/container_registry/client_spec.rb'
|
||||
- 'spec/lib/gitlab/metrics/dashboard/stages/metric_endpoint_inserter_spec.rb'
|
||||
- 'spec/lib/gitlab/metrics/subscribers/active_record_spec.rb'
|
||||
- 'spec/support/matchers/pushed_frontend_feature_flags_matcher.rb'
|
||||
- 'spec/support/shared_contexts/markdown_golden_master_shared_examples.rb'
|
||||
- 'spec/uploaders/object_storage_spec.rb'
|
||||
- 'tooling/danger/specs.rb'
|
||||
|
|
@ -134,7 +134,7 @@ class ProjectsFinder < UnionFinder
|
|||
|
||||
public_visibility_levels = Gitlab::VisibilityLevel.levels_for_user(current_user)
|
||||
|
||||
public_visibility_levels.exclude?(params[:visibility_level].to_i)
|
||||
!public_visibility_levels.include?(params[:visibility_level].to_i)
|
||||
end
|
||||
|
||||
def owned_projects?
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ module ApplicationSettingsHelper
|
|||
|
||||
def oauth_providers_checkboxes(form)
|
||||
button_based_providers.map do |source|
|
||||
checked = @application_setting.disabled_oauth_sign_in_sources.exclude?(source.to_s)
|
||||
checked = !@application_setting.disabled_oauth_sign_in_sources.include?(source.to_s)
|
||||
name = Gitlab::Auth::OAuth::Provider.label_for(source)
|
||||
|
||||
form.gitlab_ui_checkbox_component(
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ module ProjectsHelper
|
|||
|
||||
def project_allowed_visibility_levels(project)
|
||||
Gitlab::VisibilityLevel.values.select do |level|
|
||||
project.visibility_level_allowed?(level) && restricted_levels.exclude?(level)
|
||||
project.visibility_level_allowed?(level) && !restricted_levels.include?(level)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ module TreeHelper
|
|||
part_path = File.join(part_path, part) unless part_path.empty?
|
||||
part_path = part if part_path.empty?
|
||||
|
||||
next if parts.count > max_links && parts.last(2).exclude?(part)
|
||||
next if parts.count > max_links && !parts.last(2).include?(part)
|
||||
|
||||
yield(part, part_path)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ module Integrations
|
|||
|
||||
failed_jobs = builds.select do |build|
|
||||
# Select jobs which doesn't have a successful retry
|
||||
build[:status] == 'failed' && succeeded_job_names.exclude?(build[:name])
|
||||
build[:status] == 'failed' && !succeeded_job_names.include?(build[:name])
|
||||
end
|
||||
|
||||
failed_jobs.uniq { |job| job[:name] }.reverse
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Integrations
|
|||
invalid_attributes = attributes.keys - ATTRIBUTES
|
||||
if invalid_attributes.present?
|
||||
raise ArgumentError, "Invalid attributes #{invalid_attributes.inspect}"
|
||||
elsif TYPES.exclude?(self[:type])
|
||||
elsif !TYPES.include?(self[:type])
|
||||
raise ArgumentError, "Invalid type #{self[:type].inspect}"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class Label < ApplicationRecord
|
|||
def label_format_reference(format = :id)
|
||||
raise StandardError, 'Unknown format' unless [:id, :name].include?(format)
|
||||
|
||||
if format == :name && name.exclude?('"')
|
||||
if format == :name && !name.include?('"')
|
||||
%("#{name}")
|
||||
else
|
||||
id
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ class MergeRequest < ApplicationRecord
|
|||
def merge_participants
|
||||
participants = [author]
|
||||
|
||||
if auto_merge_enabled? && participants.exclude?(merge_user)
|
||||
if auto_merge_enabled? && !participants.include?(merge_user)
|
||||
participants << merge_user
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ class Milestone < ApplicationRecord
|
|||
raise ArgumentError, _('Cannot refer to a group milestone by an internal id!')
|
||||
end
|
||||
|
||||
if format == :name && name.exclude?('"')
|
||||
if format == :name && !name.include?('"')
|
||||
%("#{name}")
|
||||
else
|
||||
iid
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ class TodoService
|
|||
).distinct_user_ids
|
||||
end
|
||||
|
||||
if users_multiple_todos.present? && Todo::ACTIONS_MULTIPLE_ALLOWED.exclude?(attributes.fetch(:action))
|
||||
if users_multiple_todos.present? && !Todo::ACTIONS_MULTIPLE_ALLOWED.include?(attributes.fetch(:action))
|
||||
excluded_user_ids += pending_todos(
|
||||
users_multiple_todos,
|
||||
attributes.slice(:project_id, :target_id, :target_type, :commit_id, :discussion, :action)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ module WorkItems
|
|||
|
||||
def linkable?(work_item)
|
||||
can?(current_user, :admin_parent_link, work_item) &&
|
||||
previous_related_issuables.exclude?(work_item)
|
||||
!previous_related_issuables.include?(work_item)
|
||||
end
|
||||
|
||||
def previous_related_issuables
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ module Gitlab
|
|||
|
||||
LOOSE_APP_ASSETS = lambda do |logical_path, filename|
|
||||
filename.start_with?(*asset_roots) &&
|
||||
['.js', '.css', '.md', '.vue', '.graphql', ''].exclude?(File.extname(logical_path))
|
||||
!['.js', '.css', '.md', '.vue', '.graphql', ''].include?(File.extname(logical_path))
|
||||
end
|
||||
|
||||
app.config.assets.precompile << LOOSE_APP_ASSETS
|
||||
|
|
|
|||
|
|
@ -932,7 +932,7 @@ Gitlab.ee do
|
|||
Settings.kerberos['https'] = Settings.gitlab.https if Settings.kerberos['https'].nil?
|
||||
Settings.kerberos['port'] ||= Settings.kerberos.https ? 8443 : 8088
|
||||
|
||||
if Settings.kerberos['enabled'] && Settings.omniauth.providers.map(&:name).exclude?('kerberos')
|
||||
if Settings.kerberos['enabled'] && !Settings.omniauth.providers.map(&:name).include?('kerberos')
|
||||
Settings.omniauth.providers << Settingslogic.new({ 'name' => 'kerberos' })
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ categories = Set.new(changes.keys - [:unknown])
|
|||
categories << :database if helper.mr_labels.include?('database')
|
||||
|
||||
# Ensure to spin for UX reviewer when ~UX is applied (e.g. to review changes to the UI) except when it's from wider community contribution where we want to assign from the corresponding group
|
||||
categories << :ux if helper.mr_labels.include?('UX') && helper.mr_labels.exclude?('Community contribution')
|
||||
categories << :ux if helper.mr_labels.include?('UX') && !helper.mr_labels.include?('Community contribution')
|
||||
|
||||
# Ensure to spin for Product Intelligence reviewer when ~"product intelligence::review pending" is applied
|
||||
categories << :product_intelligence if helper.mr_labels.include?("product intelligence::review pending")
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ module API
|
|||
|
||||
def fetch_package(file_name:, project: nil, group: nil)
|
||||
order_by_package_file = file_name.include?(::Packages::Maven::Metadata.filename) &&
|
||||
params[:path].exclude?(::Packages::Maven::FindOrCreatePackageService::SNAPSHOT_TERM)
|
||||
!params[:path].include?(::Packages::Maven::FindOrCreatePackageService::SNAPSHOT_TERM)
|
||||
|
||||
::Packages::Maven::PackageFinder.new(
|
||||
current_user,
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ module Gitlab
|
|||
old_path = upload.absolute_path
|
||||
old_path_sub = '-/system/note/attachment'
|
||||
|
||||
if !File.exist?(old_path) || old_path.exclude?(old_path_sub)
|
||||
if !File.exist?(old_path) || !old_path.include?(old_path_sub)
|
||||
log_legacy_diff_note_problem(old_path)
|
||||
return false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ module Gitlab
|
|||
|
||||
# matches glob patterns that only match files in the top level directory
|
||||
def top_level_glob?(glob)
|
||||
glob.exclude?('/') && glob.exclude?('**')
|
||||
!glob.include?('/') && !glob.include?('**')
|
||||
end
|
||||
|
||||
# matches glob patterns that have no metacharacters for File#fnmatch?
|
||||
def exact_glob?(glob)
|
||||
glob.exclude?('*') && glob.exclude?('?') && glob.exclude?('[') && glob.exclude?('{')
|
||||
!glob.include?('*') && !glob.include?('?') && !glob.include?('[') && !glob.include?('{')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def parse_source(node)
|
||||
return unless project_path && paths && node.exclude?(GO_SOURCE_PATTERN)
|
||||
return unless project_path && paths && !node.include?(GO_SOURCE_PATTERN)
|
||||
|
||||
source = build_source_path(node)
|
||||
self.sources << source if source.present?
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ module Gitlab
|
|||
def observe_queue_depth(queue, size)
|
||||
return unless Feature.enabled?(:gitlab_ci_builds_queuing_metrics)
|
||||
|
||||
if !Rails.env.production? && QUEUE_DEPTH_HISTOGRAMS.exclude?(queue)
|
||||
if !Rails.env.production? && !QUEUE_DEPTH_HISTOGRAMS.include?(queue)
|
||||
raise ArgumentError, "unknown queue depth label: #{queue}"
|
||||
end
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def self.increment_queue_operation(operation)
|
||||
if !Rails.env.production? && OPERATION_COUNTERS.exclude?(operation)
|
||||
if !Rails.env.production? && !OPERATION_COUNTERS.include?(operation)
|
||||
raise ArgumentError, "unknown queue operation: #{operation}"
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ module Gitlab
|
|||
next unless shared_model.limit_connection_names.include?(connection_name.to_sym)
|
||||
end
|
||||
|
||||
next if selected_databases.present? && selected_databases.exclude?(connection_name.to_sym)
|
||||
next if selected_databases.present? && !selected_databases.include?(connection_name.to_sym)
|
||||
|
||||
with_shared_connection(connection_model.connection, connection_name) do
|
||||
yield shared_model, connection_name
|
||||
|
|
@ -63,7 +63,7 @@ module Gitlab
|
|||
def with_model_connection(model, selected_databases, &blk)
|
||||
connection_name = model.connection_db_config.name
|
||||
|
||||
return if selected_databases.present? && selected_databases.exclude?(connection_name.to_sym)
|
||||
return if selected_databases.present? && !selected_databases.include?(connection_name.to_sym)
|
||||
|
||||
with_shared_connection(model.connection, connection_name) do
|
||||
yield model, connection_name
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def can_handle_legacy_format?
|
||||
project_path && incoming_email_token.exclude?('+') && mail_key.exclude?(Gitlab::Email::Common::UNSUBSCRIBE_SUFFIX_LEGACY)
|
||||
project_path && !incoming_email_token.include?('+') && !mail_key.include?(Gitlab::Email::Common::UNSUBSCRIBE_SUFFIX_LEGACY)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def can_handle_legacy_format?
|
||||
project_path && project_path.include?('/') && mail_key.exclude?('+')
|
||||
project_path && project_path.include?('/') && !mail_key.include?('+')
|
||||
end
|
||||
|
||||
def author
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ module Gitlab
|
|||
|
||||
# remove variable definitions only used in skipped (client) fields
|
||||
vars = op.variables.reject do |v|
|
||||
@skipped_arguments.include?(v.name) && @printed_arguments.exclude?(v.name)
|
||||
@skipped_arguments.include?(v.name) && !@printed_arguments.include?(v.name)
|
||||
end
|
||||
|
||||
if vars.any?
|
||||
|
|
@ -109,7 +109,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def print_fragment_definition(fragment_def, indent: "")
|
||||
if skips? && @skipped_fragments.include?(fragment_def.name) && @used_fragments.exclude?(fragment_def.name)
|
||||
if skips? && @skipped_fragments.include?(fragment_def.name) && !@used_fragments.include?(fragment_def.name)
|
||||
return ''
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def permitted_attributes_defined?(relation_sym)
|
||||
DISABLED_RELATION_NAMES.exclude?(relation_sym) && @attributes_finder.included_attributes.key?(relation_sym)
|
||||
!DISABLED_RELATION_NAMES.include?(relation_sym) && @attributes_finder.included_attributes.key?(relation_sym)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ module Gitlab
|
|||
sort_by = ::Gitlab::Search::SortOptions.sort_and_direction(order_by, sort)
|
||||
|
||||
# Reset sort to default if the chosen one is not supported by scope
|
||||
sort_by = nil if SCOPE_ONLY_SORT[sort_by] && SCOPE_ONLY_SORT[sort_by].exclude?(scope)
|
||||
sort_by = nil if SCOPE_ONLY_SORT[sort_by] && !SCOPE_ONLY_SORT[sort_by].include?(scope)
|
||||
|
||||
case sort_by
|
||||
when :created_at_asc
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ module Gitlab
|
|||
begin
|
||||
print(message)
|
||||
answer = $stdin.gets.chomp
|
||||
end while choices.present? && choices.exclude?(answer)
|
||||
end while choices.present? && !choices.include?(answer)
|
||||
answer
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ module QA
|
|||
raise ArgumentError, "Please provide GITLAB_QA_ADMIN_ACCESS_TOKEN" unless ENV['GITLAB_QA_ADMIN_ACCESS_TOKEN']
|
||||
|
||||
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['GITLAB_QA_ADMIN_ACCESS_TOKEN'])
|
||||
@dry_run = FALSY_VALUES.exclude?(dry_run.to_s.downcase)
|
||||
@dry_run = !FALSY_VALUES.include?(dry_run.to_s.downcase)
|
||||
@delete_before = Date.parse(delete_before)
|
||||
@page_no = '1'
|
||||
@exclude_users = Array(exclude_users.to_s.split(',')) + EXCLUDE_USERS
|
||||
|
|
@ -61,7 +61,7 @@ module QA
|
|||
JSON.parse(response.body).select do |user|
|
||||
user['username'].start_with?('qa-user-', 'test-user-') \
|
||||
&& (user['name'] == 'QA Tests' || user['name'].start_with?('QA User')) \
|
||||
&& @exclude_users.exclude?(user['username']) \
|
||||
&& !@exclude_users.include?(user['username']) \
|
||||
&& Date.parse(user.fetch('created_at', Date.today.to_s)) < @delete_before
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ module RuboCop
|
|||
return if feature_name(node).nil?
|
||||
return if ALL_FEATURES.include?(feature_name(node)) && args_count(node) == 2
|
||||
|
||||
if ALL_FEATURES.exclude?(feature_name(node))
|
||||
if !ALL_FEATURES.include?(feature_name(node))
|
||||
add_offense(node, message: licensed_feature_message(node))
|
||||
elsif args_count(node) < 2
|
||||
add_offense(node, message: NOT_ENOUGH_ARGS_MSG)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ module RuboCop
|
|||
private
|
||||
|
||||
def does_not_match?(arg)
|
||||
WHITELISTED_ARGUMENTS.exclude?(arg)
|
||||
!WHITELISTED_ARGUMENTS.include?(arg)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ module RuboCop
|
|||
private
|
||||
|
||||
def existing_table?(new_tables, table)
|
||||
new_tables.exclude?(table)
|
||||
!new_tables.include?(table)
|
||||
end
|
||||
|
||||
def create_table?(node)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ module RuboCop
|
|||
def inside_assocation_definition?(node)
|
||||
node.each_ancestor(:block).any? do |parent|
|
||||
name = association_definition(parent)
|
||||
name && SKIP_NAMES.exclude?(name)
|
||||
name && !SKIP_NAMES.include?(name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ RSpec.describe ContainerRegistry::Blob do
|
|||
context 'for a valid address' do
|
||||
before do
|
||||
stub_request(:get, location)
|
||||
.with { |request| request.headers.exclude?('Authorization') }
|
||||
.with { |request| !request.headers.include?('Authorization') }
|
||||
.to_return(
|
||||
status: 200,
|
||||
headers: { 'Content-Type' => 'application/json' },
|
||||
|
|
@ -115,7 +115,7 @@ RSpec.describe ContainerRegistry::Blob do
|
|||
context 'for a relative address' do
|
||||
before do
|
||||
stub_request(:get, 'http://registry.gitlab/relative')
|
||||
.with { |request| request.headers.exclude?('Authorization') }
|
||||
.with { |request| !request.headers.include?('Authorization') }
|
||||
.to_return(
|
||||
status: 200,
|
||||
headers: { 'Content-Type' => 'application/json' },
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ RSpec.describe ContainerRegistry::Client do
|
|||
# https://github.com/bblimke/webmock/blob/master/lib/webmock/matchers/hash_excluding_matcher.rb
|
||||
stub_request(:get, redirect_location)
|
||||
.with(headers: redirect_header) do |request|
|
||||
request.headers.exclude?('Authorization')
|
||||
!request.headers.include?('Authorization')
|
||||
end
|
||||
.to_return(status: 200, body: "Successfully redirected")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ RSpec.describe Gitlab::Metrics::Dashboard::Stages::MetricEndpointInserter do
|
|||
transform!
|
||||
|
||||
expect(all_metrics).to satisfy_all do |metric|
|
||||
metric[:prometheus_endpoint_path].present? && metric[:prometheus_endpoint_path].exclude?("\n")
|
||||
metric[:prometheus_endpoint_path].present? && !metric[:prometheus_endpoint_path].include?("\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
|
|||
|
||||
# Emulate Marginalia pre-pending comments
|
||||
def sql(query, comments: true)
|
||||
if comments && %w[BEGIN COMMIT].exclude?(query)
|
||||
if comments && !%w[BEGIN COMMIT].include?(query)
|
||||
"/*application:web,controller:badges,action:pipeline,correlation_id:01EYN39K9VMJC56Z7808N7RSRH*/ #{query}"
|
||||
else
|
||||
query
|
||||
|
|
@ -284,7 +284,7 @@ RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do
|
|||
|
||||
# Emulate Marginalia pre-pending comments
|
||||
def sql(query, comments: true)
|
||||
if comments && %w[BEGIN COMMIT].exclude?(query)
|
||||
if comments && !%w[BEGIN COMMIT].include?(query)
|
||||
"/*application:web,controller:badges,action:pipeline,correlation_id:01EYN39K9VMJC56Z7808N7RSRH*/ #{query}"
|
||||
else
|
||||
query
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ RSpec::Matchers.define :have_pushed_frontend_feature_flags do |expected|
|
|||
|
||||
failure_message do |actual|
|
||||
missing = expected.select do |feature_flag_name, enabled|
|
||||
html(actual).exclude?(to_js(feature_flag_name, enabled))
|
||||
!html(actual).include?(to_js(feature_flag_name, enabled))
|
||||
end
|
||||
|
||||
formatted_missing_flags = missing.map { |feature_flag_name, enabled| to_js(feature_flag_name, enabled) }.join("\n")
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ RSpec.shared_context 'API::Markdown Golden Master shared context' do |markdown_y
|
|||
|
||||
if focused_markdown_examples_string = ENV['FOCUSED_MARKDOWN_EXAMPLES']
|
||||
focused_markdown_examples = focused_markdown_examples_string.split(',').map(&:strip) || []
|
||||
markdown_examples.reject! { |markdown_example| focused_markdown_examples.exclude?(markdown_example.fetch(:name)) }
|
||||
markdown_examples.reject! { |markdown_example| !focused_markdown_examples.include?(markdown_example.fetch(:name)) }
|
||||
end
|
||||
|
||||
markdown_examples.each do |markdown_example|
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ RSpec.describe ObjectStorage do
|
|||
|
||||
# We need to check the Host header not including the port because AWS does not accept
|
||||
stub_request(:get, %r{s3.amazonaws.com/#{uploader.path}})
|
||||
.with { |request| request.headers['Host'].to_s.exclude?(':443') }
|
||||
.with { |request| !request.headers['Host'].to_s.include?(':443') }
|
||||
.to_return(status: 200, body: '')
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ module Tooling
|
|||
|
||||
def find_line_number(file_lines, searched_line, exclude_indexes: [])
|
||||
_, index = file_lines.each_with_index.find do |file_line, index|
|
||||
file_line == searched_line && exclude_indexes.exclude?(index)
|
||||
file_line == searched_line && !exclude_indexes.include?(index)
|
||||
end
|
||||
|
||||
index
|
||||
|
|
|
|||
Loading…
Reference in New Issue