Commit ff4dfc27 authored by Mike Kozono's avatar Mike Kozono

Permanently enable package_file_registries field

The feature flag `:geo_package_file_replication` is enabled by default
because we have released the feature. The feature flag check remains, so
that *replication* can be quickly and easily disabled in case a customer
does not need to replicate this resource, or in case there is a serious
bug or infrastructure problem causing excessive replication errors.

At the moment, there is no way to specify that the GraphQL field's
feature flag should default enabled. Additionally, there is no need to
disable the GraphQL API field, regardless of this feature flag, now that
the feature is released. It just exposes the `package_file_registry`
table.

Therefore, this commit safely resolves a bug in which the
`Admin > Geo > Replication > Package files` view (which is enabled by
default because `:geo_package_file_replication` is enabled by default)
cannot access the GraphQL field unless the feature is *explicitly and
manually* enabled.
parent aa840cc8
......@@ -6363,7 +6363,7 @@ type GeoNode {
name: String
"""
Package file registries of the GeoNode. Available only when feature flag `geo_package_file_replication` is enabled
Package file registries of the GeoNode
"""
packageFileRegistries(
"""
......
......@@ -17761,7 +17761,7 @@
},
{
"name": "packageFileRegistries",
"description": "Package file registries of the GeoNode. Available only when feature flag `geo_package_file_replication` is enabled",
"description": "Package file registries of the GeoNode",
"args": [
{
"name": "ids",
......@@ -25,8 +25,7 @@ module Types
field :package_file_registries, ::Types::Geo::PackageFileRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::PackageFileRegistriesResolver,
description: 'Package file registries of the GeoNode',
feature_flag: :geo_package_file_replication
description: 'Package file registries of the GeoNode'
field :terraform_state_registries, ::Types::Geo::TerraformStateRegistryType.connection_type,
null: true,
resolver: ::Resolvers::Geo::TerraformStateRegistriesResolver,
......
---
title: 'Geo: Permanently enable package_file_registries field'
merge_request: 43245
author:
type: fixed
......@@ -4,6 +4,4 @@ introduced_by_url:
rollout_issue_url:
group:
type: development
# it appears that in some places
# `false` is specified vs `true` in other
default_enabled: [false, true]
default_enabled: true
......@@ -5,7 +5,8 @@ RSpec.shared_examples 'gets registries for' do |args|
let(:registry_class_name) { args[:registry_class_name] }
let(:registry_factory) { args[:registry_factory] }
let(:registry_foreign_key_field_name) { args[:registry_foreign_key_field_name] }
let(:feature_flag) { Geo.const_get(registry_class_name, false).replicator_class.replication_enabled_feature_key }
let(:replicator_class) { Geo.const_get(registry_class_name, false).replicator_class }
let(:feature_flag) { replicator_class.replication_enabled_feature_key }
let(:registry_foreign_key) { registry_foreign_key_field_name.underscore }
let(:field_name_sym) { field_name.underscore.to_sym }
......@@ -108,17 +109,45 @@ RSpec.shared_examples 'gets registries for' do |args|
end
end
context 'when the geo_self_service_framework feature is disabled' do
context 'when the feature is enabled by default' do
before do
skip "Skipping since #{replicator_class.name} is disabled by default" unless replicator_class.replication_enabled_by_default?
end
context 'when the feature is disabled' do
before do
stub_feature_flags(feature_flag => false)
end
# The purpose of this test is to catch if you forgot to remove the
# feature_flag option from the GraphQL field
it_behaves_like 'a working graphql query' do
before do
post_graphql(query, current_user: current_user)
end
end
end
end
context 'when the feature is disabled by default' do
before do
skip "Skipping since #{replicator_class.name} is enabled by default" if replicator_class.replication_enabled_by_default?
end
context 'when the feature is disabled' do
before do
stub_feature_flags(feature_flag => false)
end
# This test will also catch if you forgot to add the feature_flag option
# on the GraphQL field
it 'errors when requesting registries' do
post_graphql(query, current_user: current_user)
expect_graphql_errors_to_include(/Field '#{field_name}' doesn't exist on type 'GeoNode'/)
end
end
end
def registry_to_graphql_data_hash(registry)
{
......
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