RegistriesResolver should return null when feature flag is disabled

What does this MR do and why?

This MR adds a check in RegistriesResolver#resolve. It now checks replicator_class.replication_enabled? and returns none if the corresponding feature flag is disabled.

Added a test context context 'when replication is disabled' dothat stub the replication flag to be false. The example inside of that context expects the result resolve_registries to be empty.

Global geo setting is now stubbed to enabled: true for all test in the shared examples to ensure all Geo registry resolvers behave consistently.

References

Related to #377988 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Setup a development environment with 2 GDKs

  2. Run the specs for any of the resolvers that use the shared examples in /ee/spec/support/shared_examples/graphql/geo/geo_registries_resolver_shared_examples.rb, for example:

    bin/rspec ee/spec/graphql/resolvers/geo/container_repository_registries_resolver_spec.rb

  3. All spec should pass

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #377988 (closed)

Edited by Rodrigo Farinango

Merge request reports

Loading