Commit 6eff0eaa authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '339235-fj-use-group-linear-ancestor-scopes' into 'master'

Use Group linear ancestor scopes

See merge request gitlab-org/gitlab!70708
parents fcd59974 e2664d38
---
name: linear_ee_group_ancestor_scopes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70708
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341350
milestone: '14.4'
type: development
group: group::access
default_enabled: false
......@@ -614,7 +614,13 @@ module EE
end
def invited_or_shared_group_members(groups)
::GroupMember.active_without_invites_and_requests.where(source_id: ::Gitlab::ObjectHierarchy.new(groups).base_and_ancestors)
groups_and_ancestors = if ::Feature.enabled?(:linear_ee_group_ancestor_scopes, self, default_enabled: :yaml)
groups.self_and_ancestors
else
::Gitlab::ObjectHierarchy.new(groups).base_and_ancestors
end
::GroupMember.active_without_invites_and_requests.where(source_id: groups_and_ancestors)
end
override :_safe_read_repository_read_only_column
......
......@@ -936,6 +936,7 @@ RSpec.describe Namespace do
end
context 'with a group namespace' do
shared_examples 'billable group plan retrieval' do
let(:group) { create(:group) }
let(:developer) { create(:user) }
let(:guest) { create(:user) }
......@@ -1182,6 +1183,17 @@ RSpec.describe Namespace do
end
end
end
it_behaves_like 'billable group plan retrieval'
context 'when feature flag :linear_ee_group_ancestor_scopes is disabled' do
before do
stub_feature_flags(linear_ee_group_ancestor_scopes: false)
end
it_behaves_like 'billable group plan retrieval'
end
end
end
describe '#billable_members_count' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment