Commit 44df1a11 authored by Coung Ngo's avatar Coung Ngo

Default :roadmap_graphql and :unfiltered_epic_aggregates FF to on

Default feature flags to on for epic roadmap weights feature
parent 3d13b601
...@@ -1948,8 +1948,7 @@ type Epic implements Noteable { ...@@ -1948,8 +1948,7 @@ type Epic implements Noteable {
descendantCounts: EpicDescendantCount descendantCounts: EpicDescendantCount
""" """
Total weight of open and closed issues in the epic and its descendants. Total weight of open and closed issues in the epic and its descendants
Available only when feature flag `unfiltered_epic_aggregates` is enabled.
""" """
descendantWeightSum: EpicDescendantWeights descendantWeightSum: EpicDescendantWeights
......
...@@ -5731,7 +5731,7 @@ ...@@ -5731,7 +5731,7 @@
}, },
{ {
"name": "descendantWeightSum", "name": "descendantWeightSum",
"description": "Total weight of open and closed issues in the epic and its descendants. Available only when feature flag `unfiltered_epic_aggregates` is enabled.", "description": "Total weight of open and closed issues in the epic and its descendants",
"args": [ "args": [
], ],
......
...@@ -317,7 +317,7 @@ Represents an epic. ...@@ -317,7 +317,7 @@ Represents an epic.
| `closedAt` | Time | Timestamp of the epic's closure | | `closedAt` | Time | Timestamp of the epic's closure |
| `createdAt` | Time | Timestamp of the epic's creation | | `createdAt` | Time | Timestamp of the epic's creation |
| `descendantCounts` | EpicDescendantCount | Number of open and closed descendant epics and issues | | `descendantCounts` | EpicDescendantCount | Number of open and closed descendant epics and issues |
| `descendantWeightSum` | EpicDescendantWeights | Total weight of open and closed issues in the epic and its descendants. Available only when feature flag `unfiltered_epic_aggregates` is enabled. | | `descendantWeightSum` | EpicDescendantWeights | Total weight of open and closed issues in the epic and its descendants |
| `description` | String | Description of the epic | | `description` | String | Description of the epic |
| `downvotes` | Int! | Number of downvotes the epic has received | | `downvotes` | Int! | Number of downvotes the epic has received |
| `dueDate` | Time | Due date of the epic | | `dueDate` | Time | Due date of the epic |
......
...@@ -17,8 +17,8 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -17,8 +17,8 @@ class Groups::EpicsController < Groups::ApplicationController
before_action :verify_group_bulk_edit_enabled!, only: [:bulk_update] before_action :verify_group_bulk_edit_enabled!, only: [:bulk_update]
before_action do before_action do
push_frontend_feature_flag(:roadmap_graphql, @group) push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true)
push_frontend_feature_flag(:unfiltered_epic_aggregates, @group) 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
......
...@@ -10,8 +10,8 @@ module Groups ...@@ -10,8 +10,8 @@ module Groups
before_action :check_epics_available! before_action :check_epics_available!
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) push_frontend_feature_flag(:roadmap_graphql, @group, default_enabled: true)
push_frontend_feature_flag(:unfiltered_epic_aggregates, @group) 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
......
...@@ -125,7 +125,7 @@ module Types ...@@ -125,7 +125,7 @@ module Types
field :descendant_counts, Types::EpicDescendantCountType, null: true, complexity: 10, field :descendant_counts, Types::EpicDescendantCountType, null: true, complexity: 10,
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) 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 else
Epics::DescendantCountService.new(epic, ctx[:current_user]) Epics::DescendantCountService.new(epic, ctx[:current_user])
...@@ -134,7 +134,6 @@ module Types ...@@ -134,7 +134,6 @@ module Types
field :descendant_weight_sum, Types::EpicDescendantWeightSumType, null: true, complexity: 10, field :descendant_weight_sum, Types::EpicDescendantWeightSumType, null: true, complexity: 10,
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",
feature_flag: :unfiltered_epic_aggregates,
resolve: -> (epic, args, ctx) do resolve: -> (epic, args, ctx) do
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, WEIGHT_SUM) Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, WEIGHT_SUM)
end end
......
...@@ -108,53 +108,5 @@ describe 'Epic aggregates (count and weight)' do ...@@ -108,53 +108,5 @@ describe 'Epic aggregates (count and weight)' do
) )
end end
end end
context 'with feature flag disabled' do
before do
stub_feature_flags(unfiltered_epic_aggregates: false)
end
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 an error' do
post_graphql(query, current_user: current_user)
expect_graphql_errors_to_include /Field 'descendantWeightSum' doesn't exist on type 'Epic/
end
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