Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#63518] move some localization to report models

Eric Schubertef9bc376cc0e
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/base_connection_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/base_connection_validator.rb
index 7ce347d053e..f7735efb6f0 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/base_connection_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/base_connection_validator.rb
@@ -37,8 +37,8 @@ module Storages
@validation_groups ||= {}
end
- def register_group(group_name, klass, precondition: ->(*) { true })
- validation_groups[group_name] = { klass:, precondition: }
+ def register_group(klass, precondition: ->(*) { true })
+ validation_groups[klass.key] = { klass:, precondition: }
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb b/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb
index 0cb08d92694..2ca1df1afcd 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/base_validator_group.rb
@@ -38,9 +38,11 @@ module Storages
new(storage).call
end
+ def self.key = raise Errors::SubclassResponsibility
+
def initialize(storage)
@storage = storage
- @results = ValidationGroupResult.new
+ @results = ValidationGroupResult.new(self.class.key)
end
def call
@@ -67,13 +69,13 @@ module Storages
update_result(key, CheckResult.success(key))
end
- def fail_check(key, code)
- update_result(key, CheckResult.failure(key, code))
+ def fail_check(key, code, context: {})
+ update_result(key, CheckResult.failure(key, code, context))
throw :interrupted
end
- def warn_check(key, code, halt_validation: false)
- update_result(key, CheckResult.warning(key, code))
+ def warn_check(key, code, context: {}, halt_validation: false)
+ update_result(key, CheckResult.warning(key, code, context))
throw :interrupted if halt_validation
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/check_result.rb b/modules/storages/app/common/storages/peripherals/connection_validators/check_result.rb
index f0065f32a89..4020495fea7 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/check_result.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/check_result.rb
@@ -31,23 +31,23 @@
module Storages
module Peripherals
module ConnectionValidators
- CheckResult = Data.define(:key, :state, :code, :timestamp) do
+ CheckResult = Data.define(:key, :state, :code, :timestamp, :context) do
private_class_method :new
def self.skipped(key)
- new(key:, state: :skipped, code: nil, timestamp: nil)
+ new(key:, state: :skipped, code: nil, timestamp: nil, context: nil)
end
- def self.failure(key, code)
- new(key:, state: :failure, code:, timestamp: Time.zone.now)
+ def self.failure(key, code, context)
+ new(key:, state: :failure, code:, timestamp: Time.zone.now, context:)
end
def self.success(key)
- new(key:, state: :success, code: nil, timestamp: Time.zone.now)
+ new(key:, state: :success, code: nil, timestamp: Time.zone.now, context: nil)
end
- def self.warning(key, code)
- new(key:, state: :warning, code:, timestamp: Time.zone.now)
+ def self.warning(key, code, context)
+ new(key:, state: :warning, code:, timestamp: Time.zone.now, context:)
end
def success? = state == :success
@@ -57,6 +57,14 @@ module Storages
def warning? = state == :warning
def skipped? = state == :skipped
+
+ def humanize_title(group) = I18n.t("storages.health.checks.#{group}.#{key}")
+
+ def humanize_error_message
+ return nil if code.nil?
+
+ I18n.t("storages.health.connection_validation.#{code}", **context)
+ end
end
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
index e9d20df81cf..c2ada69c2b5 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/ampf_configuration_validator.rb
@@ -35,6 +35,8 @@ module Storages
class AmpfConfigurationValidator < BaseValidatorGroup
using ServiceResultRefinements
+ def self.key = :ampf_configuration
+
private
def validate
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
index 4c130a5edd2..79dd76df0cb 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
@@ -33,6 +33,8 @@ module Storages
module ConnectionValidators
module Nextcloud
class AuthenticationValidator < BaseValidatorGroup
+ def self.key = :authentication
+
def initialize(storage)
super
@user = User.current
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
index fc9dde5e3ef..afc28b44ce6 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/storage_configuration_validator.rb
@@ -33,6 +33,8 @@ module Storages
module ConnectionValidators
module Nextcloud
class StorageConfigurationValidator < BaseValidatorGroup
+ def self.key = :base_configuration
+
private
def validate
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
index 20ec6c4e7ae..fcd10da5c7c 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud_validator.rb
@@ -33,13 +33,16 @@ module Storages
module ConnectionValidators
class NextcloudValidator < BaseConnectionValidator
- register_group :base_configuration, Nextcloud::StorageConfigurationValidator
- register_group :authentication, Nextcloud::AuthenticationValidator,
- precondition: ->(_, result) { result.group(:base_configuration).non_failure? }
- register_group :ampf_configuration, Nextcloud::AmpfConfigurationValidator,
- precondition: ->(storage, result) {
- result.group(:base_configuration).non_failure? && storage.automatic_management_enabled?
- }
+ register_group Nextcloud::StorageConfigurationValidator
+ register_group Nextcloud::AuthenticationValidator,
+ precondition: ->(_, result) do
+ result.group(Nextcloud::StorageConfigurationValidator.key).non_failure?
+ end
+ register_group Nextcloud::AmpfConfigurationValidator,
+ precondition: ->(storage, result) do
+ result.group(Nextcloud::StorageConfigurationValidator.key).non_failure? &&
+ storage.automatic_management_enabled?
+ end
end
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator.rb
index a3adada855c..3aba33debe4 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator.rb
@@ -35,6 +35,8 @@ module Storages
class AmpfConfigurationValidator < BaseValidatorGroup
TEST_FOLDER_NAME = "OpenProjectConnectionValidationFolder"
+ def self.key = :ampf_configuration
+
private
def validate
@@ -78,7 +80,7 @@ module Storages
.on_success { pass_check(:client_folder_creation) }
.on_failure do
code = it.result == :already_exists ? :od_existing_test_folder : :od_client_write_permission_missing
- fail_check(:client_folder_creation, code)
+ fail_check(:client_folder_creation, code, context: { folder_name: TEST_FOLDER_NAME })
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
index c7b1ecd3738..ebeb60c4a01 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
@@ -33,6 +33,8 @@ module Storages
module ConnectionValidators
module OneDrive
class AuthenticationValidator < BaseValidatorGroup
+ def self.key = :authentication
+
def initialize(storage)
super
@user = User.current
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/storage_configuration_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/storage_configuration_validator.rb
index 684511a49eb..a5a07fe1ec2 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/storage_configuration_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/storage_configuration_validator.rb
@@ -35,6 +35,8 @@ module Storages
class StorageConfigurationValidator < BaseValidatorGroup
using ServiceResultRefinements
+ def self.key = :base_configuration
+
private
def validate
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive_validator.rb
index c280bae9085..c517610b62e 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive_validator.rb
@@ -32,10 +32,10 @@ module Storages
module Peripherals
module ConnectionValidators
class OneDriveValidator < BaseConnectionValidator
- register_group :base_configuration, OneDrive::StorageConfigurationValidator
- register_group :authentication, OneDrive::AuthenticationValidator,
+ register_group OneDrive::StorageConfigurationValidator
+ register_group OneDrive::AuthenticationValidator,
precondition: ->(_, result) { result.group(:base_configuration).non_failure? }
- register_group :ampf_configuration, OneDrive::AmpfConfigurationValidator,
+ register_group OneDrive::AmpfConfigurationValidator,
precondition: ->(storage, result) {
result.group(:base_configuration).non_failure? && storage.automatic_management_enabled?
}
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb b/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb
index 60df21e45f2..0ada5194903 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/validation_group_result.rb
@@ -34,7 +34,10 @@ module Storages
class ValidationGroupResult
delegate :[], :each_pair, to: :@results
- def initialize
+ attr_reader :key
+
+ def initialize(key)
+ @key = key
@results = {}
end
@@ -69,6 +72,19 @@ module Storages
def timestamp
@results.values.filter_map(&:timestamp).max
end
+
+ def humanize_title = I18n.t("storages.health.checks.#{key}.header")
+
+ def humanize_summary
+ case tally
+ in { failure: 1.. }
+ I18n.t("storages.health.checks.failures", count: tally[:failure])
+ in { warning: 1.. }
+ I18n.t("storages.health.checks.warnings", count: tally[:warning])
+ else
+ I18n.t("storages.health.checks.failures", count: 0)
+ end
+ end
end
end
end
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb b/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb
index b4e659d498e..647b39f735a 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/validator_result.rb
@@ -41,10 +41,13 @@ module Storages
end
def healthy? = group_results.values.all?(&:success?)
+
def unhealthy? = group_results.values.any?(&:failure?)
+
def warning? = group_results.values.any?(&:warning?)
def group(key) = group_results.fetch(key)
+
alias_method :fetch, :group
def add_group_result(key, result)
@@ -62,6 +65,17 @@ module Storages
def latest_timestamp
group_results.values.filter_map(&:timestamp).max
end
+
+ def humanize_summary
+ case tally
+ in { failure: 1.. }
+ I18n.t("storages.health.checks.failures", count: tally[:failure])
+ in { warning: 1.. }
+ I18n.t("storages.health.checks.warnings", count: tally[:warning])
+ else
+ I18n.t("storages.health.checks.failures", count: 0)
+ end
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/health/check_result_component.rb b/modules/storages/app/components/storages/admin/health/check_result_component.rb
index 11077439173..f1134ce3521 100644
--- a/modules/storages/app/components/storages/admin/health/check_result_component.rb
+++ b/modules/storages/app/components/storages/admin/health/check_result_component.rb
@@ -43,11 +43,11 @@ module Storages
def data
@data ||= {
- text: I18n.t("storages.health.checks.#{@group}.#{model.key}"),
+ text: model.humanize_title(@group),
status_color:,
status_text:,
error_code:,
- error_text:,
+ error_text: model.humanize_error_message,
docs_href: ::OpenProject::Static::Links.url_for(:storage_docs, :health_status)
}
end
@@ -60,12 +60,6 @@ module Storages
end
end
- def error_text
- return nil if model.success? || model.skipped?
-
- I18n.t("storages.health.connection_validation.#{model.code}")
- end
-
def status_color
if model.success?
:success
diff --git a/modules/storages/app/components/storages/admin/health/health_report_component.html.erb b/modules/storages/app/components/storages/admin/health/health_report_component.html.erb
index f5c4fb3a4f9..e1a01c016c5 100644
--- a/modules/storages/app/components/storages/admin/health/health_report_component.html.erb
+++ b/modules/storages/app/components/storages/admin/health/health_report_component.html.erb
@@ -48,36 +48,42 @@ See COPYRIGHT and LICENSE files for more details.
else
flex_layout do |report_container|
report_container.with_row do
- summary = data[:summary]
- concat(render(Primer::Beta::Octicon.new(icon: summary[:icon], color: summary[:icon_color], mr: 2)))
- concat(render(Primer::Beta::Text.new(font_weight: :bold)) { summary[:text] })
+ concat(render(Primer::Beta::Octicon.new(mr: 2, **summary_icon(@report.tally))))
+ concat(render(Primer::Beta::Text.new(font_weight: :bold)) { @report.humanize_summary })
end
report_container.with_row(mt: 2) do
- render(Primer::Beta::Text.new) { data[:description] }
+ render(Primer::Beta::Text.new) do
+ if @report.healthy?
+ I18n.t("storages.health.summary.success")
+ elsif @report.unhealthy?
+ I18n.t("storages.health.summary.failure")
+ else
+ I18n.t("storages.health.summary.warning")
+ end
+ end
end
- @report.each_pair do |group, checks|
+ @report.each_pair do |_key, group_result|
report_container.with_row(mt: 3) do
render(Primer::Beta::BorderBox.new(test_selector: "op-storages--health-report-group")) do |box|
box.with_header do
flex_layout(justify_content: :space_between) do |header|
header.with_column do
- render(Primer::Beta::Text.new(font_weight: :bold)) do
- I18n.t("storages.health.checks.#{group}.header")
- end
+ render(Primer::Beta::Text.new(font_weight: :bold)) { group_result.humanize_title }
end
header.with_column do
- summary = summary_with_icon(checks.tally)
- concat(render(Primer::Beta::Octicon.new(icon: summary[:icon], color: summary[:icon_color], mr: 2)))
- concat(render(Primer::Beta::Text.new) { summary[:text] })
+ concat(render(Primer::Beta::Octicon.new(mr: 2, **summary_icon(group_result.tally))))
+ concat(render(Primer::Beta::Text.new) { group_result.humanize_summary })
end
end
end
- checks.each_pair do |_key, value|
- box.with_row { render(Storages::Admin::Health::CheckResultComponent.new(group:, result: value)) }
+ group_result.each_pair do |_key, value|
+ box.with_row do
+ render(Storages::Admin::Health::CheckResultComponent.new(group: group_result.key, result: value))
+ end
end
end
end
diff --git a/modules/storages/app/components/storages/admin/health/health_report_component.rb b/modules/storages/app/components/storages/admin/health/health_report_component.rb
index 083e5d8b0a2..015df6d0563 100644
--- a/modules/storages/app/components/storages/admin/health/health_report_component.rb
+++ b/modules/storages/app/components/storages/admin/health/health_report_component.rb
@@ -42,59 +42,14 @@ module Storages
private
- def data
- @data ||= compute_display_data
- end
-
- def compute_display_data
- return {} if @report.nil?
-
- description = if @report.healthy?
- I18n.t("storages.health.summary.success")
- elsif @report.unhealthy?
- I18n.t("storages.health.summary.failure")
- else
- I18n.t("storages.health.summary.warning")
- end
-
- {
- summary: summary_with_icon(@report.tally),
- description:
- }
- end
-
- def group_summary(group)
- icon = group.failure? || group.warning? ? :alert : "check-circle"
- icon_color = if group.failure?
- :danger
- elsif group.warning?
- :attention
- else
- :success
- end
-
- checks = group.tally
- key = group.failure? || group.success? ? :failure : :warning
-
- { icon:, icon_color:, text: I18n.t("storages.health.checks.#{key.to_s.pluralize}", count: checks[key]) }
- end
-
- def summary_with_icon(check_tally)
+ def summary_icon(check_tally)
case check_tally
in { failure: 1.. }
- {
- icon: :alert,
- icon_color: :danger,
- text: I18n.t("storages.health.checks.failures", count: check_tally[:failure])
- }
+ { icon: :alert, color: :danger }
in { warning: 1.. }
- {
- icon: :alert,
- icon_color: :attention,
- text: I18n.t("storages.health.checks.warnings", count: check_tally[:warning])
- }
+ { icon: :alert, color: :attention }
else
- { icon: :"check-circle", icon_color: :success, text: I18n.t("storages.health.checks.failures", count: 0) }
+ { icon: :"check-circle", color: :success }
end
end
end
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index bdcfac6ab93..90c3f286e86 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -290,7 +290,7 @@ en:
od_client_write_permission_missing: The client seems to have write permissions missing. Please check the setup documentation for your storage.
od_drive_id_invalid: The configured drive id seems invalid. Please check the configuration.
od_drive_id_not_found: The configured drive id could not be found. Please check the configuration.
- od_existing_test_folder: The folder name needed for testing already exists. Please delete it and try again.
+ od_existing_test_folder: The folder %{folder_name} needed for testing already exists. Please delete it and try again.
od_oauth_request_not_found: OpenProject couldn't find the root folder in the drive using the current logged-in user. Please check the server logs for further information.
od_oauth_request_unauthorized: The current user isn't authorized to see the root folder of OneDrive/SharePoint or we couldn't acquire a token. Please check the server logs for further information.
od_oauth_token_missing: OpenProject cannot test the user level communication with OneDrive/SharePoint as the user did not yet link their Microsoft account.
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/base_connection_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/base_connection_validator_spec.rb
index 5aaaaade745..943dd3d4c08 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/base_connection_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/base_connection_validator_spec.rb
@@ -53,7 +53,7 @@ module Storages
it "only runs a verification if the precondition evaluates as truthy" do
test_group = class_spy(Nextcloud::StorageConfigurationValidator)
- TestValidator.register_group :test_group, test_group, precondition: ->(_, _) { false }
+ TestValidator.register_group test_group, precondition: ->(_, _) { false }
result = validator.call
expect(result).to be_empty
@@ -61,15 +61,17 @@ module Storages
end
it "aggregates all the results from the tests", vcr: "nextcloud/capabilities_success" do
- TestValidator.register_group :base_configuration, Nextcloud::StorageConfigurationValidator
- TestValidator.register_group :authentication, Nextcloud::AuthenticationValidator,
- precondition: ->(_, result) { result.group(:base_configuration).non_failure? }
+ TestValidator.register_group Nextcloud::StorageConfigurationValidator
+ TestValidator.register_group Nextcloud::AuthenticationValidator,
+ precondition: ->(_, result) do
+ result.group(Nextcloud::StorageConfigurationValidator.key).non_failure?
+ end
results = TestValidator.new(create(:nextcloud_storage_with_local_connection)).call
expect(results).to be_warning
- expect(results.group(:base_configuration)).to be_success
- expect(results.group(:authentication)).to be_warning
+ expect(results.group(Nextcloud::StorageConfigurationValidator.key)).to be_success
+ expect(results.group(Nextcloud::AuthenticationValidator.key)).to be_warning
end
end
end
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator_spec.rb
index 7345a5bfc4f..0774feb7814 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/ampf_configuration_validator_spec.rb
@@ -78,6 +78,7 @@ module Storages
result = validator.call
expect(result[:client_folder_creation]).to be_a_failure
expect(result[:client_folder_creation].code).to eq(:od_existing_test_folder)
+ expect(result[:client_folder_creation].context[:folder_name]).to eq(folder_name)
ensure
StorageInteraction::OneDrive::DeleteFolderCommand.call(storage:, auth_strategy:, location: created_folder)
end
diff --git a/modules/storages/spec/components/storages/admin/health/check_result_component_spec.rb b/modules/storages/spec/components/storages/admin/health/check_result_component_spec.rb
index 00cd0d1443c..93c71579597 100644
--- a/modules/storages/spec/components/storages/admin/health/check_result_component_spec.rb
+++ b/modules/storages/spec/components/storages/admin/health/check_result_component_spec.rb
@@ -66,7 +66,7 @@ RSpec.describe Storages::Admin::Health::CheckResultComponent, type: :component d
context "if check result is a warning" do
let(:group_key) { :ampf_configuration }
let(:check_result) do
- Storages::Peripherals::ConnectionValidators::CheckResult.warning(:drive_contents, :od_unexpected_content)
+ Storages::Peripherals::ConnectionValidators::CheckResult.warning(:drive_contents, :od_unexpected_content, nil)
end
it "renders the component" do
@@ -80,7 +80,7 @@ RSpec.describe Storages::Admin::Health::CheckResultComponent, type: :component d
context "if check result is a failure" do
let(:check_result) do
- Storages::Peripherals::ConnectionValidators::CheckResult.failure(:capabilities_request, :unknown_error)
+ Storages::Peripherals::ConnectionValidators::CheckResult.failure(:capabilities_request, :unknown_error, nil)
end
it "renders the component" do
diff --git a/modules/storages/spec/components/storages/admin/health/health_report_component_spec.rb b/modules/storages/spec/components/storages/admin/health/health_report_component_spec.rb
index 9424106d03a..eb5d903bed0 100644
--- a/modules/storages/spec/components/storages/admin/health/health_report_component_spec.rb
+++ b/modules/storages/spec/components/storages/admin/health/health_report_component_spec.rb
@@ -87,7 +87,7 @@ RSpec.describe Storages::Admin::Health::HealthReportComponent, type: :component
private
def generate_test_group(group_key, checks)
- group = Storages::Peripherals::ConnectionValidators::ValidationGroupResult.new
+ group = Storages::Peripherals::ConnectionValidators::ValidationGroupResult.new(group_key)
checks.each_with_index do |check, idx|
key = :"check_#{idx + 1}"
@@ -95,9 +95,9 @@ RSpec.describe Storages::Admin::Health::HealthReportComponent, type: :component
when :success
Storages::Peripherals::ConnectionValidators::CheckResult.success(key)
when :warning
- Storages::Peripherals::ConnectionValidators::CheckResult.warning(key, :"#{key}_warning")
+ Storages::Peripherals::ConnectionValidators::CheckResult.warning(key, :"#{key}_warning", nil)
when :failure
- Storages::Peripherals::ConnectionValidators::CheckResult.failure(key, :"#{key}_failure")
+ Storages::Peripherals::ConnectionValidators::CheckResult.failure(key, :"#{key}_failure", nil)
else
Storages::Peripherals::ConnectionValidators::CheckResult.skipped(key)
end