Commit 4bf3b647 authored by Nathan Friend's avatar Nathan Friend Committed by Ash McKenzie

Enable `graphql_release_data` feature flag by default

This commit enables the `graphql_release_data` feature flag,
making release data available through the GraphQL endpoint.
parent 31bed4c0
...@@ -15,6 +15,8 @@ module Resolvers ...@@ -15,6 +15,8 @@ module Resolvers
end end
def resolve(tag_name:) def resolve(tag_name:)
return unless Feature.enabled?(:graphql_release_data, project, default_enabled: true)
ReleasesFinder.new( ReleasesFinder.new(
project, project,
current_user, current_user,
......
...@@ -12,6 +12,8 @@ module Resolvers ...@@ -12,6 +12,8 @@ module Resolvers
end end
def resolve(**args) def resolve(**args)
return unless Feature.enabled?(:graphql_release_data, project, default_enabled: true)
ReleasesFinder.new( ReleasesFinder.new(
project, project,
current_user current_user
......
...@@ -243,15 +243,13 @@ module Types ...@@ -243,15 +243,13 @@ module Types
Types::ReleaseType.connection_type, Types::ReleaseType.connection_type,
null: true, null: true,
description: 'Releases of the project', description: 'Releases of the project',
resolver: Resolvers::ReleasesResolver, resolver: Resolvers::ReleasesResolver
feature_flag: :graphql_release_data
field :release, field :release,
Types::ReleaseType, Types::ReleaseType,
null: true, null: true,
description: 'A single release of the project', description: 'A single release of the project',
resolver: Resolvers::ReleasesResolver.single, resolver: Resolvers::ReleasesResolver.single,
feature_flag: :graphql_release_data,
authorize: :download_code authorize: :download_code
field :container_expiration_policy, field :container_expiration_policy,
......
---
title: Add release data to GraphQL endpoint
merge_request: 34937
author:
type: added
...@@ -9289,7 +9289,7 @@ type Project { ...@@ -9289,7 +9289,7 @@ type Project {
publicJobs: Boolean publicJobs: Boolean
""" """
A single release of the project. Available only when feature flag `graphql_release_data` is enabled A single release of the project
""" """
release( release(
""" """
...@@ -9299,7 +9299,7 @@ type Project { ...@@ -9299,7 +9299,7 @@ type Project {
): Release ): Release
""" """
Releases of the project. Available only when feature flag `graphql_release_data` is enabled Releases of the project
""" """
releases( releases(
""" """
......
...@@ -27364,7 +27364,7 @@ ...@@ -27364,7 +27364,7 @@
}, },
{ {
"name": "release", "name": "release",
"description": "A single release of the project. Available only when feature flag `graphql_release_data` is enabled", "description": "A single release of the project",
"args": [ "args": [
{ {
"name": "tagName", "name": "tagName",
...@@ -27391,7 +27391,7 @@ ...@@ -27391,7 +27391,7 @@
}, },
{ {
"name": "releases", "name": "releases",
"description": "Releases of the project. Available only when feature flag `graphql_release_data` is enabled", "description": "Releases of the project",
"args": [ "args": [
{ {
"name": "after", "name": "after",
...@@ -1353,7 +1353,7 @@ Information about pagination in a connection. ...@@ -1353,7 +1353,7 @@ Information about pagination in a connection.
| `pipeline` | Pipeline | Build pipeline of the project | | `pipeline` | Pipeline | Build pipeline of the project |
| `printingMergeRequestLinkEnabled` | Boolean | Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line | | `printingMergeRequestLinkEnabled` | Boolean | Indicates if a link to create or view a merge request should display after a push to Git repositories of the project from the command line |
| `publicJobs` | Boolean | Indicates if there is public access to pipelines and job details of the project, including output logs and artifacts | | `publicJobs` | Boolean | Indicates if there is public access to pipelines and job details of the project, including output logs and artifacts |
| `release` | Release | A single release of the project. Available only when feature flag `graphql_release_data` is enabled | | `release` | Release | A single release of the project |
| `removeSourceBranchAfterMerge` | Boolean | Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project | | `removeSourceBranchAfterMerge` | Boolean | Indicates if `Delete source branch` option should be enabled by default for all new merge requests of the project |
| `repository` | Repository | Git repository of the project | | `repository` | Repository | Git repository of the project |
| `requestAccessEnabled` | Boolean | Indicates if users can request member access to the project | | `requestAccessEnabled` | Boolean | Indicates if users can request member access to the project |
......
...@@ -354,4 +354,21 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do ...@@ -354,4 +354,21 @@ RSpec.describe 'Query.project(fullPath).release(tagName)' do
end end
end end
end end
describe 'ensures that the release data can be contolled by a feature flag' do
context 'when the graphql_release_data feature flag is disabled' do
let_it_be(:project) { create(:project, :repository, :public) }
let_it_be(:release) { create(:release, project: project) }
let(:current_user) { developer }
before do
stub_feature_flags(graphql_release_data: false)
project.add_developer(developer)
end
it_behaves_like 'no access to the release field'
end
end
end end
...@@ -264,4 +264,21 @@ describe 'Query.project(fullPath).releases()' do ...@@ -264,4 +264,21 @@ describe 'Query.project(fullPath).releases()' do
end end
end end
end end
describe 'ensures that the release data can be contolled by a feature flag' do
context 'when the graphql_release_data feature flag is disabled' do
let_it_be(:project) { create(:project, :repository, :public) }
let_it_be(:release) { create(:release, project: project) }
let(:current_user) { developer }
before do
stub_feature_flags(graphql_release_data: false)
project.add_developer(developer)
end
it_behaves_like 'no access to any release data'
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