Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
ef1061e
fix: handle undefined flag variations in fallthrough (#205)
cwaldren-ld Aug 24, 2023
648e202
Merge branch 'main' into server-side
cwaldren-ld Aug 24, 2023
9edacd1
Merge branch 'main' into server-side
cwaldren-ld Aug 25, 2023
09c74dd
remove contract test branch from server.yml
cwaldren-ld Aug 25, 2023
4ccd79f
fix: refactor Variation methods for correctness & clarity (#203)
cwaldren-ld Aug 25, 2023
a7a9660
Merge branch 'main' into server-side
cwaldren-ld Aug 25, 2023
9ec37f6
refactor: push typechecking of variation methods deeper down (#216)
cwaldren-ld Aug 28, 2023
30bfed2
Merge branch 'main' into server-side
cwaldren-ld Aug 28, 2023
62cb864
Merge branch 'main' into server-side
cwaldren-ld Aug 29, 2023
66b4c83
fix: deserializing certain values leads to infinite loop (#224)
cwaldren-ld Aug 29, 2023
eb1b3ed
feat: add DataSourceStatus() and plumb through IClient interface (#217)
cwaldren-ld Aug 30, 2023
b9c03e2
Merge branch 'main' into server-side
cwaldren-ld Aug 30, 2023
371ab00
refactor: move DataSourceStatus ErrorInfo C Bindings into common (#225)
cwaldren-ld Aug 30, 2023
61ddbe7
add Doxygen config and doc.md
cwaldren-ld Aug 30, 2023
aba2473
chore: add Server-side README (#226)
cwaldren-ld Aug 31, 2023
1538a76
fix: ensure flag updates go through data store updater (#228)
cwaldren-ld Aug 31, 2023
7ab8c1d
Merge branch 'main' into server-side
cwaldren-ld Aug 31, 2023
3669ff5
feat: server-side C bindings (#210)
cwaldren-ld Aug 31, 2023
4889549
feat: plumb server side initial backoff delay (#232)
cwaldren-ld Sep 1, 2023
d0ce48d
add story label to remaining test suppressions:
cwaldren-ld Sep 1, 2023
1db6db9
chore: resolve ValidChar function lint/compile warnings (#234)
cwaldren-ld Sep 5, 2023
20abc69
Merge branch 'server-side' into rlamb/common-persistent-store
cwaldren-ld Sep 6, 2023
5f04888
Merge branch 'main' into server-side
cwaldren-ld Sep 11, 2023
fe9e559
Merge branch 'main' into server-side
cwaldren-ld Sep 14, 2023
61a3bef
use async_connect() instead of run() in streaming data source
cwaldren-ld Sep 15, 2023
d3730a8
Merge branch 'server-side' into rlamb/common-persistent-store
cwaldren-ld Sep 15, 2023
8f92208
Merge branch 'main' into rlamb/common-persistent-store
cwaldren-ld Oct 24, 2023
8345ebb
fix merge
cwaldren-ld Oct 24, 2023
1e6f05d
add launchdarkly::unreachable to switch
cwaldren-ld Oct 24, 2023
0a7340a
adding in sync and bootstrap builders
cwaldren-ld Sep 20, 2023
82d9fa1
creating DataSourcesBuilder
cwaldren-ld Sep 20, 2023
cf5792e
config builders for DataSources are compiling
cwaldren-ld Sep 20, 2023
86e7389
add PullModeDataSource
cwaldren-ld Sep 20, 2023
4f56358
rename push/pull:
cwaldren-ld Sep 20, 2023
b2cb6a4
a lot of re-arranging
cwaldren-ld Sep 20, 2023
17bcc1d
re-integrating the code that was in persistent_store_core into new model
cwaldren-ld Sep 21, 2023
6712ac9
large refactoring of directory structure
cwaldren-ld Sep 22, 2023
984efc4
rename data_system namespace to data_retreival
cwaldren-ld Sep 22, 2023
648cbac
updating client to use IDataSystem
cwaldren-ld Sep 22, 2023
6a6a7b9
fixing lots of includes
cwaldren-ld Sep 22, 2023
f76e6fd
rename data_retrieval dir to data
cwaldren-ld Oct 24, 2023
d3d5ff2
massive refactoring of namespaces
cwaldren-ld Oct 24, 2023
caf7665
approaching compilation
cwaldren-ld Oct 25, 2023
d1e1b82
only 8 files not compiling :)
cwaldren-ld Oct 25, 2023
78be652
it compiles
cwaldren-ld Oct 26, 2023
3dfeebf
refactor client's use of IDataSource interface
cwaldren-ld Oct 26, 2023
ab4a1fa
adding tons of builders
cwaldren-ld Oct 27, 2023
c1857d5
checkpoint: before refactoring config to be SDK specific
cwaldren-ld Nov 3, 2023
271d1b5
feat: refactor server side config
cwaldren-ld Nov 3, 2023
bee9be3
move unit tests from common to lib/server
cwaldren-ld Nov 3, 2023
771fe74
fix tests
cwaldren-ld Nov 3, 2023
54ecdce
contract tests
cwaldren-ld Nov 3, 2023
b9a3059
Merge branch 'cw/sc-223686/config-refactor' into cw/sc-217924/persist…
cwaldren-ld Nov 13, 2023
7ccd3c9
swap DataSourceBuilder with DataSystemBuilder in server config
cwaldren-ld Nov 13, 2023
8d64177
revert changes to common config
cwaldren-ld Nov 13, 2023
d4130fe
fixing the bad merge..
cwaldren-ld Nov 13, 2023
b82e93c
updating server config tests to try out data system
cwaldren-ld Nov 13, 2023
88cd795
fix data system config test
cwaldren-ld Nov 13, 2023
60eb567
update namespaces for server tests
cwaldren-ld Nov 13, 2023
12bd033
fix hello app
cwaldren-ld Nov 13, 2023
ae02047
setup data system config in tests
cwaldren-ld Nov 13, 2023
d83cc4f
add support for disabling background sync
cwaldren-ld Nov 14, 2023
97f554f
fix contract test build
cwaldren-ld Nov 14, 2023
6d0f831
wire up data system identity
cwaldren-ld Nov 14, 2023
2475f7b
fix client-side contract test build
cwaldren-ld Nov 14, 2023
71be6fe
fetch redis++ using FetchContent
cwaldren-ld Nov 14, 2023
feaa919
adding hiredis
cwaldren-ld Nov 14, 2023
a37623e
add some sanity tests for redis
cwaldren-ld Nov 14, 2023
2fbceb0
adding data system error codes
cwaldren-ld Nov 15, 2023
286250d
encapsulate redis connection opts
cwaldren-ld Nov 15, 2023
866a2c0
rename redis errors
cwaldren-ld Nov 15, 2023
30f8a2c
Revert "encapsulate redis connection opts"
cwaldren-ld Nov 15, 2023
3112499
update tests
cwaldren-ld Nov 15, 2023
b00b7ca
docs and update tests
cwaldren-ld Nov 15, 2023
04f615f
fix tests
cwaldren-ld Nov 15, 2023
bc636e4
moving a bunch of files from common to server sdk
cwaldren-ld Nov 16, 2023
f2856a9
Merge branch 'main' into rlamb/common-persistent-store
cwaldren-ld Nov 16, 2023
1676f67
Merge branch 'rlamb/common-persistent-store' into cw/sc-217924/persis…
cwaldren-ld Nov 16, 2023
7721c67
Merge branch 'cw/sc-217924/persistent-store-refactoring' into cw/sc-2…
cwaldren-ld Nov 16, 2023
8cc183d
feat: add data system interfaces
cwaldren-ld Nov 16, 2023
c684a00
lints
cwaldren-ld Nov 16, 2023
11dda0d
Merge branch 'cw/add-data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 16, 2023
3dc9dcb
rename data_store_updater -> change_notifier
cwaldren-ld Nov 16, 2023
a54c76e
move dependency tracker
cwaldren-ld Nov 16, 2023
683e65b
move expiration tracker + update unit tests
cwaldren-ld Nov 16, 2023
cfdbfe5
adding memory store
cwaldren-ld Nov 16, 2023
7323be1
update data source status
cwaldren-ld Nov 16, 2023
00c3695
Merge branch 'cw/add-data-components' into cw/sc-224112/redis-client
cwaldren-ld Nov 17, 2023
3d9d841
it compiles
cwaldren-ld Nov 17, 2023
bd2c388
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 17, 2023
59b8e7b
remove redundant namespace qualifiers in expiration_tracker.cpp
cwaldren-ld Nov 20, 2023
d81c085
add missing configs to CMakeLists.txt
cwaldren-ld Nov 20, 2023
6ad3d55
fix default configs
cwaldren-ld Nov 20, 2023
6c291a5
fix expiration tracker compilation
cwaldren-ld Nov 20, 2023
5f3cdca
add missing data_destination_builder to CMakeLists.txt
cwaldren-ld Nov 20, 2023
fb44d55
json pull source compilation
cwaldren-ld Nov 20, 2023
7406963
add missing kinds.cpp to CMakeLists.txt
cwaldren-ld Nov 20, 2023
07edf29
add missing data_source_status.cpp; compiles
cwaldren-ld Nov 20, 2023
c6f9953
unit tests for lazy load system
cwaldren-ld Nov 20, 2023
ee63fa5
implementing more of lazy load tracker and unit tests
cwaldren-ld Nov 20, 2023
0f6b468
refactor IPushSource to take IDestination as method argument instead …
cwaldren-ld Nov 20, 2023
396825d
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 20, 2023
abed975
add back offline mode
cwaldren-ld Nov 21, 2023
58f563e
partially implement JsonDestination
cwaldren-ld Nov 21, 2023
a233eff
add back in missing streaming/polling C binding builders
cwaldren-ld Nov 21, 2023
9030628
fix offline default config
cwaldren-ld Nov 21, 2023
44d87ab
add Enabled c binding for data system builder
cwaldren-ld Nov 21, 2023
1a8162f
fix contract test compilation; unit tests work
cwaldren-ld Nov 21, 2023
28e7420
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 21, 2023
cfa10bd
integrate merged changes
cwaldren-ld Nov 21, 2023
39514fa
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 21, 2023
e21d30d
remove obsolete file
cwaldren-ld Nov 21, 2023
0d83cfc
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 21, 2023
57a28c4
revert changes to C binding names for polling/streaming builders
cwaldren-ld Nov 22, 2023
741cd8d
update wording on c binding builders
cwaldren-ld Nov 22, 2023
910e8a7
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 22, 2023
8a14a1d
fix formatting in builder.h
cwaldren-ld Nov 22, 2023
2ca1491
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 22, 2023
a788d81
revert changes to server_c_bindings_test.cpp
cwaldren-ld Nov 22, 2023
a68fe55
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 22, 2023
e693d85
back out irrelevant change to client_entity
cwaldren-ld Nov 22, 2023
706fd85
remove obsolete json_pull_source.cpp
cwaldren-ld Nov 22, 2023
17089fe
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 22, 2023
81c5dc3
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 22, 2023
c416964
feat: implement JsonDestination
cwaldren-ld Nov 22, 2023
5711b7e
update SerializedItemDescriptor
cwaldren-ld Nov 22, 2023
c3fb9be
implementing JSON destination
cwaldren-ld Nov 22, 2023
623e174
update comments on ISerializedDestination
cwaldren-ld Nov 22, 2023
533d3a6
update comments
cwaldren-ld Nov 22, 2023
094905c
Merge branch 'feat/data-system' into cw/json-destination-impl
cwaldren-ld Nov 27, 2023
f747f70
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 27, 2023
4ca20a9
add WriteMinimal for std::vector, use in flag/segment serialization
cwaldren-ld Nov 27, 2023
d49e37b
add bool perator for ISerializedItemKind and descriptor
cwaldren-ld Nov 27, 2023
d54ae62
add kinds.cpp to CMakeLists.txt
cwaldren-ld Nov 27, 2023
e532133
add tests for JsonDestination
cwaldren-ld Nov 27, 2023
e2e4d40
more tests
cwaldren-ld Nov 27, 2023
fb6971c
more tests
cwaldren-ld Nov 27, 2023
d904a77
add test fixture
cwaldren-ld Nov 27, 2023
055f40a
typo
cwaldren-ld Nov 27, 2023
4b88673
update flag serialization test in internal
cwaldren-ld Nov 27, 2023
f00bf07
update unbounded segment serialization test
cwaldren-ld Nov 27, 2023
b347f33
Merge branch 'feat/data-system' into cw/json-destination-impl
cwaldren-ld Nov 27, 2023
3ec5839
add lazy load system unit tests
cwaldren-ld Nov 27, 2023
85991f4
fix: allow items in expiration tracker to be updated
cwaldren-ld Nov 28, 2023
d39703a
add back Initialize to IDataReader
cwaldren-ld Nov 28, 2023
5f16bfe
update lazy load tests
cwaldren-ld Nov 28, 2023
4549146
update lazy load behavior based on code review
cwaldren-ld Nov 28, 2023
0ca8b5d
try to fix gmock segfault
cwaldren-ld Nov 28, 2023
99e4fdc
add RemoveSegment/RemoveFlag to MemoryStore
cwaldren-ld Nov 28, 2023
e62648f
implement json_deserializer All methods
cwaldren-ld Nov 28, 2023
d49690d
another attempt
cwaldren-ld Nov 28, 2023
1cb9cb6
backout some lazy load changes
cwaldren-ld Nov 28, 2023
ff5fd5a
try to not have a sigsegv
cwaldren-ld Nov 28, 2023
2d48311
one more attempt
cwaldren-ld Nov 28, 2023
753eb8e
think I was using gmock wrong, use testing::ReturnRef
cwaldren-ld Nov 28, 2023
f3afd59
refactor json_deserializer.hpp
cwaldren-ld Nov 28, 2023
af56baa
remove identity test
cwaldren-ld Nov 28, 2023
54e6953
try only instantiating the test fixture
cwaldren-ld Nov 28, 2023
8f9135b
29th try
cwaldren-ld Nov 28, 2023
58122a2
fix some includes
cwaldren-ld Nov 29, 2023
c4bd414
add back missing tests
cwaldren-ld Nov 29, 2023
cb712d4
Merge branch 'cw/json-destination-impl' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
ff16434
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
bc5d216
Merge branch 'feat/data-system' into cw/lazy-load-tests
cwaldren-ld Nov 29, 2023
ab98d99
refactoring lazy_load to use templated getters
cwaldren-ld Nov 29, 2023
125608c
Merge branch 'feat/data-system' into cw/lazy-load-tests
cwaldren-ld Nov 29, 2023
4b79841
add design comment to Lazy Load system
cwaldren-ld Nov 29, 2023
5751834
add [[nodiscard]] in serialized data reader
cwaldren-ld Nov 29, 2023
b465bd1
cleanup logging/error handling in json_deserializer.cpp
cwaldren-ld Nov 29, 2023
7e0ca2c
update lazy load test
cwaldren-ld Nov 29, 2023
a28633e
fix segfault
cwaldren-ld Nov 29, 2023
b203908
more tests
cwaldren-ld Nov 29, 2023
b80b246
remove commented out initialization code in client
cwaldren-ld Nov 29, 2023
143f8c1
remove shutdown method
cwaldren-ld Nov 29, 2023
26341f6
fix contract tests
cwaldren-ld Nov 29, 2023
de8f0b8
fix test
cwaldren-ld Nov 29, 2023
2d737b6
typo
cwaldren-ld Nov 29, 2023
41b29ba
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
a9187f6
add redis example
cwaldren-ld Nov 29, 2023
f07c8ac
add offline data system and revert test change
cwaldren-ld Nov 29, 2023
1aaad0a
Merge branch 'cw/lazy-load-tests' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
37738f9
add offline data system and revert test change
cwaldren-ld Nov 29, 2023
555a1b9
Merge branch 'feat/data-system' into cw/lazy-load-tests
cwaldren-ld Nov 29, 2023
b930275
Merge branch 'cw/lazy-load-tests' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
2f69919
update redis example
cwaldren-ld Nov 29, 2023
fe710b0
Merge branch 'feat/data-system' into cw/lazy-load-tests
cwaldren-ld Nov 29, 2023
368dd12
fix offline tests
cwaldren-ld Nov 29, 2023
c9e2e92
delete old noop data source
cwaldren-ld Nov 29, 2023
7ce3ba8
Merge branch 'cw/lazy-load-tests' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
0f492ed
fix formatting of backgroudn_sync_system.hpp
cwaldren-ld Nov 29, 2023
31bd830
Merge branch 'feat/data-system' into cw/lazy-load-tests
cwaldren-ld Nov 29, 2023
6936b4d
Merge branch 'cw/lazy-load-tests' into cw/sc-224112/redis-client
cwaldren-ld Nov 29, 2023
5fe1a71
fix cmake inclusion of Redis
cwaldren-ld Nov 29, 2023
e20a267
try removing linking to hiredis::hiredis
cwaldren-ld Nov 29, 2023
f66f680
fix wrong data kind in json_deserializer
cwaldren-ld Nov 30, 2023
bff55ea
add debug logs to lazy load system caching functions
cwaldren-ld Nov 30, 2023
7bfbd98
try disabling redis++ tests
cwaldren-ld Nov 30, 2023
46c95da
use older redis++ release
cwaldren-ld Nov 30, 2023
dcf5710
remove errant boost::movelib
cwaldren-ld Nov 30, 2023
aee6029
fix test
cwaldren-ld Nov 30, 2023
95427db
add missing <memory> header
cwaldren-ld Nov 30, 2023
9b01ee9
add missing <iomanip> header
cwaldren-ld Nov 30, 2023
7def292
update googletest
cwaldren-ld Nov 30, 2023
27c4fd9
make sure redis++ is linked statically
cwaldren-ld Nov 30, 2023
0a7eff9
try linking gtest's dependencies private
cwaldren-ld Nov 30, 2023
ec1dede
linking against wrong gmock library
cwaldren-ld Nov 30, 2023
7433b9a
revert googletest version'
cwaldren-ld Nov 30, 2023
7344564
try linking only gmock_main
cwaldren-ld Nov 30, 2023
fc8a21b
try adding redis++ in same target_link_libraries call
cwaldren-ld Nov 30, 2023
682197c
try not compiling redis tests at all
cwaldren-ld Nov 30, 2023
0e0b2fc
disable redis++ pic
cwaldren-ld Nov 30, 2023
2b0017f
remove all redis stuff
cwaldren-ld Nov 30, 2023
0e8b17a
try fetching redis++ only
cwaldren-ld Nov 30, 2023
2959e10
try using FetchContent git for googletest
cwaldren-ld Nov 30, 2023
0e4dc5b
suppress gtest warnings
cwaldren-ld Nov 30, 2023
42c6823
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Nov 30, 2023
8a6890c
revert googletest change
cwaldren-ld Nov 30, 2023
69e9fa9
guard windows-only cmake_runtime_output_dir changes to win32
cwaldren-ld Nov 30, 2023
39d08eb
fix tests
cwaldren-ld Nov 30, 2023
4248c26
add tiny delay to TimeIsUpdatedOnStateChange test
cwaldren-ld Dec 1, 2023
a932419
disable redis by default
cwaldren-ld Dec 1, 2023
fee073b
refactor redis integration into dedicated cmake project
cwaldren-ld Dec 1, 2023
47758b3
add github workflows
cwaldren-ld Dec 1, 2023
f9a37ac
add redis container
cwaldren-ld Dec 1, 2023
4b361af
enable windows + mac builds for redis
cwaldren-ld Dec 1, 2023
c18d743
remove some cruft from action
cwaldren-ld Dec 1, 2023
c63c292
lints
cwaldren-ld Dec 1, 2023
40a23e7
fix hello redis example build to link against proper target
cwaldren-ld Dec 1, 2023
0f007aa
link redis++ statically always
cwaldren-ld Dec 1, 2023
9e922c5
revert release please changes
cwaldren-ld Dec 1, 2023
2994d8e
Merge branch 'feat/data-system' into cw/sc-224112/redis-client
cwaldren-ld Dec 1, 2023
14c3cef
try simulating release
cwaldren-ld Dec 1, 2023
54ab922
make hello apps pass?
cwaldren-ld Dec 1, 2023
623bdd8
significantly simplify ISerializedDataReader interface and usage
cwaldren-ld Dec 1, 2023
2c28a45
restore elegance of cache algorithm
cwaldren-ld Dec 2, 2023
b1614ca
more unit tests
cwaldren-ld Dec 2, 2023
aa8ddc0
remove useless Clear method in tests
cwaldren-ld Dec 2, 2023
6efb432
yet even more unit tests
cwaldren-ld Dec 2, 2023
0fee653
try reverting changes to suppress gtest build errors
cwaldren-ld Dec 2, 2023
f40df7b
add Doxyfile
cwaldren-ld Dec 2, 2023
c5e63a1
try supressing gtest error in only the redis project
cwaldren-ld Dec 2, 2023
2562684
add github templates
cwaldren-ld Dec 2, 2023
9181314
add README
cwaldren-ld Dec 2, 2023
4f9e664
add json.hpp to json_destination.cpp
cwaldren-ld Dec 2, 2023
c4c7c32
take 2 on suppressing gtest errors
cwaldren-ld Dec 2, 2023
0396c83
Update examples/hello-cpp-server-redis/main.cpp
cwaldren-ld Dec 4, 2023
f8db865
chore: fix broken newline in readme
cwaldren-ld Dec 4, 2023
b561989
polish redis_source.hpp
cwaldren-ld Dec 4, 2023
2c6f35a
update example
cwaldren-ld Dec 4, 2023
44a72fa
add todo for tombstone deserializer
cwaldren-ld Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/server-sdk-redis-source--bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: 'C++ Server SDK / Redis Source Bug Report'
about: Create a report to help us improve
title: ''
labels: 'package: sdk/server-redis, bug'
assignees: ''

---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this
library. If you're not sure whether the problem you are having is specifically related to this library, or to the
LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to
investigate the problem and will consult the SDK team if necessary. You can submit a support request by
going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing
support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on
your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.
To get more logs from the SDK, change the log level using environment variable `LD_LOG_LEVEL`. For example:

```
LD_LOG_LEVEL=debug ./your-application
```

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, C++17 or C11. If you are using a language that requires a separate compiler, such as C, please include the
name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the
browser type and version.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/server-sdk-redis-source--feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: 'C++ Server SDK / Redis Source Feature Request'
about: Create a report to help us improve
title: ''
labels: 'package: sdk/server-redis, feature'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
1 change: 1 addition & 0 deletions .github/workflows/manual-publish-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
options:
- libs/client-sdk
- libs/server-sdk
- libs/server-sdk-redis-source
name: Publish Documentation
jobs:
build-publish:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-sdk-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
options:
- libs/client-sdk:launchdarkly-cpp-client
- libs/server-sdk:launchdarkly-cpp-server
- libs/server-sdk-redis-source:launchdarkly-cpp-server-redis-source

name: Publish SDK Artifacts

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/server-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: libs/server-sdk-redis-source

on:
push:
branches: [ main ]
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [ "main", "feat/**" ]
paths-ignore:
- '**.md'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the github docs leads me to believe I can't run the services/redis in the Windows/Mac jobs.

jobs:
build-test-redis:
runs-on: ubuntu-22.04
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-server-redis-source
simulate_release: true
build-redis-mac:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci
with:
cmake_target: launchdarkly-cpp-server-redis-source
platform_version: 12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's a quickfix for running Redis on the macos and windows runners, I'm going to file a ticket for adding it in the future.

run_tests: false # TODO: figure out how to run Redis service on Mac
build-test-redis-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
- uses: ./.github/actions/ci
env:
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
with:
cmake_target: launchdarkly-cpp-server-redis-source
platform_version: 2022
toolset: msvc
run_tests: false # TODO: figure out how to run Redis service on Windows
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ option(LD_DYNAMIC_LINK_OPENSSL

option(LD_BUILD_EXAMPLES "Build hello-world examples." ON)

option(LD_BUILD_REDIS_SUPPORT "Build redis support." OFF)

# If using 'make' as the build system, CMake causes the 'install' target to have a dependency on 'all', meaning
# it will cause a full build. This disables that, allowing us to build piecemeal instead. This is useful
# so that we only need to build the client or server for a given release (if only the client or server were affected.)
Expand Down Expand Up @@ -142,6 +144,11 @@ add_subdirectory(libs/common)
add_subdirectory(libs/internal)
add_subdirectory(libs/server-sent-events)

if (LD_BUILD_REDIS_SUPPORT)
message("LaunchDarkly: building server-side redis support")
add_subdirectory(libs/server-sdk-redis-source)
endif ()

# Built as static or shared depending on LD_BUILD_SHARED_LIBS variable.
# This target "links" in common, internal, and sse as object libraries.
add_subdirectory(libs/client-sdk)
Expand Down
29 changes: 29 additions & 0 deletions cmake/redis-plus-plus.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.11)

include(FetchContent)


FetchContent_Declare(hiredis
GIT_REPOSITORY https://github.com/redis/hiredis.git
GIT_TAG 60e5075d4ac77424809f855ba3e398df7aacefe8
GIT_SHALLOW TRUE
SOURCE_DIR _deps/hiredis
OVERRIDE_FIND_PACKAGE
)


FetchContent_MakeAvailable(hiredis)

include_directories(${CMAKE_CURRENT_BINARY_DIR}/_deps)

set(REDIS_PLUS_PLUS_BUILD_TEST OFF CACHE BOOL "" FORCE)

# 1.3.7 is the last release that works with FetchContent, due to a problem with CheckSymbolExists
# when it tries to do feature detection on hiredis.
FetchContent_Declare(redis-plus-plus
GIT_REPOSITORY https://github.com/sewenew/redis-plus-plus.git
GIT_TAG 1.3.7
GIT_SHALLOW TRUE
)

FetchContent_MakeAvailable(redis-plus-plus)
4 changes: 4 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ add_subdirectory(hello-cpp-client)
add_subdirectory(hello-cpp-server)
add_subdirectory(hello-c-server)
add_subdirectory(client-and-server-coexistence)

if (LD_BUILD_REDIS_SUPPORT)
add_subdirectory(hello-cpp-server-redis)
endif ()
2 changes: 1 addition & 1 deletion examples/hello-c-server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main() {
return 1;
}
} else {
printf("SDK initialization didn't complete in %dms\n",
printf("*** SDK initialization didn't complete in %dms\n",
INIT_TIMEOUT_MILLISECONDS);
return 1;
}
Expand Down
15 changes: 15 additions & 0 deletions examples/hello-cpp-server-redis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Required for Apple Silicon support.
cmake_minimum_required(VERSION 3.19)

project(
LaunchDarklyHelloCPPServerRedisSource
VERSION 0.1
DESCRIPTION "LaunchDarkly Hello CPP Server-side SDK with Redis source"
LANGUAGES CXX
)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

add_executable(hello-cpp-server-redis-source main.cpp)
target_link_libraries(hello-cpp-server-redis-source PRIVATE launchdarkly::server_redis_source Threads::Threads)
108 changes: 108 additions & 0 deletions examples/hello-cpp-server-redis/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#include <launchdarkly/context_builder.hpp>
#include <launchdarkly/server_side/client.hpp>
#include <launchdarkly/server_side/config/config_builder.hpp>

#include <launchdarkly/server_side/integrations/redis/redis_source.hpp>

#include <cstring>
#include <iostream>

// Set SDK_KEY to your LaunchDarkly SDK key.
#define SDK_KEY ""

// Set FEATURE_FLAG_KEY to the feature flag key you want to evaluate.
#define FEATURE_FLAG_KEY "my-boolean-flag"

// Set INIT_TIMEOUT_MILLISECONDS to the amount of time you will wait for
// the client to become initialized.
#define INIT_TIMEOUT_MILLISECONDS 3000

// Set REDIS_URI to your own Redis instance's URI.
#define REDIS_URI "redis://localhost:6379"

// Set REDIS_PREFIX to the prefix containing the launchdarkly
// environment data in Redis.
#define REDIS_PREFIX "launchdarkly"

char const* get_with_env_fallback(char const* source_val,
char const* env_variable,
char const* error_msg);
using namespace launchdarkly;
using namespace launchdarkly::server_side;

int main() {
char const* sdk_key = get_with_env_fallback(
SDK_KEY, "LD_SDK_KEY",
"Please edit main.cpp to set SDK_KEY to your LaunchDarkly server-side "
"SDK key "
"first.\n\nAlternatively, set the LD_SDK_KEY environment "
"variable.\n"
"The value of SDK_KEY in main.c takes priority over LD_SDK_KEY.");

auto config_builder = ConfigBuilder(sdk_key);

using LazyLoad = server_side::config::builders::LazyLoadBuilder;

auto redis = integrations::RedisDataSource::Create(REDIS_URI, REDIS_PREFIX);

if (!redis) {
std::cout << "error: redis config is invalid: " << redis.error()
<< '\n';
return 1;
}

config_builder.DataSystem().Method(
LazyLoad().Source(*redis).CacheRefresh(std::chrono::seconds(30)));

auto config = config_builder.Build();
if (!config) {
std::cout << "error: config is invalid: " << config.error() << '\n';
return 1;
}

auto client = Client(std::move(*config));

auto start_result = client.StartAsync();

if (auto const status = start_result.wait_for(
std::chrono::milliseconds(INIT_TIMEOUT_MILLISECONDS));
status == std::future_status::ready) {
if (start_result.get()) {
std::cout << "*** SDK successfully initialized!\n\n";
} else {
std::cout << "*** SDK failed to initialize\n";
return 1;
}
} else {
std::cout << "*** SDK initialization didn't complete in "
<< INIT_TIMEOUT_MILLISECONDS << "ms\n";
return 1;
}

auto const context =
ContextBuilder().Kind("user", "example-user-key").Name("Sandy").Build();

bool const flag_value =
client.BoolVariation(context, FEATURE_FLAG_KEY, false);

std::cout << "*** Feature flag '" << FEATURE_FLAG_KEY << "' is "
<< (flag_value ? "true" : "false") << " for this user\n\n";

return 0;
}

char const* get_with_env_fallback(char const* source_val,
char const* env_variable,
char const* error_msg) {
if (strlen(source_val)) {
return source_val;
}

if (char const* from_env = std::getenv(env_variable);
from_env && strlen(from_env)) {
return from_env;
}

std::cout << "*** " << error_msg << std::endl;
std::exit(1);
}
6 changes: 4 additions & 2 deletions libs/client-sdk/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ file(GLOB tests "${PROJECT_SOURCE_DIR}/tests/*.cpp")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# Get things in the same directory on windows.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
endif ()

add_executable(gtest_${LIBNAME}
${tests})
Expand Down
4 changes: 4 additions & 0 deletions libs/client-sdk/tests/data_source_status_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "data_sources/data_source_status_manager.hpp"

#include <thread>

using launchdarkly::client_side::data_sources::DataSourceStatus;
using launchdarkly::client_side::data_sources::DataSourceStatusManager;
using launchdarkly::client_side::data_sources::IDataSourceStatusProvider;
Expand Down Expand Up @@ -145,6 +147,8 @@ TEST(DataSourceStatusManagerTests, TimeIsUpdatedOnStateChange) {
status_manager.SetState(DataSourceStatus::DataSourceState::kValid);

auto initial = status_manager.Status().StateSince();

std::this_thread::sleep_for(std::chrono::milliseconds(1));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO(add comment): This test randomly failed because the time hadn't changed at all. Not an ideal way to fix it, but we don't currently have a way to inject the time dependency.

status_manager.SetState(DataSourceStatus::DataSourceState::kInterrupted);

EXPECT_NE(initial.time_since_epoch().count(),
Expand Down
6 changes: 4 additions & 2 deletions libs/common/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ file(GLOB tests "${PROJECT_SOURCE_DIR}/tests/*.cpp"
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# Get things in the same directory on windows.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
endif ()

add_executable(gtest_${LIBNAME}
${tests})
Expand Down
2 changes: 2 additions & 0 deletions libs/common/tests/data_source_status_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <launchdarkly/data_sources/data_source_status_base.hpp>

#include <iomanip>

namespace test_things {
enum class TestDataSourceStates { kStateA = 0, kStateB = 1, kStateC = 2 };

Expand Down
6 changes: 4 additions & 2 deletions libs/internal/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ file(GLOB tests "${PROJECT_SOURCE_DIR}/tests/*.cpp")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

# Get things in the same directory on windows.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
if (WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}../")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}../")
endif ()

add_executable(gtest_${LIBNAME}
${tests})
Expand Down
Loading