Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
379621f6
Commit
379621f6
authored
Jun 11, 2021
by
David Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove notification_setting_recipient_refactor feature flag
Changelog: other
parent
1a9a0e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
68 deletions
+1
-68
app/services/notification_recipients/builder/base.rb
app/services/notification_recipients/builder/base.rb
+0
-45
config/feature_flags/development/notification_setting_recipient_refactor.yml
...s/development/notification_setting_recipient_refactor.yml
+0
-8
spec/services/notification_recipients/builder/default_spec.rb
.../services/notification_recipients/builder/default_spec.rb
+1
-15
No files found.
app/services/notification_recipients/builder/base.rb
View file @
379621f6
...
...
@@ -100,25 +100,6 @@ module NotificationRecipients
# Get project/group users with CUSTOM notification level
# rubocop: disable CodeReuse/ActiveRecord
def
add_custom_notifications
return
new_add_custom_notifications
if
Feature
.
enabled?
(
:notification_setting_recipient_refactor
,
project
,
default_enabled: :yaml
)
user_ids
=
[]
# Users with a notification setting on group or project
user_ids
+=
user_ids_notifiable_on
(
project
,
:custom
)
user_ids
+=
user_ids_notifiable_on
(
group
,
:custom
)
# Users with global level custom
user_ids_with_project_level_global
=
user_ids_notifiable_on
(
project
,
:global
)
user_ids_with_group_level_global
=
user_ids_notifiable_on
(
group
,
:global
)
global_users_ids
=
user_ids_with_project_level_global
.
concat
(
user_ids_with_group_level_global
)
user_ids
+=
user_ids_with_global_level_custom
(
global_users_ids
,
custom_action
)
add_recipients
(
user_scope
.
where
(
id:
user_ids
),
:custom
,
nil
)
end
def
new_add_custom_notifications
notification_by_sources
=
related_notification_settings_sources
(
:custom
)
return
if
notification_by_sources
.
blank?
...
...
@@ -172,22 +153,6 @@ module NotificationRecipients
# Get project users with WATCH notification level
# rubocop: disable CodeReuse/ActiveRecord
def
project_watchers
return
new_project_watchers
if
Feature
.
enabled?
(
:notification_setting_recipient_refactor
,
project
,
default_enabled: :yaml
)
project_members_ids
=
user_ids_notifiable_on
(
project
)
user_ids_with_project_global
=
user_ids_notifiable_on
(
project
,
:global
)
user_ids_with_group_global
=
user_ids_notifiable_on
(
project
.
group
,
:global
)
user_ids
=
user_ids_with_global_level_watch
((
user_ids_with_project_global
+
user_ids_with_group_global
).
uniq
)
user_ids_with_project_setting
=
select_project_members_ids
(
user_ids_with_project_global
,
user_ids
)
user_ids_with_group_setting
=
select_group_members_ids
(
project
.
group
,
project_members_ids
,
user_ids_with_group_global
,
user_ids
)
user_scope
.
where
(
id:
user_ids_with_project_setting
.
concat
(
user_ids_with_group_setting
).
uniq
)
end
def
new_project_watchers
notification_by_sources
=
related_notification_settings_sources
(
:watch
)
return
if
notification_by_sources
.
blank?
...
...
@@ -200,16 +165,6 @@ module NotificationRecipients
# rubocop: disable CodeReuse/ActiveRecord
def
group_watchers
return
new_group_watchers
if
Feature
.
enabled?
(
:notification_setting_recipient_refactor
,
project
,
default_enabled: :yaml
)
user_ids_with_group_global
=
user_ids_notifiable_on
(
group
,
:global
)
user_ids
=
user_ids_with_global_level_watch
(
user_ids_with_group_global
)
user_ids_with_group_setting
=
select_group_members_ids
(
group
,
[],
user_ids_with_group_global
,
user_ids
)
user_scope
.
where
(
id:
user_ids_with_group_setting
)
end
def
new_group_watchers
return
[]
unless
group
user_ids
=
group
...
...
config/feature_flags/development/notification_setting_recipient_refactor.yml
deleted
100644 → 0
View file @
1a9a0e69
---
name
:
notification_setting_recipient_refactor
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57688
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/327303
milestone
:
'
13.11'
type
:
development
group
:
group::code review
default_enabled
:
true
spec/services/notification_recipients/builder/default_spec.rb
View file @
379621f6
...
...
@@ -160,21 +160,7 @@ RSpec.describe NotificationRecipients::Builder::Default do
end
end
before
do
stub_feature_flags
(
notification_setting_recipient_refactor:
enabled
)
end
context
'with notification_setting_recipient_refactor enabled'
do
let
(
:enabled
)
{
true
}
it_behaves_like
'custom notification recipients'
end
context
'with notification_setting_recipient_refactor disabled'
do
let
(
:enabled
)
{
false
}
it_behaves_like
'custom notification recipients'
end
it_behaves_like
'custom notification recipients'
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment