Commit 891f27a5 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'graphql_docs_consider_feature_flag_enabled' into 'master'

Consider flags disabled when generating GraphQL schema

See merge request gitlab-org/gitlab!25172
parents 80b61c32 557af754
...@@ -8,13 +8,24 @@ namespace :gitlab do ...@@ -8,13 +8,24 @@ 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
# to avoid pipeline failures in case developer
# dumps schema with flags enabled locally before pushing
task disable_feature_flags: :environment do
class Feature
def self.enabled?(*args)
false
end
end
end
# Defines tasks for dumping the GraphQL schema: # Defines tasks for dumping the GraphQL schema:
# - gitlab:graphql:schema:dump # - gitlab:graphql:schema:dump
# - gitlab:graphql:schema:idl # - gitlab:graphql:schema:idl
# - gitlab:graphql:schema:json # - gitlab:graphql:schema:json
GraphQL::RakeTask.new( GraphQL::RakeTask.new(
schema_name: 'GitlabSchema', schema_name: 'GitlabSchema',
dependencies: [:environment], dependencies: [:environment, :disable_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"
......
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