Commit a464f2cc authored by Felipe Artur's avatar Felipe Artur

Scope save_issuable_health_status flag to group

Scope save_issuable_health_status feature flag to
group on backend and remove it from GraphQL
parent ac4c5ded
...@@ -2548,7 +2548,7 @@ type EpicIssue implements Noteable { ...@@ -2548,7 +2548,7 @@ type EpicIssue implements Noteable {
epicIssueId: ID! epicIssueId: ID!
""" """
Current health status. Available only when feature flag `save_issuable_health_status` is enabled Current health status. Returns null if `save_issuable_health_status` feature flag is disabled.
""" """
healthStatus: HealthStatus healthStatus: HealthStatus
...@@ -3539,7 +3539,7 @@ type Issue implements Noteable { ...@@ -3539,7 +3539,7 @@ type Issue implements Noteable {
epic: Epic epic: Epic
""" """
Current health status. Available only when feature flag `save_issuable_health_status` is enabled Current health status. Returns null if `save_issuable_health_status` feature flag is disabled.
""" """
healthStatus: HealthStatus healthStatus: HealthStatus
......
...@@ -7397,7 +7397,7 @@ ...@@ -7397,7 +7397,7 @@
}, },
{ {
"name": "healthStatus", "name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled", "description": "Current health status. Returns null if `save_issuable_health_status` feature flag is disabled.",
"args": [ "args": [
], ],
...@@ -10125,7 +10125,7 @@ ...@@ -10125,7 +10125,7 @@
}, },
{ {
"name": "healthStatus", "name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled", "description": "Current health status. Returns null if `save_issuable_health_status` feature flag is disabled.",
"args": [ "args": [
], ],
......
...@@ -419,7 +419,7 @@ Relationship between an epic and an issue ...@@ -419,7 +419,7 @@ Relationship between an epic and an issue
| `dueDate` | Time | Due date of the issue | | `dueDate` | Time | Due date of the issue |
| `epic` | Epic | Epic to which this issue belongs | | `epic` | Epic | Epic to which this issue belongs |
| `epicIssueId` | ID! | ID of the epic-issue relation | | `epicIssueId` | ID! | ID of the epic-issue relation |
| `healthStatus` | HealthStatus | Current health status. Available only when feature flag `save_issuable_health_status` is enabled | | `healthStatus` | HealthStatus | Current health status. Returns null if `save_issuable_health_status` feature flag is disabled. |
| `id` | ID | Global ID of the epic-issue relation | | `id` | ID | Global ID of the epic-issue relation |
| `iid` | ID! | Internal ID of the issue | | `iid` | ID! | Internal ID of the issue |
| `milestone` | Milestone | Milestone of the issue | | `milestone` | Milestone | Milestone of the issue |
...@@ -540,7 +540,7 @@ Autogenerated return type of EpicTreeReorder ...@@ -540,7 +540,7 @@ Autogenerated return type of EpicTreeReorder
| `downvotes` | Int! | Number of downvotes the issue has received | | `downvotes` | Int! | Number of downvotes the issue has received |
| `dueDate` | Time | Due date of the issue | | `dueDate` | Time | Due date of the issue |
| `epic` | Epic | Epic to which this issue belongs | | `epic` | Epic | Epic to which this issue belongs |
| `healthStatus` | HealthStatus | Current health status. Available only when feature flag `save_issuable_health_status` is enabled | | `healthStatus` | HealthStatus | Current health status. Returns null if `save_issuable_health_status` feature flag is disabled. |
| `iid` | ID! | Internal ID of the issue | | `iid` | ID! | Internal ID of the issue |
| `milestone` | Milestone | Milestone of the issue | | `milestone` | Milestone | Milestone of the issue |
| `reference` | String! | Internal reference of the issue. Returned in shortened format by default | | `reference` | String! | Internal reference of the issue. Returned in shortened format by default |
......
...@@ -24,8 +24,8 @@ module EE ...@@ -24,8 +24,8 @@ module EE
field :health_status, field :health_status,
::Types::HealthStatusEnum, ::Types::HealthStatusEnum,
null: true, null: true,
description: 'Current health status', description: 'Current health status. Returns null if `save_issuable_health_status` feature flag is disabled.',
feature_flag: :save_issuable_health_status resolve: -> (obj, _, _) { obj.supports_health_status? ? obj.health_status : nil }
end end
end end
end end
......
...@@ -14,7 +14,8 @@ module HealthStatus ...@@ -14,7 +14,8 @@ module HealthStatus
override :supports_health_status? override :supports_health_status?
def supports_health_status? def supports_health_status?
resource_parent.feature_available?(:issuable_health_status) && return false unless resource_parent&.feature_available?(:issuable_health_status)
::Feature.enabled?(:save_issuable_health_status, resource_parent)
::Feature.enabled?(:save_issuable_health_status, resource_parent.try(:group))
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