Commit c6d6c7fe authored by Mario Celi's avatar Mario Celi

Adds yaml default enabled checks to `work_items` FF

FF checks were missing the default_enabled key. Not
a big deal now, but will be necessary when enabled by default
parent 641cda46
...@@ -33,7 +33,7 @@ module Mutations ...@@ -33,7 +33,7 @@ module Mutations
def resolve(project_path:, **attributes) def resolve(project_path:, **attributes)
project = authorized_find!(project_path) project = authorized_find!(project_path)
unless Feature.enabled?(:work_items, project) unless Feature.enabled?(:work_items, project, default_enabled: :yaml)
return { errors: ['`work_items` feature flag disabled for this project'] } return { errors: ['`work_items` feature flag disabled for this project'] }
end end
......
...@@ -31,7 +31,7 @@ module Mutations ...@@ -31,7 +31,7 @@ module Mutations
def resolve(id:, work_item_data:) def resolve(id:, work_item_data:)
work_item = authorized_find!(id: id) work_item = authorized_find!(id: id)
unless Feature.enabled?(:work_items, work_item.project) unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml)
return { errors: ['`work_items` feature flag disabled for this project'] } return { errors: ['`work_items` feature flag disabled for this project'] }
end end
......
...@@ -20,7 +20,7 @@ module Mutations ...@@ -20,7 +20,7 @@ module Mutations
def resolve(id:) def resolve(id:)
work_item = authorized_find!(id: id) work_item = authorized_find!(id: id)
unless Feature.enabled?(:work_items, work_item.project) unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml)
return { errors: ['`work_items` feature flag disabled for this project'] } return { errors: ['`work_items` feature flag disabled for this project'] }
end end
......
...@@ -28,7 +28,7 @@ module Mutations ...@@ -28,7 +28,7 @@ module Mutations
def resolve(id:, **attributes) def resolve(id:, **attributes)
work_item = authorized_find!(id: id) work_item = authorized_find!(id: id)
unless Feature.enabled?(:work_items, work_item.project) unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml)
return { errors: ['`work_items` feature flag disabled for this project'] } return { errors: ['`work_items` feature flag disabled for this project'] }
end end
......
...@@ -12,7 +12,7 @@ module Resolvers ...@@ -12,7 +12,7 @@ module Resolvers
def resolve(id:) def resolve(id:)
work_item = authorized_find!(id: id) work_item = authorized_find!(id: id)
return unless Feature.enabled?(:work_items, work_item.project) return unless Feature.enabled?(:work_items, work_item.project, default_enabled: :yaml)
work_item work_item
end end
......
...@@ -11,7 +11,7 @@ module Resolvers ...@@ -11,7 +11,7 @@ module Resolvers
' Argument is experimental and can be removed in the future without notice.' ' Argument is experimental and can be removed in the future without notice.'
def resolve(taskable: nil) def resolve(taskable: nil)
return unless Feature.enabled?(:work_items, object) return unless Feature.enabled?(:work_items, object, default_enabled: :yaml)
# This will require a finder in the future when groups/projects get their work item types # This will require a finder in the future when groups/projects get their work item types
# All groups/projects use the default types for now # All groups/projects use the default types for now
......
...@@ -90,7 +90,8 @@ module Types ...@@ -90,7 +90,8 @@ module Types
field :work_item, Types::WorkItemType, field :work_item, Types::WorkItemType,
null: true, null: true,
resolver: Resolvers::WorkItemResolver, resolver: Resolvers::WorkItemResolver,
description: 'Find a work item. Returns `null` if `work_items` feature flag is disabled.' description: 'Find a work item. Returns `null` if `work_items` feature flag is disabled.' \
' The feature is experimental and is subject to change without notice.'
field :merge_request, Types::MergeRequestType, field :merge_request, Types::MergeRequestType,
null: true, null: true,
......
...@@ -568,7 +568,7 @@ Returns [`Vulnerability`](#vulnerability). ...@@ -568,7 +568,7 @@ Returns [`Vulnerability`](#vulnerability).
### `Query.workItem` ### `Query.workItem`
Find a work item. Returns `null` if `work_items` feature flag is disabled. Find a work item. Returns `null` if `work_items` feature flag is disabled. The feature is experimental and is subject to change without notice.
Returns [`WorkItem`](#workitem). Returns [`WorkItem`](#workitem).
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