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 { }
andtry { }
has been deprecated, instead usecontrol { }
,candidate { }
andvariant(:named_variant) { }
-
Passing a named variant argument to candidate { }
(ortry { }
) has been deprecated, instead usevariant(:named_variant) { }
-
Calling variant
(as invariant.name
to get, orvariant(:assigned_variant)
to set) has been deprecated, instead useassigned
(as inassigned.name
to get the variant that has been assigned, andassigned(:assigned_variant)
to manually set one) -
Using public *_behavior
methods has been deprecated, instead declare the experiment in the class usingcontrol
,candidate
andvariant(:variant_name)
registration methods -
Configuration of context_hash_strategy
has been deprecated, instead usecontext_key_secret
andcontext_key_bit_length
configuration options- hard to resolve, but we're doing it a different way
-
Configuration variant_resolver
and the subsequentinclusion_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
andsession_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.
-
UPDATE: !79885 (merged) will silence all logging for now (including development), we can improve this so that deprecations are logged in development, but not production due to the impact this can have on logging.
-
UPDATE: !79994 (merged) adjusts what was done in !79885 (merged) to limit deprecation logging to only dev and test environments, where they'll be useful.
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.