Commit a246e4e5 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '341349-fj-remove-linear-group-plans-preloader-ancestors-ff' into 'master'

Enable linear GroupPlanPreloader ancestors queries

See merge request gitlab-org/gitlab!72594
parents edf530f5 6905dd1c
---
name: linear_group_plans_preloaded_ancestor_scopes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70685
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/341349
milestone: '14.4'
type: development
group: group::access
default_enabled: false
......@@ -57,15 +57,8 @@ module Gitlab
# Returns an ActiveRecord::Relation that includes the given groups, and all
# their (recursive) ancestors.
def groups_and_ancestors_for(groups)
groups_and_ancestors = if ::Feature.enabled?(:linear_group_plans_preloaded_ancestor_scopes, default_enabled: :yaml)
groups.self_and_ancestors
else
Gitlab::ObjectHierarchy
.new(groups)
.base_and_ancestors
end
groups_and_ancestors
groups
.self_and_ancestors
.join_gitlab_subscription
.select('namespaces.id', 'namespaces.parent_id', 'gitlab_subscriptions.hosted_plan_id')
end
......
......@@ -52,13 +52,5 @@ RSpec.describe Gitlab::GroupPlansPreloader, :saas do
end
it_behaves_like 'preloading cases'
context 'when feature flag :linear_group_plans_preloaded_ancestor_scopes is disabled' do
before do
stub_feature_flags(linear_group_plans_preloaded_ancestor_scopes: false)
end
it_behaves_like 'preloading cases'
end
end
end
......@@ -5,10 +5,21 @@ require 'spec_helper'
RSpec.describe 'Reposition and move issue within board lists' do
include GraphqlHelpers
let_it_be(:group) { create(:group, :private) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:board) { create(:board, group: group) }
let_it_be(:user) { create(:user) }
let_it_be(:group) do
create(:group, :private).tap do |g|
g.add_guest(user)
end
end
let_it_be(:project) do
create(:project, group: group).tap do |p|
p.add_reporter(user)
end
end
let_it_be(:board) { create(:board, group: group) }
let_it_be(:epic) { create(:epic, group: group) }
let_it_be(:existing_issue1) { create(:labeled_issue, project: project, relative_position: 10) }
let_it_be(:existing_issue2) { create(:labeled_issue, project: project, relative_position: 50) }
......@@ -36,15 +47,7 @@ RSpec.describe 'Reposition and move issue within board lists' do
end
context 'when user can admin issue' do
before do
project.add_reporter(user)
end
context 'when user can read epic' do
before do
group.add_guest(user)
end
it 'updates issue position and epic' do
post_graphql_mutation(mutation(params), current_user: user)
......
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