Skip to content

Commit

Permalink
Merge pull request #147 from optimizely/master
Browse files Browse the repository at this point in the history
Merge Master on to 2.0.x for beta release
  • Loading branch information
wangjoshuah authored Sep 29, 2017
2 parents cfabaee + f4228f3 commit 61f3832
Show file tree
Hide file tree
Showing 45 changed files with 5,685 additions and 924 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: java
dist: trusty
jdk:
- openjdk7
- oraclejdk7
- openjdk8
- oraclejdk8
- oraclejdk9
install: true
script:
- "./gradlew clean"
Expand All @@ -20,4 +21,4 @@ cache:
branches:
only:
- master
- /^\d+\.\d+\.\d+(-SNAPSHOT|-alpha)?$/ # trigger builds on tags which are semantically versioned to ship the SDK.
- /^\d+\.\d+\.\d+(-SNAPSHOT|-alpha|-beta)?$/ # trigger builds on tags which are semantically versioned to ship the SDK.
63 changes: 61 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,63 @@
## 2.0.0
# Optimizely Java X SDK Changelog
## 2.0.0 Beta
September 29, 2017

This release is a beta release supporting feature flags and rollouts.

### New Features
#### Feature Flag Accessors
You can now use feature flags in the Java SDK. You can experiment on features and rollout features through the Optimizely UI.

- `isFeatureEnabled`
- `getFeatureVariableBoolean`
- `getFeatureVariableDouble`
- `getFeatureVariableInteger`
- `getFeatureVariableString`

### Breaking Changes

- Remove Live Variables accessors
- `getVariableString`
- `getVariableBoolean`
- `getVariableInteger`
- `getVariableDouble`
- Remove track with revenue as a parameter. Pass the revenue value as an event tag instead
- `track(String, String, long)`
- `track(String, String, Map<String, String>, long)`
- We will no longer run all unit tests in travis-ci against Java 7.
We will still continue to set `sourceCompatibility` and `targetCompatibility` to 1.6 so that we build for Java 6.

## 1.8.0

August 29, 2017

This release adds support for numeric metrics and forced bucketing (in code as opposed to whitelisting via project file).

### New Features

- Added `setForcedVariation` and `getForcedVariation`
- Added any numeric metric to event metrics.

### Breaking Changes

- Nothing breaking from 1.7.0

## 1.7.0

July 12, 2017

This release will support Android SDK release 1.4.0

### New Features

- Added `UserProfileService` interface to allow for sticky bucketing

### Breaking Changes

- Removed `UserProfile` interface. Replaced with `UserProfileService` interface.
- Removed support for v1 datafiles.

## 2.0.0-alpha

May 19, 2017

Expand Down Expand Up @@ -110,4 +169,4 @@ August 29, 2016

July 26, 2016

- Beta release of the Java SDK for server-side testing
- Beta release of the Java SDK for server-side testing
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Optimizely Java SDK
===================
[![Build Status](https://travis-ci.org/optimizely/java-sdk.svg?branch=master)](https://travis-ci.org/optimizely/java-sdk)
[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/gradle-extra-configurations-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Apache 2.0](https://img.shields.io/badge/license-APACHE%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)

This repository houses the Java SDK for Optimizely's Full Stack product.

Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}

plugins {
id 'nebula.optional-base' version '3.0.3'
id 'nebula.optional-base' version '3.2.0'
id 'me.champeau.gradle.jmh' version '0.3.1'
}

Expand All @@ -37,7 +37,6 @@ subprojects {
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'me.champeau.gradle.jmh'
apply plugin: 'nebula.provided-base'
apply plugin: 'nebula.optional-base'

sourceCompatibility = 1.6
Expand Down Expand Up @@ -108,6 +107,11 @@ subprojects {
// logging dependencies (logback)
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
testCompile group: 'ch.qos.logback', name: 'logback-core', version: logbackVersion

testCompile group: 'com.google.code.gson', name: 'gson', version: gsonVersion
testCompile group: 'org.json', name: 'json', version: jsonVersion
testCompile group: 'com.googlecode.json-simple', name: 'json-simple', version: jsonSimpleVersion
testCompile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
}

publishing {
Expand Down Expand Up @@ -172,7 +176,3 @@ task ship() {
dependsOn(':core-api:ship', ':core-httpclient-impl:ship')
}

// todo: remove this wrapper version once we're publishing to jcenter/maven central
task wrapper(type: Wrapper) {
distributionUrl = gradleWrapperUrl
}
12 changes: 6 additions & 6 deletions core-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jacksonVersion

provided group: 'com.google.code.findbugs', name: 'annotations', version: findbugsVersion
provided group: 'com.google.code.findbugs', name: 'jsr305', version: findbugsVersion
compile group: 'com.google.code.findbugs', name: 'annotations', version: findbugsVersion
compile group: 'com.google.code.findbugs', name: 'jsr305', version: findbugsVersion

// an assortment of json parsers
provided group: 'com.google.code.gson', name: 'gson', version: gsonVersion, optional
provided group: 'org.json', name: 'json', version: jsonVersion, optional
provided group: 'com.googlecode.json-simple', name: 'json-simple', version: jsonSimpleVersion, optional
provided group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion, optional
compileOnly group: 'com.google.code.gson', name: 'gson', version: gsonVersion, optional
compileOnly group: 'org.json', name: 'json', version: jsonVersion, optional
compileOnly group: 'com.googlecode.json-simple', name: 'json-simple', version: jsonSimpleVersion, optional
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion, optional
}

task generateVersionFile {
Expand Down
30 changes: 4 additions & 26 deletions core-api/src/jmh/java/com/optimizely/ab/OptimizelyBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,49 +157,27 @@ public Variation measureActivateForGroupExperimentWithForcedVariation() {
}

@Benchmark
public void measureTrackWithNoAttributesAndNoRevenue() {
public void measureTrackWithNoAttributes() {
optimizely.track("testEventWithMultipleExperiments", "optimizely_user" + random.nextInt());
}

@Benchmark
public void measureTrackWithNoAttributesAndRevenue() {
optimizely.track("testEventWithMultipleExperiments", "optimizely_user" + random.nextInt(), 50000);
}

@Benchmark
public void measureTrackWithAttributesAndNoRevenue() {
public void measureTrackWithAttributes() {
optimizely.track("testEventWithMultipleExperiments", "optimizely_user" + random.nextInt(),
Collections.singletonMap("browser_type", "firefox"));
}

@Benchmark
public void measureTrackWithAttributesAndRevenue() {
optimizely.track("testEventWithMultipleExperiments", "optimizely_user" + random.nextInt(),
Collections.singletonMap("browser_type", "firefox"), 50000);
}

@Benchmark
public void measureTrackWithGroupExperimentsNoAttributesNoRevenue() {
public void measureTrackWithGroupExperimentsNoAttributes() {
optimizely.track("testEventWithMultipleExperiments", trackGroupExperimentUserId);
}

@Benchmark
public void measureTrackWithGroupExperimentsNoAttributesAndRevenue() {
optimizely.track("testEventWithMultipleExperiments", trackGroupExperimentUserId, 50000);
}

@Benchmark
public void measureTrackWithGroupExperimentsNoRevenueAndAttributes() {
public void measureTrackWithGroupExperimentsAndAttributes() {
optimizely.track("testEventWithMultipleExperiments", trackGroupExperimentAttributesUserId,
Collections.singletonMap("browser_type", "chrome"));
}

@Benchmark
public void measureTrackWithGroupExperimentsAndAttributesAndRevenue() {
optimizely.track("testEventWithMultipleExperiments", trackGroupExperimentAttributesUserId,
Collections.singletonMap("browser_type", "chrome"), 50000);
}

@Benchmark
public void measureTrackWithGroupExperimentsAndForcedVariation() {
optimizely.track("testEventWithMultipleExperiments", "user_a");
Expand Down
Loading

0 comments on commit 61f3832

Please sign in to comment.