Commit 58ae718f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'bw-graphql-rake-doc-feature-flag' into 'master'

Consider flags enabled when generating GraphQL schema

See merge request gitlab-org/gitlab!26939
parents 8baf987d 6831b25c
...@@ -4987,6 +4987,20 @@ ...@@ -4987,6 +4987,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"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.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "EpicDescendantWeights",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "description", "name": "description",
"description": "Description of the epic", "description": "Description of the epic",
...@@ -9737,6 +9751,20 @@ ...@@ -9737,6 +9751,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "HealthStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "id", "name": "id",
"description": "Global ID of the epic-issue relation", "description": "Global ID of the epic-issue relation",
...@@ -11117,6 +11145,20 @@ ...@@ -11117,6 +11145,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "HealthStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "iid", "name": "iid",
"description": "Internal ID of the issue", "description": "Internal ID of the issue",
...@@ -13098,6 +13140,47 @@ ...@@ -13098,6 +13140,47 @@
"enumValues": null, "enumValues": null,
"possibleTypes": null "possibleTypes": null
}, },
{
"kind": "OBJECT",
"name": "EpicDescendantWeights",
"description": "Total weight of open and closed descendant issues",
"fields": [
{
"name": "closedIssues",
"description": "Total weight of completed (closed) issues in this epic, including epic descendants",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "openedIssues",
"description": "Total weight of opened issues in this epic, including epic descendants",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{ {
"kind": "OBJECT", "kind": "OBJECT",
"name": "EpicHealthStatus", "name": "EpicHealthStatus",
......
...@@ -8,13 +8,14 @@ namespace :gitlab do ...@@ -8,13 +8,14 @@ namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference") OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/' TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'
# Consider all feature flags disabled # Make all feature flags enabled so that all feature flag
# to avoid pipeline failures in case developer # controlled fields are considered visible and are output.
# dumps schema with flags enabled locally before pushing # Also avoids pipeline failures in case developer
task disable_feature_flags: :environment do # dumps schema with flags disabled locally before pushing
task enable_feature_flags: :environment do
class Feature class Feature
def self.enabled?(*args) def self.enabled?(*args)
false true
end end
end end
end end
...@@ -25,7 +26,7 @@ namespace :gitlab do ...@@ -25,7 +26,7 @@ namespace :gitlab do
# - gitlab:graphql:schema:json # - gitlab:graphql:schema:json
GraphQL::RakeTask.new( GraphQL::RakeTask.new(
schema_name: 'GitlabSchema', schema_name: 'GitlabSchema',
dependencies: [:environment, :disable_feature_flags], dependencies: [:environment, :enable_feature_flags],
directory: OUTPUT_DIR, directory: OUTPUT_DIR,
idl_outfile: "gitlab_schema.graphql", idl_outfile: "gitlab_schema.graphql",
json_outfile: "gitlab_schema.json" json_outfile: "gitlab_schema.json"
...@@ -33,7 +34,7 @@ namespace :gitlab do ...@@ -33,7 +34,7 @@ namespace :gitlab do
namespace :graphql do namespace :graphql do
desc 'GitLab | GraphQL | Generate GraphQL docs' desc 'GitLab | GraphQL | Generate GraphQL docs'
task compile_docs: :environment do task compile_docs: [:environment, :enable_feature_flags] do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options) renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
renderer.write renderer.write
...@@ -42,7 +43,7 @@ namespace :gitlab do ...@@ -42,7 +43,7 @@ namespace :gitlab do
end end
desc 'GitLab | GraphQL | Check if GraphQL docs are up to date' desc 'GitLab | GraphQL | Check if GraphQL docs are up to date'
task check_docs: :environment do task check_docs: [:environment, :enable_feature_flags] do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options) renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
doc = File.read(Rails.root.join(OUTPUT_DIR, 'index.md')) doc = File.read(Rails.root.join(OUTPUT_DIR, 'index.md'))
...@@ -56,7 +57,7 @@ namespace :gitlab do ...@@ -56,7 +57,7 @@ namespace :gitlab do
end end
desc 'GitLab | GraphQL | Check if GraphQL schemas are up to date' desc 'GitLab | GraphQL | Check if GraphQL schemas are up to date'
task check_schema: :environment do task check_schema: [:environment, :enable_feature_flags] do
idl_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.graphql')) idl_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.graphql'))
json_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.json')) json_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.json'))
......
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