diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/version_check_helper.rb | 4 | ||||
-rw-r--r-- | app/models/ci/build.rb | 4 | ||||
-rw-r--r-- | app/models/concerns/chronic_duration_attribute.rb | 2 | ||||
-rw-r--r-- | app/models/container_expiration_policy.rb | 2 | ||||
-rw-r--r-- | app/services/projects/container_repository/cleanup_tags_base_service.rb | 2 | ||||
-rw-r--r-- | app/validators/duration_validator.rb | 2 |
6 files changed, 7 insertions, 9 deletions
diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index 895155e00d1..45a4b292eb5 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -10,14 +10,12 @@ module VersionCheckHelper end def gitlab_version_check - return unless show_version_check? - VersionCheck.new.response end strong_memoize_attr :gitlab_version_check def show_security_patch_upgrade_alert? - return false unless gitlab_version_check + return false unless show_version_check? && gitlab_version_check Gitlab::Utils.to_boolean(gitlab_version_check['critical_vulnerability']) end diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 750c318819c..2abb8e4be48 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -414,7 +414,7 @@ module Ci end def options_scheduled_at - ChronicDuration.parse(options[:start_in])&.seconds&.from_now + ChronicDuration.parse(options[:start_in], use_complete_matcher: true)&.seconds&.from_now end def action? @@ -738,7 +738,7 @@ module Ci def artifacts_expire_in=(value) self.artifacts_expire_at = if value - ChronicDuration.parse(value)&.seconds&.from_now + ChronicDuration.parse(value, use_complete_matcher: true)&.seconds&.from_now end end diff --git a/app/models/concerns/chronic_duration_attribute.rb b/app/models/concerns/chronic_duration_attribute.rb index 44b34cf9b2f..7b7b61fdf06 100644 --- a/app/models/concerns/chronic_duration_attribute.rb +++ b/app/models/concerns/chronic_duration_attribute.rb @@ -18,7 +18,7 @@ module ChronicDurationAttribute begin new_value = if value.present? - ChronicDuration.parse(value).to_i + ChronicDuration.parse(value, use_complete_matcher: true).to_i else parameters[:default].presence end diff --git a/app/models/container_expiration_policy.rb b/app/models/container_expiration_policy.rb index a7ed5e28695..f643fa7730b 100644 --- a/app/models/container_expiration_policy.rb +++ b/app/models/container_expiration_policy.rb @@ -80,7 +80,7 @@ class ContainerExpirationPolicy < ApplicationRecord end def set_next_run_at - cadence_seconds = ChronicDuration.parse(cadence).seconds + cadence_seconds = ChronicDuration.parse(cadence, use_complete_matcher: true).seconds self.next_run_at = Time.zone.now + cadence_seconds end diff --git a/app/services/projects/container_repository/cleanup_tags_base_service.rb b/app/services/projects/container_repository/cleanup_tags_base_service.rb index 45557d03502..61b09de1643 100644 --- a/app/services/projects/container_repository/cleanup_tags_base_service.rb +++ b/app/services/projects/container_repository/cleanup_tags_base_service.rb @@ -100,7 +100,7 @@ module Projects def older_than_in_seconds strong_memoize(:older_than_in_seconds) do - ChronicDuration.parse(older_than).seconds + ChronicDuration.parse(older_than, use_complete_matcher: true).seconds end end end diff --git a/app/validators/duration_validator.rb b/app/validators/duration_validator.rb index defd28d7d3b..bcdcf665cba 100644 --- a/app/validators/duration_validator.rb +++ b/app/validators/duration_validator.rb @@ -12,7 +12,7 @@ # class DurationValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) - ChronicDuration.parse(value) + ChronicDuration.parse(value, use_complete_matcher: true) rescue ChronicDuration::DurationParseError if options[:message] record.errors.add(:base, options[:message]) |