Resolve deprecation warnings coming from the gitlab-experiment dependency

Several public interface methods have been deprecated in the gitlab-experiment library, and those deprecation warnings should be resolved before the next release.

These are the things that have been deprecated as defined in the v0.7.0 changelog.

  • The use of use { } and try { } has been deprecated, instead use control { }, candidate { } and variant(:named_variant) { }
  • Passing a named variant argument to candidate { } (or try { }) has been deprecated, instead use variant(:named_variant) { }
  • Calling variant (as in variant.name to get, or variant(:assigned_variant) to set) has been deprecated, instead use assigned (as in assigned.name to get the variant that has been assigned, and assigned(:assigned_variant) to manually set one)
  • Using public *_behavior methods has been deprecated, instead declare the experiment in the class using control, candidate and variant(:variant_name) registration methods
  • Configuration of context_hash_strategy has been deprecated, instead use context_key_secret and context_key_bit_length configuration options
    • hard to resolve, but we're doing it a different way
  • Configuration variant_resolver and the subsequent inclusion_resolver options have both been deprecated, instead put this logic into custom rollout strategies
    • already resolved
  • The experiment_group? method has been deprecated, which may have been overridden in subclasses, instead put this logic into custom rollout strategies
  • The flipper_id and session_id methods have been deprecated, which may have been overridden in subclasses, instead put this logic into custom rollout strategies

We should go through this list and remove all usages of deprecated methods. We can do this by disabling the silencing of the deprecation warnings in the spec support file.

Additionally, when we resolve a given warning, we should disallow it entirely, which means that it will cause an exception to be raised. We could consider putting these into the initializer as well, which might be more helpful for development.

Edited by Jeremy Jackson