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
8d5607a8
Commit
8d5607a8
authored
May 05, 2020
by
Imre Farkas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove share_group_with_group feature flag
The feature is default enabled since 12.7.
parent
972c347a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
298 deletions
+119
-298
app/controllers/groups/group_links_controller.rb
app/controllers/groups/group_links_controller.rb
+0
-5
app/models/group.rb
app/models/group.rb
+0
-2
app/views/groups/group_members/index.html.haml
app/views/groups/group_members/index.html.haml
+9
-13
ee/app/models/ee/group.rb
ee/app/models/ee/group.rb
+0
-4
ee/spec/models/ee/namespace_spec.rb
ee/spec/models/ee/namespace_spec.rb
+34
-99
spec/controllers/groups/group_links_controller_spec.rb
spec/controllers/groups/group_links_controller_spec.rb
+0
-36
spec/features/groups/members/manage_groups_spec.rb
spec/features/groups/members/manage_groups_spec.rb
+33
-52
spec/models/group_spec.rb
spec/models/group_spec.rb
+43
-87
No files found.
app/controllers/groups/group_links_controller.rb
View file @
8d5607a8
# frozen_string_literal: true
class
Groups::GroupLinksController
<
Groups
::
ApplicationController
before_action
:check_feature_flag!
before_action
:authorize_admin_group!
before_action
:group_link
,
only:
[
:update
,
:destroy
]
...
...
@@ -51,8 +50,4 @@ class Groups::GroupLinksController < Groups::ApplicationController
def
group_link_params
params
.
require
(
:group_link
).
permit
(
:group_access
,
:expires_at
)
end
def
check_feature_flag!
render_404
unless
Feature
.
enabled?
(
:share_group_with_group
,
default_enabled:
true
)
end
end
app/models/group.rb
View file @
8d5607a8
...
...
@@ -520,8 +520,6 @@ class Group < Namespace
end
def
max_member_access_for_user_from_shared_groups
(
user
)
return
unless
Feature
.
enabled?
(
:share_group_with_group
,
default_enabled:
true
)
group_group_link_table
=
GroupGroupLink
.
arel_table
group_member_table
=
GroupMember
.
arel_table
...
...
app/views/groups/group_members/index.html.haml
View file @
8d5607a8
...
...
@@ -9,7 +9,6 @@
=
_
(
"Group members"
)
%hr
-
if
can_manage_members
-
if
Feature
.
enabled?
(
:share_group_with_group
,
default_enabled:
true
)
%ul
.nav-links.nav.nav-tabs.gitlab-tabs
{
role:
'tablist'
}
%li
.nav-tab
{
role:
'presentation'
}
%a
.nav-link.active
{
href:
'#invite-member-pane'
,
id:
'invite-member-tab'
,
data:
{
toggle:
'tab'
},
role:
'tab'
}=
_
(
"Invite member"
)
...
...
@@ -18,11 +17,8 @@
.tab-content.gitlab-tab-content
.tab-pane.active
{
id:
'invite-member-pane'
,
role:
'tabpanel'
}
=
render_invite_member_for_group
(
@group
,
@group_member
.
access_level
)
-
if
Feature
.
enabled?
(
:share_group_with_group
,
default_enabled:
true
)
.tab-pane
{
id:
'invite-group-pane'
,
role:
'tabpanel'
}
=
render
'shared/members/invite_group'
,
submit_url:
group_group_links_path
(
@group
),
access_levels:
GroupMember
.
access_level_roles
,
default_access_level:
@group_member
.
access_level
,
group_link_field:
'shared_with_group_id'
,
group_access_field:
'shared_group_access'
-
else
=
render_invite_member_for_group
(
@group
,
@group_member
.
access_level
)
=
render
'shared/members/requests'
,
membership_source:
@group
,
requesters:
@requesters
...
...
ee/app/models/ee/group.rb
View file @
8d5607a8
...
...
@@ -401,14 +401,10 @@ module EE
# Members belonging to Groups invited to collaborate with Groups and Subgroups
def
billed_shared_group_members
return
::
GroupMember
.
none
unless
::
Feature
.
enabled?
(
:share_group_with_group
)
invited_or_shared_group_members
(
invited_group_in_groups
)
end
def
billed_shared_non_guests_group_members
return
::
GroupMember
.
none
unless
::
Feature
.
enabled?
(
:share_group_with_group
)
invited_or_shared_group_members
(
invited_non_guest_group_in_groups
)
end
...
...
ee/spec/models/ee/namespace_spec.rb
View file @
8d5607a8
...
...
@@ -965,22 +965,6 @@ describe Namespace do
shared_group:
group
})
end
context
'when feature is not enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'does not include users coming from the shared groups'
,
:aggregate_failures
do
expect
(
group
.
billed_user_ids
).
to
match_array
([
developer
.
id
])
expect
(
shared_group
.
billed_user_ids
).
not_to
include
([
developer
.
id
])
end
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
true
)
end
it
'includes active users from the shared group to the billed members'
,
:aggregate_failures
do
expect
(
group
.
billed_user_ids
).
to
match_array
([
shared_group_developer
.
id
,
developer
.
id
])
expect
(
shared_group
.
billed_user_ids
).
not_to
include
([
developer
.
id
])
...
...
@@ -1024,7 +1008,6 @@ describe Namespace do
end
end
end
end
context
'with other plans'
do
%i[bronze_plan silver_plan]
.
each
do
|
plan
|
...
...
@@ -1089,21 +1072,6 @@ describe Namespace do
shared_group:
group
})
end
context
'when feature is not enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'does not include users coming from the shared groups'
do
expect
(
group
.
billed_user_ids
).
to
match_array
([
developer
.
id
,
guest
.
id
])
end
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
true
)
end
it
'includes active users from the shared group including guests'
,
:aggregate_failures
do
expect
(
group
.
billed_user_ids
).
to
match_array
([
developer
.
id
,
guest
.
id
,
shared_group_developer
.
id
,
shared_group_guest
.
id
])
expect
(
shared_group
.
billed_user_ids
).
to
match_array
([
shared_group_developer
.
id
,
shared_group_guest
.
id
])
...
...
@@ -1113,7 +1081,6 @@ describe Namespace do
end
end
end
end
describe
'#billable_members_count'
do
context
'with a user namespace'
do
...
...
@@ -1186,27 +1153,11 @@ describe Namespace do
shared_group:
group
})
end
context
'when feature is not enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'does not include users coming from the shared groups'
do
expect
(
group
.
billable_members_count
).
to
eq
(
1
)
end
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
true
)
end
it
'includes active users from the shared group to the billed members count'
do
expect
(
group
.
billable_members_count
).
to
eq
(
2
)
end
end
end
end
context
'with other plans'
do
%i[bronze_plan silver_plan]
.
each
do
|
plan
|
...
...
@@ -1260,21 +1211,6 @@ describe Namespace do
shared_group:
group
})
end
context
'when feature is not enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'does not include users coming from the shared groups'
do
expect
(
group
.
billable_members_count
).
to
eq
(
2
)
end
end
context
'when feature is enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
true
)
end
it
'includes active users from the shared group including guests to the billed members count'
do
expect
(
group
.
billable_members_count
).
to
eq
(
4
)
end
...
...
@@ -1283,7 +1219,6 @@ describe Namespace do
end
end
end
end
describe
'#file_template_project_id'
do
it
'is cleared before validation'
do
...
...
spec/controllers/groups/group_links_controller_spec.rb
View file @
8d5607a8
...
...
@@ -99,18 +99,6 @@ describe Groups::GroupLinksController do
expect
(
flash
[
:alert
]).
to
eq
(
'error'
)
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'renders 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'when user does not have access to the group'
do
...
...
@@ -184,18 +172,6 @@ describe Groups::GroupLinksController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'renders 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'#destroy'
do
...
...
@@ -231,17 +207,5 @@ describe Groups::GroupLinksController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'renders 404'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
end
spec/features/groups/members/manage_groups_spec.rb
View file @
8d5607a8
...
...
@@ -15,11 +15,6 @@ describe 'Groups > Members > Manage groups', :js do
sign_in
(
user
)
end
context
'with share groups with groups feature flag'
do
before
do
stub_feature_flags
(
shared_with_group:
true
)
end
it
'add group to group'
do
visit
group_group_members_path
(
shared_group
)
...
...
@@ -72,18 +67,4 @@ describe 'Groups > Members > Manage groups', :js do
click_button
"Invite"
end
end
end
context
'without share groups with groups feature flag'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
it
'does not render invitation form and tabs'
do
visit
group_group_members_path
(
shared_group
)
expect
(
page
).
not_to
have_link
(
'Invite member'
)
expect
(
page
).
not_to
have_link
(
'Invite group'
)
end
end
end
spec/models/group_spec.rb
View file @
8d5607a8
...
...
@@ -560,11 +560,6 @@ describe Group do
group_access:
GroupMember
::
DEVELOPER
})
end
context
'when feature flag share_group_with_group is enabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
true
)
end
context
'with user in the group'
do
let
(
:user
)
{
group_user
}
...
...
@@ -635,43 +630,6 @@ describe Group do
end
end
context
'when feature flag share_group_with_group is disabled'
do
before
do
stub_feature_flags
(
share_group_with_group:
false
)
end
context
'with user in the group'
do
let
(
:user
)
{
group_user
}
it
'returns correct access level'
do
expect
(
shared_group_parent
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group_child
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
end
end
context
'with user in the parent group'
do
let
(
:user
)
{
parent_group_user
}
it
'returns correct access level'
do
expect
(
shared_group_parent
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group_child
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
end
end
context
'with user in the child group'
do
let
(
:user
)
{
child_group_user
}
it
'returns correct access level'
do
expect
(
shared_group_parent
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
expect
(
shared_group_child
.
max_member_access_for_user
(
user
)).
to
eq
(
Gitlab
::
Access
::
NO_ACCESS
)
end
end
end
end
context
'multiple groups shared with group'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
:private
)
}
...
...
@@ -679,8 +637,6 @@ describe Group do
let
(
:shared_group
)
{
create
(
:group
,
:private
,
parent:
shared_group_parent
)
}
before
do
stub_feature_flags
(
share_group_with_group:
true
)
group
.
add_owner
(
user
)
create
(
:group_group_link
,
{
shared_with_group:
group
,
...
...
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