Commit 31c0a3f3 authored by Mark Chao's avatar Mark Chao

Merge branch 'mk/enable-package-file-registries-field' into 'master'

Geo: Permanently enable package_file_registries field

Closes #255280

See merge request gitlab-org/gitlab!43245
parents 7f09a474 ff4dfc27
......@@ -6398,7 +6398,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(
"""
......
......@@ -17863,7 +17863,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: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37112
rollout_issue_url:
group: geo
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,15 +109,43 @@ 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
stub_feature_flags(feature_flag => false)
skip "Skipping since #{replicator_class.name} is disabled by default" unless replicator_class.replication_enabled_by_default?
end
it 'errors when requesting registries' do
post_graphql(query, current_user: current_user)
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'/)
expect_graphql_errors_to_include(/Field '#{field_name}' doesn't exist on type 'GeoNode'/)
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