Commit 75c3b3e9 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch '208863_remove_epic_aggregate_feature_flag' into 'master'

Remove `unfiltered_epic_aggregates` feature flag

See merge request gitlab-org/gitlab!28070
parents 3af09062 b9ae9d66
...@@ -22,6 +22,10 @@ query epicChildEpics( ...@@ -22,6 +22,10 @@ query epicChildEpics(
webUrl webUrl
startDate startDate
dueDate dueDate
descendantWeightSum {
closedIssues
openedIssues
}
group { group {
name name
fullName fullName
......
query epicChildEpics(
$fullPath: ID!
$iid: ID!
$state: EpicState
$sort: EpicSort
$startDate: Time
$dueDate: Time
) {
group(fullPath: $fullPath) {
id
name
epic(iid: $iid) {
id
title
children(state: $state, sort: $sort, startDate: $startDate, endDate: $dueDate) {
edges {
node {
id
title
description
state
webUrl
startDate
dueDate
descendantWeightSum {
closedIssues
openedIssues
}
group {
name
fullName
}
}
}
}
}
}
}
...@@ -29,6 +29,10 @@ query groupEpics( ...@@ -29,6 +29,10 @@ query groupEpics(
webUrl webUrl
startDate startDate
dueDate dueDate
descendantWeightSum {
closedIssues
openedIssues
}
group { group {
name name
fullName fullName
......
query groupEpics(
$fullPath: ID!
$state: EpicState
$sort: EpicSort
$startDate: Time
$dueDate: Time
$labelName: [String!] = []
$authorUsername: String = ""
$search: String = ""
) {
group(fullPath: $fullPath) {
id
name
epics(
state: $state
sort: $sort
startDate: $startDate
endDate: $dueDate
labelName: $labelName
authorUsername: $authorUsername
search: $search
) {
edges {
node {
id
title
description
state
webUrl
startDate
dueDate
descendantWeightSum {
closedIssues
openedIssues
}
group {
name
fullName
}
}
}
}
}
}
...@@ -15,8 +15,6 @@ import { EXTEND_AS } from '../constants'; ...@@ -15,8 +15,6 @@ import { EXTEND_AS } from '../constants';
import groupEpics from '../queries/groupEpics.query.graphql'; import groupEpics from '../queries/groupEpics.query.graphql';
import epicChildEpics from '../queries/epicChildEpics.query.graphql'; import epicChildEpics from '../queries/epicChildEpics.query.graphql';
import groupEpicsForUnfilteredEpicAggregatesFeatureFlag from '../queries/groupEpicsForUnfilteredEpicAggregatesFeatureFlag.query.graphql';
import epicChildEpicsForUnfilteredEpicAggregatesFeatureFlag from '../queries/epicChildEpicsForUnfilteredEpicAggregatesFeatureFlag.query.graphql';
import groupMilestones from '../queries/groupMilestones.query.graphql'; import groupMilestones from '../queries/groupMilestones.query.graphql';
import * as types from './mutation_types'; import * as types from './mutation_types';
...@@ -46,15 +44,9 @@ export const fetchGroupEpics = ( ...@@ -46,15 +44,9 @@ export const fetchGroupEpics = (
// and then we don't need to pass `filterParams`. // and then we don't need to pass `filterParams`.
if (epicIid) { if (epicIid) {
query = epicChildEpics; query = epicChildEpics;
if (gon.features && gon.features.unfilteredEpicAggregates) {
query = epicChildEpicsForUnfilteredEpicAggregatesFeatureFlag;
}
variables.iid = epicIid; variables.iid = epicIid;
} else { } else {
query = groupEpics; query = groupEpics;
if (gon.features && gon.features.unfilteredEpicAggregates) {
query = groupEpicsForUnfilteredEpicAggregatesFeatureFlag;
}
variables = { variables = {
...variables, ...variables,
...filterParams, ...filterParams,
......
...@@ -18,7 +18,6 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -18,7 +18,6 @@ class Groups::EpicsController < Groups::ApplicationController
before_action do before_action do
push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true) push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true)
push_frontend_feature_flag(:unfiltered_epic_aggregates, @group, default_enabled: true)
push_frontend_feature_flag(:vue_issuable_epic_sidebar, @group) push_frontend_feature_flag(:vue_issuable_epic_sidebar, @group)
end end
......
...@@ -11,7 +11,6 @@ module Groups ...@@ -11,7 +11,6 @@ module Groups
before_action :persist_roadmap_layout, only: [:show] before_action :persist_roadmap_layout, only: [:show]
before_action do before_action do
push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true) push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true)
push_frontend_feature_flag(:unfiltered_epic_aggregates, @group, default_enabled: true)
push_frontend_feature_flag(:roadmap_buffered_rendering, @group) push_frontend_feature_flag(:roadmap_buffered_rendering, @group)
push_frontend_feature_flag(:milestones_in_roadmap, @group) push_frontend_feature_flag(:milestones_in_roadmap, @group)
end end
......
...@@ -120,23 +120,17 @@ module Types ...@@ -120,23 +120,17 @@ module Types
description: 'A list of issues associated with the epic', description: 'A list of issues associated with the epic',
resolver: Resolvers::EpicIssuesResolver resolver: Resolvers::EpicIssuesResolver
field :descendant_counts, Types::EpicDescendantCountType, null: true, complexity: 10, field :descendant_counts, Types::EpicDescendantCountType, null: true,
description: 'Number of open and closed descendant epics and issues', description: 'Number of open and closed descendant epics and issues',
resolve: -> (epic, args, ctx) do resolve: -> (epic, args, ctx) do
if Feature.enabled?(:unfiltered_epic_aggregates, epic.group, default_enabled: true)
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, COUNT) Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, COUNT)
else
Epics::DescendantCountService.new(epic, ctx[:current_user])
end
end end
field :descendant_weight_sum, Types::EpicDescendantWeightSumType, null: true, complexity: 10, field :descendant_weight_sum, Types::EpicDescendantWeightSumType, null: true,
description: "Total weight of open and closed issues in the epic and its descendants", description: "Total weight of open and closed issues in the epic and its descendants",
resolve: -> (epic, args, ctx) do resolve: -> (epic, args, ctx) do
if Feature.enabled?(:unfiltered_epic_aggregates, epic.group, default_enabled: true)
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, WEIGHT_SUM) Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, WEIGHT_SUM)
end end
end
field :health_status, Types::EpicHealthStatusType, null: true, complexity: 10, field :health_status, Types::EpicHealthStatusType, null: true, complexity: 10,
description: 'Current health status of the epic', description: 'Current health status of the epic',
...@@ -145,16 +139,12 @@ module Types ...@@ -145,16 +139,12 @@ module Types
end end
def has_children? def has_children?
return object.has_children? unless Feature.enabled?(:unfiltered_epic_aggregates, object.group, default_enabled: true)
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object| Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object|
node.children.any? node.children.any?
end end
end end
def has_issues? def has_issues?
return object.has_issues? unless Feature.enabled?(:unfiltered_epic_aggregates, object.group, default_enabled: true)
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object| Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(context, object.id, COUNT) do |node, _aggregate_object|
node.has_issues? node.has_issues?
end end
......
...@@ -132,11 +132,6 @@ describe 'Epic aggregates (count and weight)' do ...@@ -132,11 +132,6 @@ describe 'Epic aggregates (count and weight)' do
end end
end end
context 'with feature flag enabled' do
before do
stub_feature_flags(unfiltered_epic_aggregates: true)
end
it 'uses the LazyEpicAggregate service' do it 'uses the LazyEpicAggregate service' do
# one for count, one for weight_sum, even though the share the same tree state as part of the context # one for count, one for weight_sum, even though the share the same tree state as part of the context
expect(Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate).to receive(:new).twice expect(Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate).to receive(:new).twice
...@@ -183,56 +178,4 @@ describe 'Epic aggregates (count and weight)' do ...@@ -183,56 +178,4 @@ describe 'Epic aggregates (count and weight)' do
it_behaves_like 'efficient query' it_behaves_like 'efficient query'
end end
end end
context 'with feature flag disabled' do
before do
stub_feature_flags(unfiltered_epic_aggregates: false)
end
it_behaves_like 'having correct values for', 'hasChildren'
it_behaves_like 'having correct values for', 'hasIssues'
context 'when requesting counts' do
let(:epic_aggregates_query) do
<<~QUERY
nodes {
descendantCounts {
openedEpics
closedEpics
openedIssues
closedIssues
}
}
QUERY
end
it 'uses the DescendantCountService' do
expect(Epics::DescendantCountService).to receive(:new)
post_graphql(query, current_user: current_user)
end
it_behaves_like 'counts properly'
end
context 'when requesting weights' do
let(:epic_aggregates_query) do
<<~QUERY
nodes {
descendantWeightSum {
openedIssues
closedIssues
}
}
QUERY
end
it 'returns nil' do
post_graphql(query, current_user: current_user)
expect(subject).to include(a_hash_including('descendantWeightSum' => nil))
end
end
end
end
end end
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