From 9c50fa7c8399a0ac8fe604cde674a0fc879b9fbb Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 13:56:38 -0300 Subject: [PATCH 01/13] Create Group#users_with_descendants method --- app/models/group.rb | 6 ++++++ spec/models/group_spec.rb | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/app/models/group.rb b/app/models/group.rb index a02eb74599fb..17590f90d497 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -266,6 +266,12 @@ def users_with_parents User.where(id: members_with_parents.select(:user_id)) end + def users_with_descendants + members_with_descendants = GroupMember.non_request.where(source_id: descendants.pluck(:id).push(id)) + + User.where(id: members_with_descendants.select(:user_id)) + end + def max_member_access_for_user(user) return GroupMember::OWNER if user.admin? diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 5a441a13a004..fd8f2ef8fc6d 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -385,6 +385,25 @@ def setup_group_members(group) end end + describe '#users_with_descendants', :nested_groups do + let(:user_a) { create(:user) } + let(:user_b) { create(:user) } + + let(:group) { create(:group) } + let(:nested_group) { create(:group, parent: group) } + let(:deep_nested_group) { create(:group, parent: nested_group) } + + it 'returns member users on every nest level without duplication' do + group.add_developer(user_a) + nested_group.add_developer(user_b) + deep_nested_group.add_developer(user_a) + + expect(group.users_with_descendants).to contain_exactly(user_a, user_b) + expect(nested_group.users_with_descendants).to contain_exactly(user_a, user_b) + expect(deep_nested_group.users_with_descendants).to contain_exactly(user_a) + end + end + describe '#user_ids_for_project_authorizations' do it 'returns the user IDs for which to refresh authorizations' do master = create(:user) -- GitLab From a0f9e4d63a79f92472a3969c1b597fed738edf05 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 16:27:11 -0300 Subject: [PATCH 02/13] Add members_count and parent_id info on /namespaces API --- doc/api/namespaces.md | 13 ++++++++++++- lib/api/entities.rb | 5 +++++ spec/requests/api/namespaces_spec.rb | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index 4ad6071a0ed2..21e3a1628c0b 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -29,18 +29,27 @@ Example response: { "id": 1, "path": "user1", - "kind": "user" + "kind": "user", + "full_path": "user1", + "parent_id": "null", + "members_count": "null" }, { "id": 2, "path": "group1", "kind": "group" + "full_path": "group1", + "parent_id": "null", + "members_count": 2 }, { "id": 3, "path": "bar", "kind": "group", "full_path": "foo/bar", + "parent_id": "9", + "members_count": 5 + }, } ] ``` @@ -72,6 +81,8 @@ Example response: "path": "twitter", "kind": "group", "full_path": "twitter", + "parent_id": "null", + "members_count": 2 } ] ``` diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 5e5c24156590..cd3bdf901b39 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -513,6 +513,11 @@ class Namespace < Grape::Entity expose :id, :name, :path, :kind, :full_path # EE-only + expose :parent_id + expose :members_count do |namespace, _| + namespace.users_with_descendants.count if namespace.kind == 'group' + end + expose :shared_runners_minutes_limit, if: lambda { |_, options| options[:current_user]&.admin? } expose :plan, if: lambda { |_, options| options[:current_user]&.admin? } end diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index 18f1b4ccb887..f14d3df17ed7 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -15,6 +15,14 @@ end context "when authenticated as admin" do + it "returns correct attributes" do + get api("/namespaces", admin) + + expect(response).to have_http_status(200) + expect(response).to include_pagination_headers + expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count') + end + it "admin: returns an array of all namespaces" do get api("/namespaces", admin) @@ -37,6 +45,14 @@ end context "when authenticated as a regular user" do + it "returns correct attributes" do + get api("/namespaces", user) + + expect(response).to have_http_status(200) + expect(response).to include_pagination_headers + expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count') + end + it "user: returns an array of namespaces" do get api("/namespaces", user) -- GitLab From d7eefd11d11e1bb2cce27ce5ad741c001d61ecd1 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 16:39:50 -0300 Subject: [PATCH 03/13] Pass current_user to present method to add admin exclusive fields --- lib/api/namespaces.rb | 2 +- spec/requests/api/namespaces_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index 97942f6ec060..6d2ec3a70809 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -17,7 +17,7 @@ class Namespaces < Grape::API namespaces = namespaces.search(params[:search]) if params[:search].present? - present paginate(namespaces), with: Entities::Namespace + present paginate(namespaces), with: Entities::Namespace, current_user: current_user end desc 'Update a namespace' do diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index f14d3df17ed7..edd38617e18c 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -20,7 +20,8 @@ expect(response).to have_http_status(200) expect(response).to include_pagination_headers - expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count') + expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', + 'members_count', 'shared_runners_minutes_limit', 'plan') end it "admin: returns an array of all namespaces" do -- GitLab From 3d91443880b73824eaef60de5382b4443cae48d2 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 17:46:49 -0300 Subject: [PATCH 04/13] Remove wrong brace --- doc/api/namespaces.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index 21e3a1628c0b..d76fe40323a1 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -49,7 +49,6 @@ Example response: "full_path": "foo/bar", "parent_id": "9", "members_count": 5 - }, } ] ``` -- GitLab From a65f21a7ee34213679d110ce684812eac592227f Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 17:51:29 -0300 Subject: [PATCH 05/13] Rearrange Namespace exposures according to CE additions --- lib/api/entities.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/api/entities.rb b/lib/api/entities.rb index cd3bdf901b39..d23a4ddc4bf1 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -510,14 +510,13 @@ class Todo < Grape::Entity end class Namespace < Grape::Entity - expose :id, :name, :path, :kind, :full_path + expose :id, :name, :path, :kind, :full_path, :parent_id - # EE-only - expose :parent_id expose :members_count do |namespace, _| namespace.users_with_descendants.count if namespace.kind == 'group' end + # EE-only expose :shared_runners_minutes_limit, if: lambda { |_, options| options[:current_user]&.admin? } expose :plan, if: lambda { |_, options| options[:current_user]&.admin? } end -- GitLab From 6a6c8c821ff3cc545320f32fb162de351918c2c1 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 27 Jun 2017 19:53:00 -0300 Subject: [PATCH 06/13] Adjust projects spec on namespace fields --- spec/requests/api/projects_spec.rb | 4 +++- spec/requests/api/v3/projects_spec.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 58cce26e354b..abeb8db4f6ff 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -748,7 +748,9 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path + 'full_path' => user.namespace.full_path, + 'parent_id' => nil, + 'members_count' => nil }) end diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index 9b26929a167d..da7d21b17d3a 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -785,7 +785,9 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path + 'full_path' => user.namespace.full_path, + 'parent_id' => nil, + 'members_count' => nil }) end -- GitLab From a5fc5b14886ed1ad1ed0d671ac4b8e952e6f689d Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 17:27:01 -0300 Subject: [PATCH 07/13] Rename members_count to members_count_with_descendants and expose only to group admins --- doc/api/namespaces.md | 12 +++++------ lib/api/entities.rb | 8 +++++-- lib/api/namespaces.rb | 2 ++ spec/requests/api/namespaces_spec.rb | 30 +++++++++++++++++++++------ spec/requests/api/projects_spec.rb | 4 +--- spec/requests/api/v3/projects_spec.rb | 4 +--- 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index d76fe40323a1..438a2989de1b 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -30,9 +30,7 @@ Example response: "id": 1, "path": "user1", "kind": "user", - "full_path": "user1", - "parent_id": "null", - "members_count": "null" + "full_path": "user1" }, { "id": 2, @@ -40,7 +38,7 @@ Example response: "kind": "group" "full_path": "group1", "parent_id": "null", - "members_count": 2 + "members_count_with_descendants": 2 }, { "id": 3, @@ -48,11 +46,13 @@ Example response: "kind": "group", "full_path": "foo/bar", "parent_id": "9", - "members_count": 5 + "members_count_with_descendants": 5 } ] ``` +**Note**: `members_count_with_descendants` are presented only for group masters/owners. + ## Search for namespace Get all namespaces that match a string in their name or path. @@ -81,7 +81,7 @@ Example response: "kind": "group", "full_path": "twitter", "parent_id": "null", - "members_count": 2 + "members_count_with_descendants": 2 } ] ``` diff --git a/lib/api/entities.rb b/lib/api/entities.rb index d23a4ddc4bf1..27331ebf09e6 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -512,8 +512,12 @@ class Todo < Grape::Entity class Namespace < Grape::Entity expose :id, :name, :path, :kind, :full_path, :parent_id - expose :members_count do |namespace, _| - namespace.users_with_descendants.count if namespace.kind == 'group' + expose :members_count_with_descendants, if: -> (namespace, opts) { expose_members_count_with_descendants?(namespace, opts) } do |namespace, _| + namespace.users_with_descendants.count + end + + def expose_members_count_with_descendants?(namespace, opts) + namespace.kind == 'group' && Ability.allowed?(opts[:current_user], :admin_group, namespace) end # EE-only diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index 6d2ec3a70809..761cca30bbe6 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -39,6 +39,8 @@ class Namespaces < Grape::API else render_validation_error!(namespace) end + + present paginate(namespaces), with: Entities::Namespace, current_user: current_user end end end diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index edd38617e18c..4be6d070edec 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -18,10 +18,15 @@ it "returns correct attributes" do get api("/namespaces", admin) + group_kind_json_response = json_response.find { |resource| resource['kind'] == 'group' } + user_kind_json_response = json_response.find { |resource| resource['kind'] == 'user' } + expect(response).to have_http_status(200) expect(response).to include_pagination_headers - expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', - 'members_count', 'shared_runners_minutes_limit', 'plan') + expect(group_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', + 'parent_id', 'members_count_with_descendants') + + expect(user_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', 'parent_id') end it "admin: returns an array of all namespaces" do @@ -46,12 +51,25 @@ end context "when authenticated as a regular user" do - it "returns correct attributes" do + it "returns members_count_with_descendants if user can admin group" do + group1.add_owner(user) + get api("/namespaces", user) - expect(response).to have_http_status(200) - expect(response).to include_pagination_headers - expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count') + owned_group_response = json_response.find { |resource| resource['id'] == group1.id } + + expect(owned_group_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', + 'parent_id', 'members_count_with_descendants') + end + + it "does not returns members_count_with_descendants if user cannot admin group" do + group1.add_guest(user) + + get api("/namespaces", user) + + guest_group_response = json_response.find { |resource| resource['id'] == group1.id } + + expect(guest_group_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', 'parent_id') end it "user: returns an array of namespaces" do diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index abeb8db4f6ff..58cce26e354b 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -748,9 +748,7 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path, - 'parent_id' => nil, - 'members_count' => nil + 'full_path' => user.namespace.full_path }) end diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index da7d21b17d3a..9b26929a167d 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -785,9 +785,7 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path, - 'parent_id' => nil, - 'members_count' => nil + 'full_path' => user.namespace.full_path }) end -- GitLab From a0eb43bab2d9c128336dcdfeb242a290b25cdb5d Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 17:55:50 -0300 Subject: [PATCH 08/13] Improve tests text --- spec/requests/api/namespaces_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index 4be6d070edec..80d1ef9918bb 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -51,7 +51,7 @@ end context "when authenticated as a regular user" do - it "returns members_count_with_descendants if user can admin group" do + it "returns correct attributes when user can admin group" do group1.add_owner(user) get api("/namespaces", user) @@ -62,7 +62,7 @@ 'parent_id', 'members_count_with_descendants') end - it "does not returns members_count_with_descendants if user cannot admin group" do + it "returns correct attributes when user cannot admin group" do group1.add_guest(user) get api("/namespaces", user) -- GitLab From 381b42197f3b437cbeb72a26b7d6795f406cbec6 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 20:01:43 -0300 Subject: [PATCH 09/13] Add parent_id back to the tests --- spec/requests/api/projects_spec.rb | 3 ++- spec/requests/api/v3/projects_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 58cce26e354b..2ee8b51281fe 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -748,7 +748,8 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path + 'full_path' => user.namespace.full_path, + 'parent_id' => nil }) end diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index 9b26929a167d..c1c1ed660933 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -785,7 +785,8 @@ 'name' => user.namespace.name, 'path' => user.namespace.path, 'kind' => user.namespace.kind, - 'full_path' => user.namespace.full_path + 'full_path' => user.namespace.full_path, + 'parent_id' => nil }) end -- GitLab From c49b3f5fc2cab7d40bca78a3e9ae203d4e1558fb Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 20:15:58 -0300 Subject: [PATCH 10/13] Adjust wrong conflict resolutions --- lib/api/namespaces.rb | 2 -- spec/requests/api/namespaces_spec.rb | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index 761cca30bbe6..6d2ec3a70809 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -39,8 +39,6 @@ class Namespaces < Grape::API else render_validation_error!(namespace) end - - present paginate(namespaces), with: Entities::Namespace, current_user: current_user end end end diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index 80d1ef9918bb..7b417b23f6b9 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -24,9 +24,11 @@ expect(response).to have_http_status(200) expect(response).to include_pagination_headers expect(group_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', - 'parent_id', 'members_count_with_descendants') + 'parent_id', 'members_count_with_descendants', + 'plan', 'shared_runners_minutes_limit') - expect(user_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', 'parent_id') + expect(user_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', + 'parent_id', 'plan', 'shared_runners_minutes_limit') end it "admin: returns an array of all namespaces" do -- GitLab From 3d14cd023ec178b354c8fdbede0cc8d4c8578c91 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 20:41:58 -0300 Subject: [PATCH 11/13] Present "plan" data for group/namespace admins --- doc/api/namespaces.md | 5 +++-- lib/api/entities.rb | 2 +- spec/requests/api/namespaces_spec.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/namespaces.md b/doc/api/namespaces.md index 438a2989de1b..35250e9e2634 100644 --- a/doc/api/namespaces.md +++ b/doc/api/namespaces.md @@ -38,7 +38,8 @@ Example response: "kind": "group" "full_path": "group1", "parent_id": "null", - "members_count_with_descendants": 2 + "members_count_with_descendants": 2, + "plan": "bronze" }, { "id": 3, @@ -51,7 +52,7 @@ Example response: ] ``` -**Note**: `members_count_with_descendants` are presented only for group masters/owners. +**Note**: `members_count_with_descendants` and `plan` are presented only for group masters/owners. ## Search for namespace diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 27331ebf09e6..91d76ab3bf1a 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -522,7 +522,7 @@ def expose_members_count_with_descendants?(namespace, opts) # EE-only expose :shared_runners_minutes_limit, if: lambda { |_, options| options[:current_user]&.admin? } - expose :plan, if: lambda { |_, options| options[:current_user]&.admin? } + expose :plan, if: -> (namespace, opts) { Ability.allowed?(opts[:current_user], :admin_namespace, namespace) } end class MemberAccess < Grape::Entity diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index 7b417b23f6b9..56b3e2a10c56 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -61,7 +61,7 @@ owned_group_response = json_response.find { |resource| resource['id'] == group1.id } expect(owned_group_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', - 'parent_id', 'members_count_with_descendants') + 'plan', 'parent_id', 'members_count_with_descendants') end it "returns correct attributes when user cannot admin group" do -- GitLab From bb0f3f8530987fc734b6e55b1ec99b61c08bd8f8 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 20:46:30 -0300 Subject: [PATCH 12/13] Improve changelog --- ...mbers-counting-and-plan-related-data-on-namespaces-api.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/unreleased/add-group-members-counting-and-plan-related-data-on-namespaces-api.yml diff --git a/changelogs/unreleased/add-group-members-counting-and-plan-related-data-on-namespaces-api.yml b/changelogs/unreleased/add-group-members-counting-and-plan-related-data-on-namespaces-api.yml new file mode 100644 index 000000000000..f2591042e983 --- /dev/null +++ b/changelogs/unreleased/add-group-members-counting-and-plan-related-data-on-namespaces-api.yml @@ -0,0 +1,4 @@ +--- +title: Add group members counting and plan related data on namespaces API +merge_request: +author: -- GitLab From dac45e866894dcd28b80eae35b5c89e34c7c9f30 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 28 Jun 2017 22:53:49 -0300 Subject: [PATCH 13/13] Adjust specs regarding new plan field --- spec/requests/api/projects_spec.rb | 3 ++- spec/requests/api/v3/projects_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 2ee8b51281fe..b7ec7a4a6f0b 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -749,7 +749,8 @@ 'path' => user.namespace.path, 'kind' => user.namespace.kind, 'full_path' => user.namespace.full_path, - 'parent_id' => nil + 'parent_id' => nil, + 'plan' => nil }) end diff --git a/spec/requests/api/v3/projects_spec.rb b/spec/requests/api/v3/projects_spec.rb index c1c1ed660933..aca85240386a 100644 --- a/spec/requests/api/v3/projects_spec.rb +++ b/spec/requests/api/v3/projects_spec.rb @@ -786,7 +786,8 @@ 'path' => user.namespace.path, 'kind' => user.namespace.kind, 'full_path' => user.namespace.full_path, - 'parent_id' => nil + 'parent_id' => nil, + 'plan' => nil }) end -- GitLab