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
4e006d3c
Commit
4e006d3c
authored
Nov 30, 2021
by
Francisco Javier López
Committed by
Vitali Tatarintev
Nov 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use linear version UserGroupNotificationSettingsFinder#execute
parent
0f685998
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
114 deletions
+139
-114
app/finders/user_group_notification_settings_finder.rb
app/finders/user_group_notification_settings_finder.rb
+6
-1
config/feature_flags/development/linear_user_group_notification_settings_finder_ancestors_scopes.yml
...r_group_notification_settings_finder_ancestors_scopes.yml
+8
-0
spec/finders/user_group_notification_settings_finder_spec.rb
spec/finders/user_group_notification_settings_finder_spec.rb
+125
-113
No files found.
app/finders/user_group_notification_settings_finder.rb
View file @
4e006d3c
...
...
@@ -8,7 +8,12 @@ class UserGroupNotificationSettingsFinder
def
execute
# rubocop: disable CodeReuse/ActiveRecord
groups_with_ancestors
=
Gitlab
::
ObjectHierarchy
.
new
(
Group
.
where
(
id:
groups
.
select
(
:id
))).
base_and_ancestors
selected_groups
=
Group
.
where
(
id:
groups
.
select
(
:id
))
groups_with_ancestors
=
if
Feature
.
enabled?
(
:linear_user_group_notification_settings_finder_ancestors_scopes
,
user
,
default_enabled: :yaml
)
selected_groups
.
self_and_ancestors
else
Gitlab
::
ObjectHierarchy
.
new
(
selected_groups
).
base_and_ancestors
end
# rubocop: enable CodeReuse/ActiveRecord
@loaded_groups_with_ancestors
=
groups_with_ancestors
.
index_by
(
&
:id
)
...
...
config/feature_flags/development/linear_user_group_notification_settings_finder_ancestors_scopes.yml
0 → 100644
View file @
4e006d3c
---
name
:
linear_user_group_notification_settings_finder_ancestors_scopes
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74606
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/345792
milestone
:
'
14.6'
type
:
development
group
:
group::access
default_enabled
:
false
spec/finders/user_group_notification_settings_finder_spec.rb
View file @
4e006d3c
This diff is collapsed.
Click to expand it.
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