Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

prepare 5.0.0 release #195

Merged
merged 858 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
858 commits
Select commit Hold shift + click to select a range
3b056dc
Merge branch 'eb/ch68094/common-package' into eb/ch51696/store-status
eli-darkly Apr 13, 2020
a58784e
don't stop polling store status if write from cache fails
eli-darkly Apr 13, 2020
fb8044d
reduce worker threads for store status from 2 to 1
eli-darkly Apr 13, 2020
8bfffe2
synchronize again to avoid race condition on creating poller
eli-darkly Apr 14, 2020
1adff9a
Merge branch 'eb/ch51696/store-status' into eb/ch51696/stream-store-s…
eli-darkly Apr 14, 2020
f77c846
misc fixes
eli-darkly Apr 14, 2020
2bd1c38
Merge pull request #199 from launchdarkly/eb/ch68094/common-package
eli-darkly Apr 15, 2020
0fc7bb3
add test for error handling during store outages
eli-darkly Apr 15, 2020
cad1e1f
5.0: remove NewRelicReflector
eli-darkly Apr 15, 2020
9887a1e
Merge pull request #207 from launchdarkly/eb/ch73860/no-new-relic
eli-darkly Apr 15, 2020
5c179a2
Merge pull request #200 from launchdarkly/eb/ch51696/store-status
eli-darkly Apr 15, 2020
785e1aa
Merge branch '5.x' into eb/ch51696/stream-store-status
eli-darkly Apr 15, 2020
9dbefe3
add test for stream not restarting if store doesn't tell it to
eli-darkly Apr 15, 2020
49cf6df
Merge pull request #205 from launchdarkly/eb/ch51696/stream-store-status
eli-darkly Apr 15, 2020
c380143
add scoped configuration for HTTP options
eli-darkly Apr 16, 2020
89877df
fix shading problem with javax classes
eli-darkly Apr 16, 2020
e239121
indents
eli-darkly Apr 16, 2020
d274337
Merge pull request #209 from launchdarkly/eb/ch73967/javax-shading
eli-darkly Apr 17, 2020
b0d2e60
Merge branch 'eb/ch73875/http-config' into eb/ch73883/http-config-5.0
eli-darkly Apr 17, 2020
de95836
remove deprecated HTTP config properties
eli-darkly Apr 17, 2020
4b1f671
don't save entire configuration in ClientContext
eli-darkly Apr 17, 2020
e076f77
deprecated methods with an annotation, not just with javadoc
eli-darkly Apr 17, 2020
ae0a53a
add getters for all properties on EvaluationReason; deprecate subclasses
eli-darkly Apr 20, 2020
93d4aa2
Merge pull request #210 from launchdarkly/eb/ch74282/reason-subclasses
eli-darkly Apr 20, 2020
c58c56e
Merge branch 'master' into 5.x
eli-darkly Apr 20, 2020
868ef25
Merge pull request #208 from launchdarkly/eb/ch73875/http-config
eli-darkly Apr 21, 2020
1ee6277
don't log exception stacktraces except at debug level
eli-darkly Apr 21, 2020
a7e97b9
Merge pull request #211 from launchdarkly/eb/ch71166/debug-stacktrace
eli-darkly Apr 21, 2020
1766a8d
Merge branch 'master' of github.com:launchdarkly/java-server-sdk
eli-darkly Apr 22, 2020
81a5f75
Merge branch 'master' into eb/ch73883/http-config-5.0
eli-darkly Apr 22, 2020
1593396
Merge branch '5.x' into eb/ch73883/http-config-5.0
eli-darkly Apr 22, 2020
9b33f8c
Merge branch '5.x' into eb/ch73883/remove-old-http
eli-darkly Apr 22, 2020
bc4f545
Merge branch 'eb/ch73883/remove-old-http' into eb/ch73883/better-clie…
eli-darkly Apr 22, 2020
532126b
don't hold onto the LDConfig instance after creating the client
eli-darkly Apr 22, 2020
1e30cae
better documentation of client constructor, with singleton advice
eli-darkly Apr 22, 2020
331c7ee
copyedit
eli-darkly Apr 22, 2020
9ae3a87
Merge pull request #215 from launchdarkly/eb/ch65200/client-construct…
eli-darkly Apr 22, 2020
60e6256
Merge pull request #213 from launchdarkly/eb/ch73883/remove-old-http
eli-darkly Apr 22, 2020
c81deac
5.0: fix NPE from allFlagsState when there's a deleted flag
eli-darkly Apr 23, 2020
1f5eb8a
Merge pull request #216 from launchdarkly/eb/ch74709/all-flags-with-d…
eli-darkly Apr 23, 2020
2cb1101
Merge pull request #214 from launchdarkly/eb/ch73883/better-client-co…
eli-darkly Apr 23, 2020
f1f5d43
use non-nullable integers in EvaluationDetail and events
eli-darkly Apr 25, 2020
29d947e
minor readme updates
eli-darkly Apr 25, 2020
acae1ed
5.0: change build so Gson adapter is usable, improve packaging tests …
eli-darkly Apr 27, 2020
bbaede8
Merge branch '5.x' into eb/ch74915/non-null-variation
eli-darkly Apr 27, 2020
69619f3
Merge pull request #217 from launchdarkly/eb/ch74915/non-null-variation
eli-darkly Apr 28, 2020
5452b4f
(5.0 - #2) changes to support the Jackson adapter in java-sdk-common …
eli-darkly Apr 28, 2020
7753892
remove unnecessary Guava usage
eli-darkly Apr 29, 2020
ac0a86c
don't serialize -1 variation index in FeatureFlagsState
eli-darkly Apr 29, 2020
44dcb62
Merge pull request #219 from launchdarkly/eb/ch74915/fix-flags-state-…
eli-darkly Apr 29, 2020
87fd24f
Merge pull request #220 from launchdarkly/eb/ch62048/less-guava
eli-darkly Apr 29, 2020
4e0991e
use java-sdk-common 1.0.0-rc1
eli-darkly Apr 29, 2020
b1f70e9
use okhttp-eventsource 2.1.0
eli-darkly Apr 29, 2020
8f3b157
5.0.0-rc1
eli-darkly Apr 30, 2020
9812c3a
prepare 5.0.0-rc1 release (#191)
eli-darkly Apr 30, 2020
7655de5
Merge branch '5.x' of github.com:launchdarkly/java-server-sdk into 5.x
eli-darkly Apr 30, 2020
c08db30
use shared single-thread executor for most intermittent tasks
eli-darkly May 5, 2020
a46ea58
relax test app OSGi version constraints to support beta versions
eli-darkly May 5, 2020
da5cc46
simplify store status implementation to not use optional interface
eli-darkly May 5, 2020
a1f0fa6
on second thought, leave CacheStats where it was
eli-darkly May 6, 2020
5d5e3cb
Merge pull request #222 from launchdarkly/eb/ch75792/packaging-test-beta
eli-darkly May 6, 2020
bb8e9a4
Merge branch 'master' into 5.x
eli-darkly May 6, 2020
7675a93
javadoc fixes
eli-darkly May 6, 2020
8e823cc
further fix to packaging test for beta versions
eli-darkly May 6, 2020
836e9b7
Merge branch 'eb/ch75792/packaging-test-beta-2' into 5.x-osgi-fix
eli-darkly May 6, 2020
bcca8b7
rename DataStoreUpdates to DataSourceUpdates
eli-darkly May 6, 2020
560dd58
Merge pull request #224 from launchdarkly/eb/ch75792/packaging-test-b…
eli-darkly May 6, 2020
50ea5b0
Merge branch 'master' into 5.x-osgi-fix
eli-darkly May 6, 2020
ac75225
Merge branch '5.x' into eb/ch75777/shared-executor
eli-darkly May 6, 2020
b952c10
Merge branch 'eb/ch75777/shared-executor' into eb/ch75800/store-status
eli-darkly May 6, 2020
dd3fa31
Merge branch 'eb/ch75800/store-status' into eb/ch75800/store-status-u…
eli-darkly May 6, 2020
691354d
add a new DataStoreUpdates that's for the data store to use
eli-darkly May 6, 2020
f8f76da
implement data source status monitoring
eli-darkly May 6, 2020
d5a3284
typo
eli-darkly May 6, 2020
85db8f0
rm duplicate type
eli-darkly May 6, 2020
02cc39b
javadoc fixes
eli-darkly May 6, 2020
f8d5b20
better cleanup of scheduled tasks from shared executor
eli-darkly May 7, 2020
4b747cb
Merge branch 'eb/ch75777/shared-executor' into eb/ch75800/store-status
eli-darkly May 7, 2020
31594f0
Merge branch 'eb/ch75800/store-status' into eb/ch75800/store-status-u…
eli-darkly May 7, 2020
ae2bdc7
Merge branch 'eb/ch75800/store-status-updates-intf-1' into eb/ch75800…
eli-darkly May 7, 2020
bd29aca
Merge branch 'eb/ch75800/store-status-updates-intf-2' into eb/ch67913…
eli-darkly May 7, 2020
f9ed725
Merge pull request #221 from launchdarkly/eb/ch75777/shared-executor
eli-darkly May 8, 2020
88e7040
Merge pull request #223 from launchdarkly/eb/ch75800/store-status
eli-darkly May 8, 2020
d2c7dc0
Merge pull request #225 from launchdarkly/eb/ch75800/store-status-upd…
eli-darkly May 8, 2020
b3ad5d7
Merge pull request #226 from launchdarkly/eb/ch75800/store-status-upd…
eli-darkly May 8, 2020
27b50b5
typos
eli-darkly May 8, 2020
adf8cce
rename STARTING to INITIALIZING
eli-darkly May 8, 2020
ae5da18
(5.0, but not dependent on other PRs) allow configuration of worker t…
eli-darkly May 8, 2020
5d56e8d
set up initial JMH benchmarks
eli-darkly May 8, 2020
eb8f1df
Merge branch '5.x' into eb/ch67913/data-source-status
eli-darkly May 8, 2020
a45df89
CI fix
eli-darkly May 8, 2020
a13193f
save report file
eli-darkly May 8, 2020
0c50b7b
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 8, 2020
58bf660
adapt benchmarks to 5.0 API
eli-darkly May 8, 2020
94202d3
benchmarks need Gson in order to use shared test code
eli-darkly May 8, 2020
fecff19
decouple event HTTP logic from event processing
eli-darkly May 9, 2020
a3409c2
Merge branch 'eb/ch76308/event-sender' into eb/ch76308/event-sender-5.x
eli-darkly May 9, 2020
8822060
add end-to-end test for events
eli-darkly May 9, 2020
d9aab4b
Merge branch 'eb/ch76308/event-sender' into eb/ch76308/event-sender-5.x
eli-darkly May 10, 2020
2349290
javadoc fixes
eli-darkly May 11, 2020
c9ece43
minor PR feedback
eli-darkly May 11, 2020
9690842
make DataSourceUpdatesImpl responsible for detecting store failures; …
eli-darkly May 12, 2020
1398c7c
Merge pull request #227 from launchdarkly/eb/ch67913/data-source-status
eli-darkly May 12, 2020
d6c90d1
(#7) implement time-dependent escalation of data source error logging…
eli-darkly May 12, 2020
d207958
Merge branch '5.x' into eb/ch76308/event-sender-5.x
eli-darkly May 12, 2020
40d45fa
fix swapped log levels
eli-darkly May 12, 2020
6bd5afe
better synchronization usage
eli-darkly May 12, 2020
fcd9631
don't need to wait 1 second during tests
eli-darkly May 12, 2020
de0831d
Merge pull request #230 from launchdarkly/eb/ch76308/event-sender
eli-darkly May 12, 2020
0231669
Merge branch 'master' into eb/ch76308/event-sender-5.x
eli-darkly May 12, 2020
8a9d9dd
make events URI construction reliable regardless of whether base URI …
eli-darkly May 13, 2020
f516bf0
Merge pull request #231 from launchdarkly/eb/ch76308/event-sender-bas…
eli-darkly May 13, 2020
8b06363
Merge branch 'master' into eb/ch76308/event-sender-5.x
eli-darkly May 13, 2020
d1456e9
merge from public after release
LaunchDarklyCI May 13, 2020
142846d
Merge branch 'master' into 5.x
eli-darkly May 13, 2020
6718e4c
prepare 5.0.0-rc2 release (#194)
eli-darkly May 14, 2020
a3c25f4
Merge branch '5.x' of github.com:launchdarkly/java-server-sdk into 5.x
eli-darkly May 14, 2020
e8621a2
typo
eli-darkly May 14, 2020
c5340c8
typo
eli-darkly May 15, 2020
6035ee1
add DataSourceStatusProvider.waitFor()
eli-darkly May 15, 2020
60e1825
comment fix
eli-darkly May 15, 2020
88fa2e0
typo
eli-darkly May 15, 2020
c32bebd
rm debugging
eli-darkly May 15, 2020
74c0828
improve comments
eli-darkly May 16, 2020
bc09057
fix race condition in LDClientEndToEndTest
eli-darkly May 19, 2020
34ecff9
Merge pull request #233 from launchdarkly/eb/ch76308/diagnostic-event…
eli-darkly May 19, 2020
fd1178d
Merge branch 'master' into 5.x
eli-darkly May 19, 2020
a61e287
Merge branch '5.x' into eb/ch76894/wait-for-status
eli-darkly May 19, 2020
2106219
move flag change stuff into FlagTracker facade, simplify value listener
eli-darkly May 19, 2020
bad0ea8
Merge pull request #232 from launchdarkly/eb/ch76894/wait-for-status
eli-darkly May 19, 2020
cbd309a
move LDClientInterface into interfaces package and rename initialized…
eli-darkly May 19, 2020
6247e76
Merge branch 'master' into eb/ch76240/benchmarks-4.x
eli-darkly May 19, 2020
ab99c82
more benchmark implementation
eli-darkly May 19, 2020
70da524
Merge branch '5.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 19, 2020
eb74a92
port some more benchmarks from 4.x
eli-darkly May 19, 2020
d353873
Merge pull request #235 from launchdarkly/eb/ch59586/client-interface
eli-darkly May 20, 2020
ffda80a
Merge branch '5.x' into eb/ch25268/flag-tracker
eli-darkly May 20, 2020
223e038
fix merge conflict
eli-darkly May 20, 2020
4cdb376
preprocess various things to speed up evaluations
eli-darkly May 22, 2020
d97a5bc
(5.0) don't bother creating event objects if they won't be sent
eli-darkly May 22, 2020
b56d541
cleaner EventFactory design
eli-darkly May 22, 2020
7515cf8
add test coverage step to CI
eli-darkly May 22, 2020
6132374
add test coverage reporting + improve DefaultEventProcessor tests
eli-darkly May 22, 2020
436ec07
clarify meaning of "events" in javadoc comment
eli-darkly May 22, 2020
d50f669
Merge pull request #234 from launchdarkly/eb/ch25268/flag-tracker
eli-darkly May 22, 2020
631d872
note about benchmarks in CONTRIBUTING
eli-darkly May 22, 2020
a1de46c
rm unused
eli-darkly May 23, 2020
5a1e237
Merge branch '5.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
5e19ff6
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
6565ccc
formatting
eli-darkly May 23, 2020
2a8a284
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
87163c7
use JMH average time mode, not throughput
eli-darkly May 23, 2020
0358ae9
measure in nanoseconds
eli-darkly May 23, 2020
035ff29
fix import
eli-darkly May 23, 2020
0946574
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
4f8273f
move benchmark code to 5.0-like packages for easier cross-comparison
eli-darkly May 23, 2020
6f08081
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
c84cda9
move test data generation out of benchmarks
eli-darkly May 23, 2020
846976c
more configuration tweaks
eli-darkly May 23, 2020
338947c
show more benchmark output
eli-darkly May 23, 2020
db5dc8c
show more benchmark output
eli-darkly May 23, 2020
37e88c6
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
a45bcd9
fix event benchmark synchronization
eli-darkly May 23, 2020
080c599
add jmhReport HTML output
eli-darkly May 23, 2020
d80d245
fix report step
eli-darkly May 23, 2020
4832b76
fix synchronization again
eli-darkly May 23, 2020
2bd5a37
fix event benchmarks so they don't test the construction of the input…
eli-darkly May 23, 2020
0815938
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-4…
eli-darkly May 23, 2020
0cefb4e
fix data file name
eli-darkly May 23, 2020
e2be6e9
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
c52418f
Merge branch 'eb/ch76240/benchmarks-4.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 23, 2020
d184426
Merge branch '5.x' into eb/ch77594/coverage
eli-darkly May 23, 2020
58d1e12
Merge branch '5.x' into eb/ch77442/preprocessing
eli-darkly May 23, 2020
f6961fa
Merge branch 'eb/ch77442/preprocessing' into eb/ch77571/no-events
eli-darkly May 23, 2020
4c47222
Merge branch 'eb/ch77571/no-events' into eb/ch77594/coverage
eli-darkly May 23, 2020
26575df
CI fix (always store test results)
eli-darkly May 23, 2020
1986569
improve test coverage of low-level eval logic to >99%
eli-darkly May 23, 2020
e6e37a5
revert change to flush payload queue behavior
eli-darkly May 23, 2020
ab43703
avoid test race condition
eli-darkly May 23, 2020
d264569
Merge branch 'eb/ch77594/coverage' into eb/ch77594/coverage-2-eval
eli-darkly May 23, 2020
a9b6c81
add test coverage reporting
eli-darkly May 23, 2020
38a4922
CI fix
eli-darkly May 23, 2020
4e3eee3
CI fix
eli-darkly May 23, 2020
051a9d5
Merge branch 'eb/ch77594/coverage-0' into eb/ch77594/coverage-1-events
eli-darkly May 23, 2020
4b85a3f
more event test improvements
eli-darkly May 23, 2020
b898d81
misc cleanup + test improvements
eli-darkly May 23, 2020
ca2e196
Merge branch 'eb/ch77594/coverage-1-events' into eb/ch77594/coverage-…
eli-darkly May 23, 2020
60046ef
misc cleanup + test improvements
eli-darkly May 23, 2020
0f898fa
make intVariation and doubleVariation non-nullable
eli-darkly May 23, 2020
3b0e95b
(5.0) don't use jar magic to find out our own version string
eli-darkly May 23, 2020
f6b7ff2
fix test
eli-darkly May 23, 2020
3fb019f
Merge branch 'eb/ch77594-ch77639/coverage-3-client' into eb/ch77640/v…
eli-darkly May 23, 2020
b3f313c
make intVariation and doubleVariation non-nullable
eli-darkly May 23, 2020
38dacc8
Merge branch 'eb/ch77639/int-double-non-null' into eb/ch77640/version…
eli-darkly May 23, 2020
472dfc7
better unit test coverage of LDClient and FeatureFlagsState
eli-darkly May 23, 2020
3ccd7cb
test coverage improvements + minor fixes
eli-darkly May 24, 2020
7c75b3a
better temp file handling in file data source tests
eli-darkly May 24, 2020
8da3e27
revert file data source implementation change for now
eli-darkly May 24, 2020
306797e
revert unnecessary change
eli-darkly May 24, 2020
e07643f
comment about file watching on Mac
eli-darkly May 24, 2020
1d57156
add slight delay to avoid timing-dependent test flakiness
eli-darkly May 26, 2020
3fad450
test fixes/comments
eli-darkly May 26, 2020
07bb8f5
(5.0) use simpler and more stable logger names
eli-darkly May 26, 2020
2d0628d
better instructions
eli-darkly May 27, 2020
427a87e
more convenient way to set EventSource logger name
eli-darkly May 27, 2020
a89504e
(5.0) add HTTP default headers method + some component refactoring
eli-darkly May 28, 2020
6ce1d8a
don't need to pass the whole config object to describeConfiguration()
eli-darkly May 28, 2020
5d54f0a
simplify test logic for HTTP headers
eli-darkly May 28, 2020
29cf2d7
Merge pull request #236 from launchdarkly/eb/ch77442/preprocessing
eli-darkly May 28, 2020
e336c92
Merge pull request #237 from launchdarkly/eb/ch77571/no-events
eli-darkly May 28, 2020
86050fb
Merge pull request #240 from launchdarkly/eb/ch77594/coverage-0
eli-darkly May 28, 2020
ec01e5b
Merge branch '5.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 28, 2020
c36c6f3
Merge pull request #241 from launchdarkly/eb/ch77594/coverage-1-events
eli-darkly May 29, 2020
bd2162e
Merge pull request #242 from launchdarkly/eb/ch77594/coverage-2-eval
eli-darkly May 29, 2020
daf04c4
Merge pull request #243 from launchdarkly/eb/ch77639/int-double-non-null
eli-darkly May 29, 2020
2719973
Merge pull request #244 from launchdarkly/eb/ch77640/version-string
eli-darkly May 29, 2020
8b24c81
(5.0) final test coverage improvements, for now, with enforcement
eli-darkly May 29, 2020
55f14d1
re-simplify DataBuilder
eli-darkly May 29, 2020
3df7da4
increase timeouts
eli-darkly May 29, 2020
6fc2a7a
misc fixes
eli-darkly May 29, 2020
8b27de5
rm unnecessary override
eli-darkly May 29, 2020
262eb19
Merge branch '5.x' into eb/ch76240/benchmarks-5.x
eli-darkly May 29, 2020
43778a3
indents
eli-darkly May 29, 2020
128b8cc
Merge pull request #245 from launchdarkly/eb/ch77594/coverage-3-client
eli-darkly May 29, 2020
b959c6c
Merge pull request #238 from launchdarkly/eb/ch76240/benchmarks-4.x
eli-darkly May 29, 2020
279ccd5
Merge pull request #239 from launchdarkly/eb/ch76240/benchmarks-5.x
eli-darkly May 29, 2020
6ddb11b
Merge branch 'master' into 5.x
eli-darkly May 29, 2020
37fbfe5
Merge branch '5.x' into eb/ch76203/logger-names
eli-darkly May 29, 2020
fc3d40e
Merge branch '5.x' into eb/ch77594/coverage-4-misc
eli-darkly May 29, 2020
4df1c40
Merge branch 'eb/ch77594/coverage-4-misc' into eb/ch78049/http-headers
eli-darkly May 29, 2020
dbe962f
update benchmark code for API change
eli-darkly May 29, 2020
8b74838
Merge branch 'eb/ch78049/http-headers' into eb/ch77594/coverage-5-misc
eli-darkly May 29, 2020
4b00cde
Merge pull request #246 from launchdarkly/eb/ch77594/coverage-4-misc
eli-darkly May 29, 2020
73062ca
support loading file data from a classpath resource
eli-darkly May 30, 2020
f02f835
update metadata so Releaser knows about 4.x branch
eli-darkly May 30, 2020
9dfc1be
Merge branch '4.x' into 5.x
eli-darkly May 30, 2020
4a3a7fb
minor test fixes
eli-darkly May 30, 2020
0fbd4b0
make class final
eli-darkly May 30, 2020
91941fa
rm beta changelog items
eli-darkly May 30, 2020
851c53b
Merge branch 'eb/debugging'
eli-darkly May 30, 2020
907882d
more info about coverage in CONTRIBUTING.md
eli-darkly Jun 1, 2020
7165ca4
Merge pull request #248 from launchdarkly/eb/ch78049/http-headers
eli-darkly Jun 1, 2020
79d11bf
Merge branch 'master' into eb/ch76203/logger-names
eli-darkly Jun 2, 2020
234e905
Merge pull request #247 from launchdarkly/eb/ch76203/logger-names
eli-darkly Jun 2, 2020
75630d0
Merge branch 'master' into eb/ch77594/coverage-5-misc
eli-darkly Jun 2, 2020
1eabb73
Merge branch 'eb/ch77594/coverage-5-misc' into eb/ch76824/classpath-file
eli-darkly Jun 2, 2020
01df1f3
Merge pull request #249 from launchdarkly/eb/ch77594/coverage-5-misc
eli-darkly Jun 2, 2020
ff3d3d1
Merge pull request #250 from launchdarkly/eb/ch76824/classpath-file
eli-darkly Jun 2, 2020
705d25b
use java-sdk-common 1.0.0
eli-darkly Jun 2, 2020
2a44530
use okhttp-eventsource 2.3.0
eli-darkly Jun 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
56 changes: 41 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ workflows:
- test-linux:
name: Java 11 - Linux - OpenJDK
docker-image: circleci/openjdk:11
with-coverage: true
requires:
- build-linux
- packaging:
requires:
- build-linux
- benchmarks:
requires:
- build-linux
- build-test-windows:
name: Java 11 - Windows - OpenJDK

Expand All @@ -52,26 +56,44 @@ jobs:
parameters:
docker-image:
type: string
with-coverage:
type: boolean
default: false
docker:
- image: <<parameters.docker-image>>
- image: redis
steps:
- checkout
- run: cp gradle.properties.example gradle.properties
- attach_workspace:
at: build
- run: java -version
- run: ./gradlew test
- run:
name: Run tests
command: ./gradlew test
- when:
condition: <<parameters.with-coverage>>
steps:
- run:
name: Generate test coverage report
command: |
./gradlew jacocoTestReport
mkdir -p coverage/
cp -r build/reports/jacoco/test/* ./coverage
- run:
name: Save test results
command: |
mkdir -p ~/junit/;
mkdir -p ~/junit/
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
when: always
- store_test_results:
path: ~/junit
- store_artifacts:
path: ~/junit
- when:
condition: <<parameters.with-coverage>>
steps:
- store_artifacts:
path: coverage

build-test-windows:
executor:
Expand All @@ -85,18 +107,6 @@ jobs:
$ProgressPreference = "SilentlyContinue" # prevents console errors from CircleCI host
iwr -outf openjdk.msi https://developers.redhat.com/download-manager/file/java-11-openjdk-11.0.5.10-2.windows.redhat.x86_64.msi
Start-Process msiexec.exe -Wait -ArgumentList '/I openjdk.msi /quiet'
- run:
name: start Redis
command: |
$ProgressPreference = "SilentlyContinue"
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
mkdir redis
Expand-Archive -Path redis.zip -DestinationPath redis
cd redis
.\redis-server --service-install
.\redis-server --service-start
Start-Sleep -s 5
.\redis-cli ping
- run:
name: build and test
command: |
Expand Down Expand Up @@ -131,3 +141,19 @@ jobs:
- run:
name: run packaging tests
command: cd packaging-test && make all

benchmarks:
docker:
- image: circleci/openjdk:11
steps:
- run: java -version
- run: sudo apt-get install make -y -q
- checkout
- attach_workspace:
at: build
- run: cat gradle.properties.example >>gradle.properties
- run:
name: run benchmarks
command: cd benchmarks && make
- store_artifacts:
path: benchmarks/build/reports/jmh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ out/
classes/

packaging-test/temp/
benchmarks/lib/
7 changes: 5 additions & 2 deletions .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ publications:

template:
name: gradle
env:
LD_SKIP_DATABASE_TESTS: 1

releasableBranches:
- name: master
description: 5.x
- name: 4.x

documentation:
githubPages: true
Expand Down
35 changes: 30 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Contributing to the LaunchDarkly Server-side SDK for Java
================================================
# Contributing to the LaunchDarkly Server-side SDK for Java

LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.

Expand All @@ -15,8 +14,10 @@ We encourage pull requests and other contributions from the community. Before su

### Prerequisites

The SDK builds with [Gradle](https://gradle.org/) and should be built against Java 7.

The SDK builds with [Gradle](https://gradle.org/) and should be built against Java 8.

Many basic classes are implemented in the module `launchdarkly-java-sdk-common`, whose source code is in the [`launchdarkly/java-sdk-common`](https://github.com/launchdarkly/java-sdk-common) repository; this is so the common code can be shared with the LaunchDarkly Android SDK. By design, the LaunchDarkly Java SDK distribution does not expose a dependency on that module; instead, its classes and Javadoc content are embedded in the SDK jars.

### Building

To build the SDK without running any tests:
Expand All @@ -41,4 +42,28 @@ To build the SDK and run all unit tests:
./gradlew test
```

By default, the full unit test suite includes live tests of the Redis integration. Those tests expect you to have Redis running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests.
### Benchmarks

The project in the `benchmarks` subdirectory uses [JMH](https://openjdk.java.net/projects/code-tools/jmh/) to generate performance metrics for the SDK. This is run as a CI job, and can also be run manually by running `make` within `benchmarks` and then inspecting `build/reports/jmh`.

## Coding best practices

### Logging

Currently the SDK uses SLF4J for all log output. Here some things to keep in mind for good logging behavior:

1. Stick to the standardized logger name scheme defined in `Loggers.java`, preferably for all log output, but definitely for all log output above `DEBUG` level. Logger names can be useful for filtering log output, so it is desirable for users to be able to reference a clear, stable logger name like `com.launchdarkly.sdk.server.LDClient.Events` rather than a class name like `com.launchdarkly.sdk.server.EventSummarizer` which is an implementation detail. The text of a log message should be distinctive enough that we can easily find which class generated the message.

2. Use parameterized messages (`Logger.MAIN.info("The value is {}", someValue)`) rather than string concatenation (`Logger.MAIN.info("The value is " + someValue)`). This avoids the overhead of string concatenation if the logger is not enabled for that level. If computing the value is an expensive operation, and it is _only_ relevant for logging, consider implementing that computation via a custom `toString()` method on some wrapper type so that it will be done lazily only if the log level is enabled.

3. Exception stacktraces should only be logged at debug level. For instance: `Logger.MAIN.warn("An error happened: {}", ex.toString()); Logger.MAIN.debug(ex.toString(), ex)`. Also, consider whether the stacktrace would be at all meaningful in this particular context; for instance, in a `try` block around a network I/O operation, the stacktrace would only tell us (a) some internal location in Java standard libraries and (b) the location in our own code where we tried to do the operation; (a) is very unlikely to tell us anything that the exception's type and message doesn't already tell us, and (b) could be more clearly communicated by just writing a specific log message.

### Code coverage

It is important to keep unit test coverage as close to 100% as possible in this project. You can view the latest code coverage report in CircleCI, as `coverage/html/index.html` in the artifacts for the "Java 11 - Linux - OpenJDK" job. You can also run the report locally with `./gradlew jacocoTestCoverage` and view `./build/reports/jacoco/test`. _The CircleCI build will fail if you commit a change that increases the number of uncovered lines_, unless you explicitly add an override as shown below.

Sometimes a gap in coverage is unavoidable, usually because the compiler requires us to provide a code path for some condition that in practice can't happen and can't be tested, or because of a known issue with the code coverage tool. Please handle all such cases as follows:

* Mark the code with an explanatory comment beginning with "COVERAGE:".
* Run the code coverage task with `./gradlew jacocoTestCoverageVerification`. It should fail and indicate how many lines of missed coverage exist in the method you modified.
* Add an item in the `knownMissedLinesForMethods` map in `build.gradle` that specifies that number of missed lines for that method signature. For instance, if the method `com.launchdarkly.sdk.server.SomeClass.someMethod(java.lang.String)` has two missed lines that cannot be covered, you would add `"SomeClass.someMethod(java.lang.String)": 2`.
43 changes: 16 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,61 @@
LaunchDarkly Server-side SDK for Java
=========================
# LaunchDarkly Server-side SDK for Java

[![Circle CI](https://circleci.com/gh/launchdarkly/java-server-sdk.svg?style=shield)](https://circleci.com/gh/launchdarkly/java-server-sdk)
[![Javadocs](http://javadoc.io/badge/com.launchdarkly/launchdarkly-java-server-sdk.svg)](http://javadoc.io/doc/com.launchdarkly/launchdarkly-java-server-sdk)

LaunchDarkly overview
-------------------------
## LaunchDarkly overview

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Supported Java versions
-----------------------
## Supported Java versions

This version of the LaunchDarkly SDK works with Java 7 and above.
This version of the LaunchDarkly SDK works with Java 8 and above.

Distributions
-------------
## Distributions

Three variants of the SDK jar are published to Maven:

* The default uberjar - this is accessible as `com.launchdarkly:launchdarkly-java-server-sdk:jar` and is the dependency used in the "[Getting started](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started)" section of the SDK reference guide as well as in the [`hello-java`](https://github.com/launchdarkly/hello-java) sample app. This variant contains the SDK classes, and all of the SDK's dependencies except for Gson and SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
* The extended uberjar - add `<classifier>all</classifier>` in Maven, or `:all` in Gradle. This is the same as the default uberjar except that Gson and SLF4J are also bundled, without shading (and are exported in OSGi).
* The default uberjar - this is accessible as `com.launchdarkly:launchdarkly-java-server-sdk:jar` and is the dependency used in the "[Getting started](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started)" section of the SDK reference guide as well as in the [`hello-java`](https://github.com/launchdarkly/hello-java) sample app. This variant contains the SDK classes, and all of the SDK's dependencies except for SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
* The extended uberjar - add `<classifier>all</classifier>` in Maven, or `:all` in Gradle. This is the same as the default uberjar except that SLF4J is also bundled, without shading (and is exported in OSGi).
* The "thin" jar - add `<classifier>thin</classifier>` in Maven, or `:thin` in Gradle. This contains _only_ the SDK classes.

Getting started
-----------
## Getting started

Refer to the [SDK reference guide](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started) for instructions on getting started with using the SDK.

Logging
-------
## Logging

The LaunchDarkly SDK uses [SLF4J](https://www.slf4j.org/). All loggers are namespaced under `com.launchdarkly`. For an example configuration check out the [hello-java](https://github.com/launchdarkly/hello-java) project.

Be aware of two considerations when enabling the DEBUG log level:
1. Debug-level logs can be very verbose. It is not recommended that you turn on debug logging in high-volume environments.
1. Potentially sensitive information is logged including LaunchDarkly users created by you in your usage of this SDK.

Using flag data from a file
---------------------------
## Using flag data from a file

For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See <a href="http://javadoc.io/page/com.launchdarkly/launchdarkly-java-server-sdk/latest/com/launchdarkly/client/files/FileComponents.html">FileComponents</a> for more details.

DNS caching issues
------------------
## DNS caching issues

LaunchDarkly servers operate in a load-balancing framework which may cause their IP addresses to change. This could result in the SDK failing to connect to LaunchDarkly if an old IP address is still in your system's DNS cache.

Unlike some other languages, in Java the DNS caching behavior is controlled by the Java virtual machine rather than the operating system. The default behavior varies depending on whether there is a [security manager](https://docs.oracle.com/javase/tutorial/essential/environment/security.html): if there is, IP addresses will _never_ expire. In that case, we recommend that you set the security property `networkaddress.cache.ttl`, as described [here](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html), to a number of seconds such as 30 or 60 (a lower value will reduce the chance of intermittent failures, but will slightly reduce networking performance).

Learn more
----------
## Learn more

Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/java-sdk-reference) or our [code-generated API documentation](https://launchdarkly.github.io/java-server-sdk/).

Testing
-------
## Testing

We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.

Contributing
------------
## Contributing

We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.

About LaunchDarkly
-----------
## About LaunchDarkly

* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
Expand Down
36 changes: 36 additions & 0 deletions benchmarks/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.PHONY: benchmark clean sdk

BASE_DIR:=$(shell pwd)
PROJECT_DIR=$(shell cd .. && pwd)
SDK_VERSION=$(shell grep "version=" $(PROJECT_DIR)/gradle.properties | cut -d '=' -f 2)

BENCHMARK_ALL_JAR=lib/launchdarkly-java-server-sdk-all.jar
BENCHMARK_TEST_JAR=lib/launchdarkly-java-server-sdk-test.jar
SDK_JARS_DIR=$(PROJECT_DIR)/build/libs
SDK_ALL_JAR=$(SDK_JARS_DIR)/launchdarkly-java-server-sdk-$(SDK_VERSION)-all.jar
SDK_TEST_JAR=$(SDK_JARS_DIR)/launchdarkly-java-server-sdk-$(SDK_VERSION)-test.jar

benchmark: $(BENCHMARK_ALL_JAR) $(BENCHMARK_TEST_JAR)
rm -rf build/tmp
../gradlew jmh
cat build/reports/jmh/human.txt
../gradlew jmhReport

clean:
rm -rf build lib

sdk: $(BENCHMARK_ALL_JAR) $(BENCHMARK_TEST_JAR)

$(BENCHMARK_ALL_JAR): $(SDK_ALL_JAR)
mkdir -p lib
cp $< $@

$(BENCHMARK_TEST_JAR): $(SDK_TEST_JAR)
mkdir -p lib
cp $< $@

$(SDK_ALL_JAR):
cd .. && ./gradlew shadowJarAll

$(SDK_TEST_JAR):
cd .. && ./gradlew testJar
64 changes: 64 additions & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

buildscript {
repositories {
jcenter()
mavenCentral()
}
}

plugins {
id "me.champeau.gradle.jmh" version "0.5.0"
id "io.morethan.jmhreport" version "0.9.0"
}

repositories {
mavenCentral()
}

ext.versions = [
"jmh": "1.21",
"guava": "19.0"
]

dependencies {
compile files("lib/launchdarkly-java-server-sdk-all.jar")
compile files("lib/launchdarkly-java-server-sdk-test.jar")
compile "com.google.code.gson:gson:2.7"
compile "com.google.guava:guava:${versions.guava}" // required by SDK test code
compile "com.squareup.okhttp3:mockwebserver:3.12.10"
compile "org.openjdk.jmh:jmh-core:1.21"
compile "org.openjdk.jmh:jmh-generator-annprocess:${versions.jmh}"
}

jmh {
iterations = 10 // Number of measurement iterations to do.
benchmarkMode = ['avgt'] // "average time" - reports execution time as ns/op and allocations as B/op.
// batchSize = 1 // Batch size: number of benchmark method calls per operation. (some benchmark modes can ignore this setting)
fork = 1 // How many times to forks a single benchmark. Use 0 to disable forking altogether
// failOnError = false // Should JMH fail immediately if any benchmark had experienced the unrecoverable error?
forceGC = true // Should JMH force GC between iterations?
humanOutputFile = project.file("${project.buildDir}/reports/jmh/human.txt") // human-readable output file
// resultsFile = project.file("${project.buildDir}/reports/jmh/results.txt") // results file
operationsPerInvocation = 3 // Operations per invocation.
// benchmarkParameters = [:] // Benchmark parameters.
profilers = [ 'gc' ] // Use profilers to collect additional data. Supported profilers: [cl, comp, gc, stack, perf, perfnorm, perfasm, xperf, xperfasm, hs_cl, hs_comp, hs_gc, hs_rt, hs_thr]
timeOnIteration = '1s' // Time to spend at each measurement iteration.
resultFormat = 'JSON' // Result format type (one of CSV, JSON, NONE, SCSV, TEXT)
// synchronizeIterations = false // Synchronize iterations?
// threads = 4 // Number of worker threads to run with.
// timeout = '1s' // Timeout for benchmark iteration.
timeUnit = 'ns' // Output time unit. Available time units are: [m, s, ms, us, ns].
verbosity = 'NORMAL' // Verbosity mode. Available modes are: [SILENT, NORMAL, EXTRA]
warmup = '1s' // Time to spend at each warmup iteration.
warmupBatchSize = 2 // Warmup batch size: number of benchmark method calls per operation.
warmupIterations = 1 // Number of warmup iterations to do.
// warmupForks = 0 // How many warmup forks to make for a single benchmark. 0 to disable warmup forks.
// warmupMode = 'INDI' // Warmup mode for warming up selected benchmarks. Warmup modes are: [INDI, BULK, BULK_INDI].

jmhVersion = versions.jmh
}

jmhReport {
jmhResultPath = project.file('build/reports/jmh/results.json')
jmhReportOutput = project.file('build/reports/jmh')
}
1 change: 1 addition & 0 deletions benchmarks/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'launchdarkly-java-server-sdk-benchmarks'
Loading