- Change
RedisStorage
scrub to be iterative to avoid SystemStackError while cleaning big experiments
- Allow configuring the
RedisStorage
with aConnectionPool
instead of a rawRedis
connection.
- Fix edge case where inheriting from
Verdict::Experiment
and overridingsubject_qualifies?
resulted in an error.
- Make the
dynamic_qualifies
parameter inVerdict::Experiment#subject_qualifies?
optional. This fixes a bug where users that were previously calling this method directly experienced issues after v0.15.0
- Add optional
qualifiers
parameter to theVerdict::Experiment#switch
method. This parameter accepts an array of procs and is used as additional qualifiers. The purpose of this parameter is to allow users to define qualification logic outside of the experiment definition.
- Add optional experiment definition method
schedule_stop_new_assignment_timestamp
to support limiting experiment's assignment lifetime with another pre-determined time interval. It allows users to have an assignment cooldown period for stable analysis of the experiment results. Experiment's lifetime now becomes: start experiment -> stop new assignments -> end experiment.
- Add optional experiment definition methods
schedule_start_timestamp
andschedule_end_timestamp
to support limiting experiment's lifetime in a pre-determined time interval. - Support eager loading from within a Rails app using Zeitwerk.
- Add
CookieStorage
storage backend. This backend is a distributed store for Verdict and does not support experiment timestamps. It is designed to be used with Rails applications and requires that.cookies
be set to theCookieJar
instance before use.
-
Allow options to be passed to
Experiment#cleanup
so they can be forwarded to storage. -
Changed
Experiment#cleanup
to accept an argument of typeVerdict::Experiment
. Passing aString
/Symbol
argument is still supported, but will log a deprecation warning.
- Automatic eager loading when inside a Rails app.
- Add
Experiment#cleanup
to remove stored redis hashes. - Fix typo in
Experiment#fetch_subject
error message.
This version has breaking changes
- Eagerly load experiment definitions when booting Rails, so that multi-threaded applications do not face a race-condition when populating experiments.
- Fixes deprecated
assert_equal
tests that return nil.
This version has breaking changes
- Experiments that have
store_unqualified
set tofalse
will now have previous assignments loaded onassign
regardless of whether or not the merchant no longer qualifies - Here's the change in logic for
assign
based on whether or not thestore_unqualified
flag is on:
Old behaviour:
store_unqualified | true | false |
---|---|---|
assignments for subjects that don't qualify are persisted in the database | yes | no |
existing assignments are returned (even if subject doesn't qualify anymore) | yes | no |
New behaviour:
store_unqualified | true | false |
---|---|---|
assignments for subjects that don't qualify are persisted in the database | yes | no |
existing assignments are returned (even if subject doesn't qualify anymore) | yes | yes |
This version has breaking changes
- Experiment can now specify multiple qualify blocks
Verdict::Experiment#qualifier
has been removed in favor forVerdict::Experiment#qualifiers
, which returns an array of procs
- Allow pass of an argument to qualify with a method name as a symbol, instead of a block
- Fix bug were Verdict.directory is overwritten
- Allow Verdict.directory to handle multiple directories (using globbing)
- Implement Verdict.clear_repository_cache, which fixes autoloading issues with Rails.
- Integrated Verdict.clear_repository_cache with our Railtie.
- Make Verdict Railtie
.freeze
the eager_load_paths it changes as Rails itself does.
This version has breaking changes
- replaced following public methods that took a
subject_identifier
with an equivalent method which takes asubject
old method | new method |
---|---|
lookup_assignment_for_identifier(subject_identifier) |
lookup(subject) |
assign_manually_by_identifier(subject_identifier, group) |
assign_manually(subject, group) |
disqualify_manually_by_identifier(subject_identifier) |
disqualify_manually(subject) |
remove_subject_assignment_by_identifier(subject_identifier) |
remove_subject_assignment(subject) |
fetch_assignment(subject_identifier) |
lookup(subject) |
- Changed the following methods to take a
subject
instead ofsubject_identifier
subject_assignment(subject, group, originally_created_at = nil, temporary = false)
subject_conversion(subject, goal, created_at = Time.now.utc)
Verdict::Experiment#subject_qualifies?(subject, context = nil)
is now public, so it's easier to test
the qualification logic for your experiments.
BaseStorage
's public methods now take asubject
, instead of asubject_identifier
. They fetch thesubject_identifier
using theExperiment#subject_identifier(subject)
method. Existing storages will still work normally.- The basic
#get
,#set
, and#remove
methods are now protected.
#initialize
now takes asubject
instead of asubject_identifier
, the new signature isinitialize(experiment, subject, group, originally_created_at, temporary = false)
#initialize
now takes asubject
instead of asubject_identifier
, the new signature isinitialize(experiment, subject, goal, created_at = Time.now.utc)
- In order to use the included helper Rake Tasks, you must implement
fetch_subject(subject_identifier)
inExperiment
.
Support has been removed for the following Ruby versions:
- 1.9.X
- Rubinius