Commit d8ee40bb authored by Francisco Javier López's avatar Francisco Javier López

Merge branch...

Merge branch '339436-fj-use-groups_with_developer_maintainer_project_access-linear-version' into 'master'

Use linear version User#groups_with_developer_maintainer_project_access

See merge request gitlab-org/gitlab!74591
parents a0ab3d66 7c506077
......@@ -2168,12 +2168,7 @@ class User < ApplicationRecord
project_creation_levels << nil
end
if Feature.enabled?(:linear_user_groups_with_developer_maintainer_project_access, self, default_enabled: :yaml)
developer_groups.self_and_descendants.where(project_creation_level: project_creation_levels)
else
developer_groups_hierarchy = ::Gitlab::ObjectHierarchy.new(developer_groups).base_and_descendants
::Group.where(id: developer_groups_hierarchy.select(:id), project_creation_level: project_creation_levels)
end
end
def no_recent_activity?
......
---
name: linear_user_groups_with_developer_maintainer_project_access
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68851
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339436
milestone: '14.3'
type: development
group: group::access
default_enabled: false
......@@ -6246,21 +6246,9 @@ RSpec.describe User do
subject { user.send(:groups_with_developer_maintainer_project_access) }
shared_examples 'groups_with_developer_maintainer_project_access examples' do
specify { is_expected.to contain_exactly(developer_group2) }
end
it_behaves_like 'groups_with_developer_maintainer_project_access examples'
context 'when feature flag :linear_user_groups_with_developer_maintainer_project_access is disabled' do
before do
stub_feature_flags(linear_user_groups_with_developer_maintainer_project_access: false)
end
it_behaves_like 'groups_with_developer_maintainer_project_access examples'
end
end
describe '.get_ids_by_username' do
let(:user_name) { 'user_name' }
let!(:user) { create(:user, username: user_name) }
......
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