Commit 7e83ecf9 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch...

Merge branch '5164-default-roadmap_graphql-and-unfiltered_epic_aggregates-feature-flags-to-on' into 'master'

Default :roadmap_graphql and :unfiltered_epic_aggregates feature flags to on

See merge request gitlab-org/gitlab!26919
parents d1513457 10f331dc
...@@ -1988,8 +1988,7 @@ type Epic implements Noteable { ...@@ -1988,8 +1988,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
......
...@@ -5847,7 +5847,7 @@ ...@@ -5847,7 +5847,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": [
], ],
......
...@@ -327,7 +327,7 @@ Represents an epic. ...@@ -327,7 +327,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,9 +134,10 @@ module Types ...@@ -134,9 +134,10 @@ 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) if Feature.enabled?(:unfiltered_epic_aggregates, epic.group, default_enabled: true)
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,
......
---
title: Add Roadmap GraphQL and unfiltered epic aggregates
merge_request: 26919
author:
type: added
...@@ -149,10 +149,10 @@ describe 'Epic aggregates (count and weight)' do ...@@ -149,10 +149,10 @@ describe 'Epic aggregates (count and weight)' do
QUERY QUERY
end end
it 'returns an error' do it 'returns nil' do
post_graphql(query, current_user: current_user) post_graphql(query, current_user: current_user)
expect_graphql_errors_to_include /Field 'descendantWeightSum' doesn't exist on type 'Epic/ 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