-
Notifications
You must be signed in to change notification settings - Fork 32
Josh/persistent bucketer #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -14,6 +14,9 @@ | |||
.classpath | |||
.project | |||
|
|||
# android studio config files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont think it makes sense for Java SDK. Probably for Android SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need to expense IntelliJ Ultimate then. Android Studio adds the file automatically. It's also useful to work on the android modules and java module at the same time in Android Studio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Makes sense.
@@ -93,6 +94,13 @@ private Optimizely(@Nonnull ProjectConfig projectConfig, | |||
this.errorHandler = errorHandler; | |||
} | |||
|
|||
// Do work here that should be done once per Optimizely lifecycle | |||
@VisibleForTesting void initialize() { | |||
// Give users of ExperimentRegistry a chance to clean out old state for experiments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Comment needs updating.
@@ -1,5 +1,5 @@ | |||
# Maven version | |||
version = 0.1.68-SNAPSHOT | |||
version = 0.1.70-SNAPSHOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vraja2 FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not 0.1.69
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there public API changes shouldn't it go to 0.1.70
per semantic versioning? I don't care either way let me know.
@@ -440,6 +447,153 @@ public void bucketUserNotInOverlappingGroupExperiment() throws Exception { | |||
assertNull(algorithm.bucket(groupExperiment, "blah")); | |||
} | |||
|
|||
@Test public void bucketUserSaveActivationWithPersistentBucketer() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add docstrings describing the new tests?
LGTM, there are mostly just minor things to address, but once those are done, merge it! |
I addressed everyone's comments. The only outstanding thing is changing the name of |
|
||
// If a user experiment record is present give it a variation to store | ||
if (userExperimentRecord != null) { | ||
boolean saved = userExperimentRecord.save(userId, experiment.getKey(), variationKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use experimentKey
here
Looks great, just a couple of nits. Can you run "./gradlew check" locally before merging also? Thanks for addressing everything! |
@@ -1,6 +1,6 @@ | |||
Optimizely Java SDK | |||
=================== | |||
[](https://travis-ci.com/optimizely/java-sdk) | |||
[](https://travis-ci.org/optimizely/java-sdk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are the latest links, public repos use .org not .com for Travis
typos, naming, etc from PR review
91531a0
to
91e0427
Compare
ProjectConfig is the current access point into the configuration of experiments, rollouts, audiences, etc. Currently it is basically a wrapper around the datafile, but can potentially be backed by other implementations. Extracting out the interface now will make it easier to distance ourselves from being tightly coupled to the current datafile concepts.
This adds a
StickyBucketer
interface and hooks it up to the bucketer.I also had to bump the gradle version to get things to build on my version of IntelliJ. I am still unable to get the project building from IntelliJ but i can I build and run tests from the command line. All the tests are passing. I am not sure if the issue on my machine or in the build. It was like this on the HEAD of master.