Compare commits

..

5 Commits

Author SHA1 Message Date
Maikel
eee9f61c38 Merge pull request #14129 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.217.0
Bump aws-sdk-s3 from 1.215.0 to 1.217.0
2026-04-02 11:50:42 +11:00
Maikel
7f711d746f Merge pull request #14126 from dacook/dependabot-cooldown
Dependabot cooldown
2026-04-02 11:49:55 +11:00
dependabot[bot]
732234f1c0 Bump aws-sdk-s3 from 1.215.0 to 1.217.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.215.0 to 1.217.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-version: 1.217.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-01 11:11:34 +00:00
David Cook
e255bcc082 Formatting
Compacted and adjusted comments to make it a bit easier to read.
2026-04-01 10:31:34 +11:00
David Cook
51b4dc64cc Add cooldown for turbo_power
Ensure it's treated the same as other gems and packages.
2026-04-01 10:17:40 +11:00
15 changed files with 113 additions and 111 deletions

View File

@@ -9,32 +9,30 @@ multi-ecosystem-groups:
turbo_power:
schedule:
interval: "daily"
cooldown:
default-days: 7
updates:
# turbo_power: ensure gem and package are updated together
- package-ecosystem: "bundler"
directory: "/"
patterns: ["turbo_power"]
multi-ecosystem-group: "turbo_power"
# Only specific requirements are specified in Gemfile, so don't touch it.
versioning-strategy: lockfile-only
- package-ecosystem: "npm"
directory: "/"
patterns: ["turbo_power"]
multi-ecosystem-group: "turbo_power"
# Only specific requirements are specified in package.json, so don't touch it.
versioning-strategy: lockfile-only
# All others
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
cooldown:
default-days: 7
# Only specific requirements are specified in Gemfile, so don't touch it.
# Only specific requirements are specified in Gemfile, so don't let Dependabot touch it.
versioning-strategy: lockfile-only
- package-ecosystem: "npm"
@@ -43,6 +41,5 @@ updates:
interval: "daily"
cooldown:
default-days: 7
# Only specific requirements are specified in package.json, so don't touch it.
# Only specific requirements are specified in package.json, so don't let Dependabot touch it.
versioning-strategy: lockfile-only

View File

@@ -1,26 +1,11 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp`
# using RuboCop version 1.86.0.
# using RuboCop version 1.81.7.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
# SupportedStylesAlignWith: start_of_line, relative_to_receiver
Layout/IndentationWidth:
Exclude:
- 'app/models/spree/taxon.rb'
- 'app/services/dfc_catalog_importer.rb'
- 'lib/reporting/reports/customers/base.rb'
- 'lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb'
- 'spec/models/spree/order/state_machine_spec.rb'
- 'spec/services/orders/compare_invoice_service_spec.rb'
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/consumer/checkout/payment_spec.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: RequireParenthesesForMethodChains.
@@ -50,7 +35,6 @@ Lint/UselessConstantScoping:
- 'lib/reporting/report_metadata_builder.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessOr:
Exclude:
- 'app/models/product_import/entry_validator.rb'
@@ -78,13 +62,14 @@ Metrics/AbcSize:
- 'lib/spree/core/controller_helpers/order.rb'
- 'spec/services/orders/checkout_restart_service_spec.rb'
# Offense count: 7
# Offense count: 9
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
- 'app/models/spree/order/checkout.rb'
- 'app/models/spree/payment.rb'
- 'app/models/spree/payment/processing.rb'
- 'app/models/spree/shipment.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 'lib/tasks/data.rake'
@@ -95,7 +80,7 @@ Metrics/BlockNesting:
Exclude:
- 'app/models/spree/payment/processing.rb'
# Offense count: 48
# Offense count: 49
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
@@ -120,6 +105,7 @@ Metrics/ClassLength:
- 'app/models/product_import/product_importer.rb'
- 'app/models/spree/ability.rb'
- 'app/models/spree/address.rb'
- 'app/models/spree/credit_card.rb'
- 'app/models/spree/gateway/stripe_sca.rb'
- 'app/models/spree/line_item.rb'
- 'app/models/spree/order.rb'
@@ -148,12 +134,11 @@ Metrics/ClassLength:
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
# Offense count: 33
# Offense count: 37
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/concerns/respond_with.rb'
- 'app/controllers/spree/admin/payments_controller.rb'
- 'app/controllers/spree/orders_controller.rb'
- 'app/helpers/checkout_helper.rb'
@@ -174,12 +159,16 @@ Metrics/CyclomaticComplexity:
- 'lib/open_food_network/enterprise_issue_validator.rb'
- 'lib/reporting/reports/orders_and_fulfillment/order_cycle_customer_totals.rb'
- 'lib/reporting/reports/orders_and_fulfillment/order_cycle_supplier_totals.rb'
- 'lib/reporting/reports/payments/itemised_payment_totals.rb'
- 'lib/reporting/reports/payments/payment_totals.rb'
- 'lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb'
- 'lib/reporting/reports/xero_invoices/base.rb'
- 'lib/spree/core/controller_helpers/order.rb'
- 'lib/spree/core/controller_helpers/respond_with.rb'
- 'lib/spree/localized_number.rb'
- 'spec/models/product_importer_spec.rb'
# Offense count: 20
# Offense count: 22
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
@@ -189,6 +178,7 @@ Metrics/MethodLength:
- 'app/models/spree/ability.rb'
- 'app/models/spree/gateway/pay_pal_express.rb'
- 'app/models/spree/order/checkout.rb'
- 'app/models/spree/payment/processing.rb'
- 'app/models/spree/preferences/preferable_class_methods.rb'
- 'lib/open_food_network/order_cycle_form_applicator.rb'
- 'lib/open_food_network/order_cycle_permissions.rb'
@@ -197,11 +187,12 @@ Metrics/MethodLength:
- 'lib/spree/localized_number.rb'
- 'lib/tasks/sample_data/product_factory.rb'
# Offense count: 9
# Offense count: 10
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
- 'app/helpers/admin/injection_helper.rb'
- 'app/helpers/checkout_helper.rb'
- 'app/helpers/injection_helper.rb'
- 'app/helpers/spree/admin/base_helper.rb'
- 'app/helpers/spree/admin/navigation_helper.rb'
@@ -247,7 +238,7 @@ Naming/MethodParameterName:
# Offense count: 60
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
# AllowedMethods: call
# WaywardPredicates: infinite?, nonzero?
# WaywardPredicates: nonzero?
Naming/PredicateMethod:
Exclude:
- 'app/controllers/admin/product_import_controller.rb'
@@ -345,14 +336,16 @@ Rails/OrderArguments:
- 'spec/services/orders/generate_invoice_service_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
# Offense count: 1
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Rails/Presence:
Exclude:
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/models/spree/product.rb'
# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Severity.
Rails/RedirectBackOrTo:
Exclude:
- 'app/controllers/admin/order_cycles_controller.rb'
@@ -380,7 +373,7 @@ Style/BitwisePredicate:
Exclude:
- 'app/helpers/admin/enterprises_helper.rb'
# Offense count: 22
# Offense count: 23
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
# SupportedStyles: nested, compact

View File

@@ -185,8 +185,8 @@ GEM
ast (2.4.3)
attr_required (1.0.2)
aws-eventstream (1.4.0)
aws-partitions (1.1227.0)
aws-sdk-core (3.243.0)
aws-partitions (1.1233.0)
aws-sdk-core (3.244.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -194,11 +194,11 @@ GEM
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.122.0)
aws-sdk-core (~> 3, >= 3.241.4)
aws-sdk-kms (1.123.0)
aws-sdk-core (~> 3, >= 3.244.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.215.0)
aws-sdk-core (~> 3, >= 3.243.0)
aws-sdk-s3 (1.217.0)
aws-sdk-core (~> 3, >= 3.244.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
@@ -576,7 +576,7 @@ GEM
parallel (1.27.0)
paranoia (2.6.4)
activerecord (>= 5.1, < 7.2)
parser (3.3.11.1)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
paypal-sdk-core (0.3.4)
@@ -776,7 +776,7 @@ GEM
rswag-ui (2.17.0)
actionpack (>= 5.2, < 8.2)
railties (>= 5.2, < 8.2)
rubocop (1.86.0)
rubocop (1.84.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@@ -787,7 +787,7 @@ GEM
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-capybara (2.22.1)

View File

@@ -12,7 +12,6 @@ class ApplicationController < ActionController::Base
include CablecarResponses
include Pagy::Backend
include RequestTimeouts
include RespondWith
self.responder = ApplicationResponder
respond_to :html

View File

@@ -44,7 +44,6 @@ module CheckoutCallbacks
@order.checkout_processing = true
redirect_to(main_app.shop_path) && return if redirect_to_shop?
redirect_to_cart_path && return unless valid_order_line_items?
end

View File

@@ -1,49 +0,0 @@
# frozen_string_literal: true
require "spree/responder"
module RespondWith
extend ActiveSupport::Concern
def respond_with(*resources, &)
if self.class.mimes_for_respond_to.empty?
raise "In order to use respond_with, first you need to declare the formats your " \
"controller responds to in the class level"
end
return unless (collector = retrieve_collector_from_mimes(&))
options = resources.size == 1 ? {} : resources.extract_options!
# Fix spree issues #3531 and #2210 (patch provided by leiyangyou)
if (defined_response = collector.response) &&
!ApplicationController.spree_responders[self.class.to_s.to_sym]
.try(:[], action_name.to_sym)
if action = options.delete(:action)
render(action:)
else
defined_response.call
end
else
# The action name is needed for processing
options[:action_name] = action_name.to_sym
# If responder is not specified then pass in Spree::Responder
(options.delete(:responder) || Spree::Responder).call(self, resources, options)
end
end
private
def retrieve_collector_from_mimes(mimes = nil, &block)
mimes ||= collect_mimes_from_class_level
collector = ActionController::Base::Collector.new(mimes, request.variant)
block.call(collector) if block_given?
format = collector.negotiate_format(request)
raise ActionController::UnknownFormat unless format
_process_format(format)
collector
end
end

View File

@@ -133,8 +133,8 @@ class Invoice
end
def tax_rate_by_id
all_tax_adjustments.to_h do |adjustment|
[adjustment.originator.id, adjustment.originator]
all_tax_adjustments.each_with_object({}) do |adjustment, tax_rates|
tax_rates[adjustment.originator.id] = adjustment.originator
end
end

View File

@@ -1,17 +1,19 @@
# frozen_string_literal: false
module Spree
class TaxRate < ApplicationRecord
class DefaultTaxZoneValidator < ActiveModel::Validator
def validate(record)
return unless record.included_in_price
class DefaultTaxZoneValidator < ActiveModel::Validator
def validate(record)
return unless record.included_in_price
return if Zone.default_tax
return if Zone.default_tax
record.errors.add(:included_in_price, Spree.t("errors.messages.included_price_validation"))
end
record.errors.add(:included_in_price, Spree.t("errors.messages.included_price_validation"))
end
end
end
module Spree
class TaxRate < ApplicationRecord
acts_as_paranoid
include CalculatedAdjustments

View File

@@ -35,8 +35,8 @@ module Spree
taxons
.pluck('spree_taxons.id, enterprises.id AS enterprise_id')
.each_with_object({}) do |(taxon_id, enterprise_id), collection|
collection[enterprise_id.to_i] ||= Set.new
collection[enterprise_id.to_i] << taxon_id
collection[enterprise_id.to_i] ||= Set.new
collection[enterprise_id.to_i] << taxon_id
end
end

View File

@@ -1,5 +1,17 @@
# frozen_string_literal: true
module Api
module Admin
class TagRuleSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :rule_specific_serializer
def rule_specific_serializer
"Api::Admin::#{object.class}Serializer".constantize.new(object)
end
end
end
end
module Api
module Admin
module TagRule

View File

@@ -6,7 +6,7 @@ module Orders
delegate :distributor, :order_cycle, to: :order
FeeValue = Struct.new(:fee, :role)
FeeValue = Struct.new(:fee, :role, keyword_init: true)
def initialize(order)
@order = order

View File

@@ -41,8 +41,8 @@ module OpenFoodNetwork
end
def fees_name_by_type_for(variant)
per_item_enterprise_fee_applicators_for(variant).to_h do |applicator|
[applicator.enterprise_fee.fee_type.to_sym, applicator.enterprise_fee.name]
per_item_enterprise_fee_applicators_for(variant).each_with_object({}) do |applicator, fees|
fees[applicator.enterprise_fee.fee_type.to_sym] = applicator.enterprise_fee.name
end
end

View File

@@ -10,4 +10,6 @@ module OpenFoodNetwork::Locking
end
end
ActiveSupport.on_load(:active_record) { extend OpenFoodNetwork::Locking }
class ActiveRecord::Base
extend OpenFoodNetwork::Locking
end

View File

@@ -1,5 +1,52 @@
# frozen_string_literal: true
require 'spree/responder'
module ActionController
class Base
def respond_with(*resources, &)
if self.class.mimes_for_respond_to.empty?
raise "In order to use respond_with, first you need to declare the formats your " \
"controller responds to in the class level"
end
return unless (collector = retrieve_collector_from_mimes(&))
options = resources.size == 1 ? {} : resources.extract_options!
# Fix spree issues #3531 and #2210 (patch provided by leiyangyou)
if (defined_response = collector.response) &&
!ApplicationController.spree_responders[self.class.to_s.to_sym].try(:[],
action_name.to_sym)
if action = options.delete(:action)
render(action:)
else
defined_response.call
end
else
# The action name is needed for processing
options[:action_name] = action_name.to_sym
# If responder is not specified then pass in Spree::Responder
(options.delete(:responder) || Spree::Responder).call(self, resources, options)
end
end
private
def retrieve_collector_from_mimes(mimes = nil, &block)
mimes ||= collect_mimes_from_class_level
collector = Collector.new(mimes, request.variant)
block.call(collector) if block_given?
format = collector.negotiate_format(request)
raise ActionController::UnknownFormat unless format
_process_format(format)
collector
end
end
end
module Spree
module Core
module ControllerHelpers

View File

@@ -145,7 +145,7 @@ RSpec.describe "Customers", swagger_doc: "v1.yaml", feature: :api_v1 do
it "adds balance to each customer" do
get "/api/v1/customers", params: { extra_fields: { customer: :balance } }
balances = json_response[:data].map{ |c| c[:attributes][:balance] }
expect(balances.all?(Numeric)).to eq(true)
expect(balances.all?{ |b| b.is_a? Numeric }).to eq(true)
end
end