summaryrefslogtreecommitdiff
path: root/app/services/namespaces
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/namespaces')
-rw-r--r--app/services/namespaces/in_product_marketing_emails_service.rb14
-rw-r--r--app/services/namespaces/package_settings/update_service.rb5
-rw-r--r--app/services/namespaces/statistics_refresher_service.rb2
3 files changed, 17 insertions, 4 deletions
diff --git a/app/services/namespaces/in_product_marketing_emails_service.rb b/app/services/namespaces/in_product_marketing_emails_service.rb
index eb81253bc08..61d5ed3bdf4 100644
--- a/app/services/namespaces/in_product_marketing_emails_service.rb
+++ b/app/services/namespaces/in_product_marketing_emails_service.rb
@@ -66,7 +66,6 @@ module Namespaces
Experiment.add_group(:in_product_marketing_emails, variant: variant, group: group)
end
- # rubocop: disable CodeReuse/ActiveRecord
def groups_for_track
onboarding_progress_scope = OnboardingProgress
.completed_actions_with_latest_in_range(completed_actions, range)
@@ -75,9 +74,18 @@ module Namespaces
# Filtering out sub-groups is a temporary fix to prevent calling
# `.root_ancestor` on groups that are not root groups.
# See https://gitlab.com/groups/gitlab-org/-/epics/5594 for more information.
- Group.where(parent_id: nil).joins(:onboarding_progress).merge(onboarding_progress_scope)
+ Group
+ .top_most
+ .with_onboarding_progress
+ .merge(onboarding_progress_scope)
+ .merge(subscription_scope)
+ end
+
+ def subscription_scope
+ {}
end
+ # rubocop: disable CodeReuse/ActiveRecord
def users_for_group(group)
group.users
.where(email_opted_in: true)
@@ -136,3 +144,5 @@ module Namespaces
end
end
end
+
+Namespaces::InProductMarketingEmailsService.prepend_mod
diff --git a/app/services/namespaces/package_settings/update_service.rb b/app/services/namespaces/package_settings/update_service.rb
index 0964963647a..cbadbe5c907 100644
--- a/app/services/namespaces/package_settings/update_service.rb
+++ b/app/services/namespaces/package_settings/update_service.rb
@@ -5,7 +5,10 @@ module Namespaces
class UpdateService < BaseContainerService
include Gitlab::Utils::StrongMemoize
- ALLOWED_ATTRIBUTES = %i[maven_duplicates_allowed maven_duplicate_exception_regex].freeze
+ ALLOWED_ATTRIBUTES = %i[maven_duplicates_allowed
+ maven_duplicate_exception_regex
+ generic_duplicates_allowed
+ generic_duplicate_exception_regex].freeze
def execute
return ServiceResponse.error(message: 'Access Denied', http_status: 403) unless allowed?
diff --git a/app/services/namespaces/statistics_refresher_service.rb b/app/services/namespaces/statistics_refresher_service.rb
index c07b302839b..805060cdee9 100644
--- a/app/services/namespaces/statistics_refresher_service.rb
+++ b/app/services/namespaces/statistics_refresher_service.rb
@@ -9,7 +9,7 @@ module Namespaces
root_storage_statistics.recalculate!
rescue ActiveRecord::ActiveRecordError => e
- raise RefresherError.new(e.message)
+ raise RefresherError, e.message
end
private