From 5ddff767f432fa1a39be312322362c700fa116a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:42:59 +0000 Subject: [PATCH 1/2] build(deps-dev): bump rubocop from 1.88.1 to 1.88.2 Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.88.1 to 1.88.2. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.88.1...v1.88.2) --- updated-dependencies: - dependency-name: rubocop dependency-version: 1.88.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index f5429172b0f..ca1d1d173a1 100644 --- a/Gemfile +++ b/Gemfile @@ -60,7 +60,7 @@ group :test do gem 'rspec-its' gem 'rspec-rails', '~> 8.0.4' gem 'rspec-wait' - gem 'rubocop', '~> 1.88.1' + gem 'rubocop', '~> 1.88.2' gem 'rubocop-capybara' gem 'rubocop-factory_bot' gem 'rubocop-rails', '~> 2.36' diff --git a/Gemfile.lock b/Gemfile.lock index d646cc3a1d4..d2928df54d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -297,7 +297,7 @@ GEM activesupport (>= 3.0.0) mustache (~> 1.0, >= 0.99.4) rspec (~> 3.0) - rubocop (1.88.1) + rubocop (1.88.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -481,7 +481,7 @@ DEPENDENCIES rspec-rails (~> 8.0.4) rspec-wait rspec_api_documentation (>= 6.1.0) - rubocop (~> 1.88.1) + rubocop (~> 1.88.2) rubocop-capybara rubocop-factory_bot rubocop-rails (~> 2.36) From 064a920b73cbe04866173fb96eeeea49e21f7c8a Mon Sep 17 00:00:00 2001 From: johha Date: Thu, 6 Aug 2026 09:27:38 +0200 Subject: [PATCH 2/2] fix linting --- app/actions/deployment_create.rb | 2 ++ app/actions/domain_create.rb | 6 +++--- app/actions/role_create.rb | 7 +++---- app/actions/user_create.rb | 6 ++---- app/decorators/include_binding_app_decorator.rb | 2 +- .../include_binding_service_instance_decorator.rb | 2 +- app/decorators/include_organization_decorator.rb | 2 +- app/decorators/include_route_domain_decorator.rb | 2 +- app/decorators/include_space_decorator.rb | 2 +- app/decorators/include_space_organization_decorator.rb | 2 +- app/models/runtime/helpers/organization_role_mixin.rb | 2 +- app/models/runtime/helpers/space_role_mixin.rb | 2 +- lib/sequel_plugins/vcap_relations.rb | 2 +- middleware/below_min_cli_warning.rb | 2 +- spec/unit/actions/manifest_route_update_spec.rb | 2 +- 15 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/actions/deployment_create.rb b/app/actions/deployment_create.rb index 70e923a6e86..47d89d5994f 100644 --- a/app/actions/deployment_create.rb +++ b/app/actions/deployment_create.rb @@ -95,11 +95,13 @@ def enhanced_deployment_create_error(e, app) org_error_msg = org_error_msg_1 + org_error_msg_2 error_message = e.message + # rubocop:disable Style/ArrayIntersect -- e.message is a String, not an Array if space_quota_errors.any? { |substring| e.message.include?(substring) } error_message += space_error_msg elsif org_quota_errors.any? { |substring| e.message.include?(substring) } error_message += org_error_msg end + # rubocop:enable Style/ArrayIntersect error = DeploymentCreate::Error.new(error_message) error.set_backtrace(e.backtrace) diff --git a/app/actions/domain_create.rb b/app/actions/domain_create.rb index 6f1016eb752..f1f6a39c17b 100644 --- a/app/actions/domain_create.rb +++ b/app/actions/domain_create.rb @@ -42,11 +42,11 @@ def create(message:, shared_organizations: []) private def validation_error!(message, error) - error!("The domain name \"#{message.name}\" is already in use") if error.errors.on(:name)&.any? { |e| [:unique].include?(e) } + error!("The domain name \"#{message.name}\" is already in use") if error.errors.on(:name)&.intersect?([:unique]) - error!("The \"#{message.name}\" domain is reserved and cannot be used for org-scoped domains.") if error.errors.on(:name)&.any? { |e| [:reserved].include?(e) } + error!("The \"#{message.name}\" domain is reserved and cannot be used for org-scoped domains.") if error.errors.on(:name)&.intersect?([:reserved]) - if error.errors.on(:organization)&.any? { |e| [:total_private_domains_exceeded].include?(e) } + if error.errors.on(:organization)&.intersect?([:total_private_domains_exceeded]) org = Organization.find(guid: message.organization_guid).name error!("The number of private domains exceeds the quota for organization \"#{org}\"") end diff --git a/app/actions/role_create.rb b/app/actions/role_create.rb index ae3af150ca9..e5a7e24a9ae 100644 --- a/app/actions/role_create.rb +++ b/app/actions/role_create.rb @@ -98,15 +98,14 @@ def create_organization_billing_manager(user, organization, role_type) end def space_validation_error!(type, error, user, space) - error!("User '#{user.presentation_name}' already has '#{type}' role in space '#{space.name}'.") if error.errors.on(%i[space_id user_id])&.any? { |e| [:unique].include?(e) } + error!("User '#{user.presentation_name}' already has '#{type}' role in space '#{space.name}'.") if error.errors.on(%i[space_id user_id])&.intersect?([:unique]) error!(error.message) end def organization_validation_error!(type, error, user, organization) - error!("User '#{user.presentation_name}' already has '#{type}' role in organization '#{organization.name}'.") if error.errors.on(%i[organization_id user_id])&.any? do |e| - [:unique].include?(e) - end + error!("User '#{user.presentation_name}' already has '#{type}' role in organization '#{organization.name}'.") if error.errors.on(%i[organization_id + user_id])&.intersect?([:unique]) error!(error.message) end diff --git a/app/actions/user_create.rb b/app/actions/user_create.rb index b9d14b41b61..5d485ad4c6a 100644 --- a/app/actions/user_create.rb +++ b/app/actions/user_create.rb @@ -26,11 +26,9 @@ def create(message:) private def validation_error!(message, error) - error!("User with guid '#{message.guid}' already exists.") if message.guid && error.errors.on(:guid)&.any? { |e| [:unique].include?(e) } + error!("User with guid '#{message.guid}' already exists.") if message.guid && error.errors.on(:guid)&.intersect?([:unique]) - if !message.guid && error.errors.on(:guid)&.any? { |e| [:unique].include?(e) } - error!("User with username '#{message.username}' and origin '#{message.origin}' already exists.") - end + error!("User with username '#{message.username}' and origin '#{message.origin}' already exists.") if !message.guid && error.errors.on(:guid)&.intersect?([:unique]) error!(error.message) end diff --git a/app/decorators/include_binding_app_decorator.rb b/app/decorators/include_binding_app_decorator.rb index ff9390a0d55..6c549e46f69 100644 --- a/app/decorators/include_binding_app_decorator.rb +++ b/app/decorators/include_binding_app_decorator.rb @@ -2,7 +2,7 @@ module VCAP::CloudController class IncludeBindingAppDecorator class << self def match?(include) - include&.any? { |i| %w[app].include?(i) } + include&.intersect?(%w[app]) end def decorate(hash, bindings) diff --git a/app/decorators/include_binding_service_instance_decorator.rb b/app/decorators/include_binding_service_instance_decorator.rb index 9860a3e2365..ebdd71c5f24 100644 --- a/app/decorators/include_binding_service_instance_decorator.rb +++ b/app/decorators/include_binding_service_instance_decorator.rb @@ -4,7 +4,7 @@ module VCAP::CloudController class IncludeBindingServiceInstanceDecorator class << self def match?(include) - include&.any? { |i| %w[service_instance].include?(i) } + include&.intersect?(%w[service_instance]) end def decorate(hash, bindings) diff --git a/app/decorators/include_organization_decorator.rb b/app/decorators/include_organization_decorator.rb index 49ff0685d0f..6d1a751919d 100644 --- a/app/decorators/include_organization_decorator.rb +++ b/app/decorators/include_organization_decorator.rb @@ -2,7 +2,7 @@ module VCAP::CloudController class IncludeOrganizationDecorator class << self def match?(include) - include&.any? { |i| %w[org space.organization].include?(i) } + include&.intersect?(%w[org space.organization]) end def decorate(hash, resources) diff --git a/app/decorators/include_route_domain_decorator.rb b/app/decorators/include_route_domain_decorator.rb index 8dea96620ca..cd521005cb7 100644 --- a/app/decorators/include_route_domain_decorator.rb +++ b/app/decorators/include_route_domain_decorator.rb @@ -2,7 +2,7 @@ module VCAP::CloudController class IncludeRouteDomainDecorator class << self def match?(include) - include&.any? { |i| %w[domain].include?(i) } + include&.intersect?(%w[domain]) end def decorate(hash, routes) diff --git a/app/decorators/include_space_decorator.rb b/app/decorators/include_space_decorator.rb index 180c4c49cdc..9df10286b94 100644 --- a/app/decorators/include_space_decorator.rb +++ b/app/decorators/include_space_decorator.rb @@ -2,7 +2,7 @@ module VCAP::CloudController class IncludeSpaceDecorator class << self def match?(include) - include&.any? { |i| %w[space space.organization].include?(i) } + include&.intersect?(%w[space space.organization]) end def decorate(hash, resources) diff --git a/app/decorators/include_space_organization_decorator.rb b/app/decorators/include_space_organization_decorator.rb index a8299e3ac92..77ff23f56a9 100644 --- a/app/decorators/include_space_organization_decorator.rb +++ b/app/decorators/include_space_organization_decorator.rb @@ -2,7 +2,7 @@ module VCAP::CloudController class IncludeSpaceOrganizationDecorator class << self def match?(include) - include&.any? { |i| %w[org organization].include?(i) } + include&.intersect?(%w[org organization]) end def decorate(hash, spaces) diff --git a/app/models/runtime/helpers/organization_role_mixin.rb b/app/models/runtime/helpers/organization_role_mixin.rb index ef6942a4297..fd81b8942b3 100644 --- a/app/models/runtime/helpers/organization_role_mixin.rb +++ b/app/models/runtime/helpers/organization_role_mixin.rb @@ -17,7 +17,7 @@ def around_save yield rescue Sequel::UniqueConstraintViolation => e unique_indexes = %w[org_users_idx org_auditors_idx org_managers_idx org_billing_managers_idx] - raise e unless unique_indexes.any? { |pattern| e.message.include?(pattern) } + raise e unless unique_indexes.any? { |pattern| e.message.include?(pattern) } # rubocop:disable Style/ArrayIntersect -- e.message is a String, not an Array errors.add(%i[organization_id user_id], :unique) raise validation_failed_error diff --git a/app/models/runtime/helpers/space_role_mixin.rb b/app/models/runtime/helpers/space_role_mixin.rb index 9c4d24139c0..bb1a3205ae0 100644 --- a/app/models/runtime/helpers/space_role_mixin.rb +++ b/app/models/runtime/helpers/space_role_mixin.rb @@ -17,7 +17,7 @@ def around_save yield rescue Sequel::UniqueConstraintViolation => e unique_indexes = %w[space_developers_idx space_auditors_idx space_managers_idx spaces_supporters_user_space_index] - raise e unless unique_indexes.any? { |pattern| e.message.include?(pattern) } + raise e unless unique_indexes.any? { |pattern| e.message.include?(pattern) } # rubocop:disable Style/ArrayIntersect -- e.message is a String, not an Array errors.add(%i[space_id user_id], :unique) raise validation_failed_error diff --git a/lib/sequel_plugins/vcap_relations.rb b/lib/sequel_plugins/vcap_relations.rb index 8a88acef4a2..7ab769f02c2 100644 --- a/lib/sequel_plugins/vcap_relations.rb +++ b/lib/sequel_plugins/vcap_relations.rb @@ -73,7 +73,7 @@ def many_to_many(name, opts={}) end rescue Sequel::UniqueConstraintViolation => e # ignore the error and rollback the inner transaction - raise Sequel::Rollback if opts[:ignored_unique_constraint_violation_errors]&.any? { |pattern| e.message.include?(pattern) } + raise Sequel::Rollback if opts[:ignored_unique_constraint_violation_errors]&.any? { |pattern| e.message.include?(pattern) } # rubocop:disable Style/ArrayIntersect -- e.message is a String, not an Array raise e end diff --git a/middleware/below_min_cli_warning.rb b/middleware/below_min_cli_warning.rb index 4d987838249..1c376fb0f32 100644 --- a/middleware/below_min_cli_warning.rb +++ b/middleware/below_min_cli_warning.rb @@ -11,7 +11,7 @@ def call(env) included_endpoints = %w[/v3/spaces /v3/organizations /v2/spaces /v2/organizations] - if included_endpoints.any? { |ep| env['REQUEST_PATH'].include?(ep) } && is_below_min_cli_version?(env['HTTP_USER_AGENT']) + if included_endpoints.any? { |ep| env['REQUEST_PATH'].include?(ep) } && is_below_min_cli_version?(env['HTTP_USER_AGENT']) # rubocop:disable Style/ArrayIntersect -- env['REQUEST_PATH'] is a String, not an Array # Ensure existing warnings are appended by ',' (unicode %2C) new_warning = env['X-Cf-Warnings'].nil? ? escaped_warning : "#{env['X-Cf-Warnings']}%2C#{escaped_warning}" headers['X-Cf-Warnings'] = new_warning diff --git a/spec/unit/actions/manifest_route_update_spec.rb b/spec/unit/actions/manifest_route_update_spec.rb index 040c6177655..32321b7c257 100644 --- a/spec/unit/actions/manifest_route_update_spec.rb +++ b/spec/unit/actions/manifest_route_update_spec.rb @@ -89,7 +89,7 @@ module VCAP::CloudController ManifestRouteUpdate.update(app.guid, message, user_audit_info) routes = app.reload.routes - expect(routes.length).to eq(num_routes + 0) + expect(routes.length).to eq(num_routes) expect(Route.count).to eq(num_maps + 1) route = routes.first