-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: server-side SDK #160
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
c417579
feat: add server-sdk subdirectory
cwaldren-ld c985539
chore: move ItemDescriptor to internal library (#151)
cwaldren-ld 420d7a2
feat: update event processor to handle context key deduplication (#150)
cwaldren-ld 4f89b44
chore: Merge branch 'main' into server-side
kinyoklion dd174a2
feat: segment data model (#153)
cwaldren-ld 4954f88
feat: flag data model (#156)
cwaldren-ld f38e038
Merge branch 'main' into server-side
cwaldren-ld 09d2bd6
feat: add Flag model to SDKDataSet (#159)
cwaldren-ld 8367305
chore: Implement architecture diagram for data store. (#161)
kinyoklion 2781af0
fix: Add various missing headers. (#163)
kinyoklion 90627f2
chore: Implement server data source architecture diagram. (#167)
kinyoklion f2d96a4
feat: Implement basic in-memory store and change handling. (#165)
kinyoklion 3c12979
chore: Refactor to allow sharing data source status and IDataSource. …
kinyoklion 08aaa66
feat: Implement streaming data source. (#179)
kinyoklion 3692736
chore: Update data store updater use reference. (#181)
kinyoklion ceec434
Merge branch 'main' into server-side
kinyoklion 99dea86
feat: add ContextKind type to data model (#184)
cwaldren-ld e5992ef
feat: evaluation engine (#183)
cwaldren-ld bb75d4b
feat: initial pass of server-side Client object (#176)
cwaldren-ld 674c343
feat: Add persistent store core interface. (#187)
kinyoklion 0ead705
fix: EvaluationStack should take ownership of key argument (#190)
cwaldren-ld 30d2e21
feat: Add expiration tracker. (#188)
kinyoklion 213acbd
chore: add event processor architectural diagrams (#192)
cwaldren-ld 0b29ea2
feat: Serialize flags and segments. (#194)
kinyoklion 1f44309
Merge branch 'main' into server-side
cwaldren-ld a592e87
feat: build server SDK in CI (#198)
cwaldren-ld 275bb66
feat: hello-cpp-server (#202)
cwaldren-ld 9b38361
feat: server-side contract tests (#197)
cwaldren-ld 57c29d8
fix: multi-kind user segment targeting (#206)
cwaldren-ld ef1061e
fix: handle undefined flag variations in fallthrough (#205)
cwaldren-ld 648e202
Merge branch 'main' into server-side
cwaldren-ld 9edacd1
Merge branch 'main' into server-side
cwaldren-ld 09c74dd
remove contract test branch from server.yml
cwaldren-ld 4ccd79f
fix: refactor Variation methods for correctness & clarity (#203)
cwaldren-ld a7a9660
Merge branch 'main' into server-side
cwaldren-ld 9ec37f6
refactor: push typechecking of variation methods deeper down (#216)
cwaldren-ld 30bfed2
Merge branch 'main' into server-side
cwaldren-ld 62cb864
Merge branch 'main' into server-side
cwaldren-ld 66b4c83
fix: deserializing certain values leads to infinite loop (#224)
cwaldren-ld eb1b3ed
feat: add DataSourceStatus() and plumb through IClient interface (#217)
cwaldren-ld b9c03e2
Merge branch 'main' into server-side
cwaldren-ld 371ab00
refactor: move DataSourceStatus ErrorInfo C Bindings into common (#225)
cwaldren-ld 61ddbe7
add Doxygen config and doc.md
cwaldren-ld aba2473
chore: add Server-side README (#226)
cwaldren-ld 1538a76
fix: ensure flag updates go through data store updater (#228)
cwaldren-ld 7ab8c1d
Merge branch 'main' into server-side
cwaldren-ld 3669ff5
feat: server-side C bindings (#210)
cwaldren-ld 4889549
feat: plumb server side initial backoff delay (#232)
cwaldren-ld d0ce48d
add story label to remaining test suppressions:
cwaldren-ld 1db6db9
chore: resolve ValidChar function lint/compile warnings (#234)
cwaldren-ld 5f04888
Merge branch 'main' into server-side
cwaldren-ld fe9e559
Merge branch 'main' into server-side
cwaldren-ld 61a3bef
use async_connect() instead of run() in streaming data source
cwaldren-ld ede809d
Merge branch 'main' into server-side
cwaldren-ld a1751f3
build: fix LD_BUILD_SHARED_LIBS flag usage
cwaldren-ld 32fc0ce
Merge branch 'cw/fix-shared-lib-variable' into server-side
cwaldren-ld f4c6542
use new cmake variables
cwaldren-ld 6e428b4
one more missing usage
cwaldren-ld ed49fff
Merge branch 'cw/fix-shared-lib-variable' into server-side
cwaldren-ld 29385ec
fix merge conflicts
cwaldren-ld f796566
fix hello-c-server compilation
cwaldren-ld 5eeb40e
Merge branch 'main' into server-side
cwaldren-ld 9c9ec0b
update server github workflow to better match client's
cwaldren-ld 7760458
remove old-style user contract test suppressions
cwaldren-ld b0a6885
fix: enforce validated ContextKind usage in Segment data model (#263)
cwaldren-ld dc14199
formatting
cwaldren-ld 880ab16
use WriteMinimal where possible for writing JSON
cwaldren-ld 2c494ce
clang format
cwaldren-ld 64ab87d
remove TODO about using initial reconnect delay (implemented)
cwaldren-ld ce9ae07
remove/resolve some TODOs
cwaldren-ld e217299
Merge branch 'main' into server-side
cwaldren-ld a6a7456
fix client-and-server-coexistence linking
cwaldren-ld 9597b29
update client/server readmes and put CMake options in toplevel readme
cwaldren-ld 943d07c
revert change to client data source status state
cwaldren-ld 8179eba
remove unused evaluation detail API & remove implicit bool operator
cwaldren-ld 6f1aba6
Merge branch 'main' into server-side
cwaldren-ld 1da898d
Merge branch 'main' into server-side
cwaldren-ld df4ef40
add some story links for todos
cwaldren-ld d7453d3
remove object slicing in asio_event_processor
cwaldren-ld 17a9d38
remove useless inheritance usage in server-side events
cwaldren-ld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
CheckOptions: | ||
- { key: readability-identifier-length.IgnoredParameterNames, value: 'i|j|k|c|os|it' } | ||
- { key: readability-identifier-length.IgnoredVariableNames, value: 'ec|id' } | ||
- { key: readability-identifier-length.IgnoredVariableNames, value: 'ec|id|it' } | ||
- { key: readability-identifier-length.IgnoredLoopCounterNames, value: 'i|j|k|c|os|it' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: libs/server-sdk | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' #Do not need to run CI for markdown changes. | ||
pull_request: | ||
branches: [ main, server-side ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
contract-tests: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# Port the test service (implemented in this repo) should bind to. | ||
TEST_SERVICE_PORT: 8123 | ||
TEST_SERVICE_BINARY: ./build/contract-tests/server-contract-tests/server-tests | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/ci | ||
with: | ||
cmake_target: server-tests | ||
run_tests: false | ||
- name: 'Launch test service as background task' | ||
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 & | ||
- uses: ./.github/actions/contract-tests | ||
with: | ||
# Inform the test harness of test service's port. | ||
test_service_port: ${{ env.TEST_SERVICE_PORT }} | ||
extra_params: '-skip-from ./contract-tests/server-contract-tests/test-suppressions.txt' | ||
build-test-server: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/ci | ||
with: | ||
cmake_target: launchdarkly-cpp-server | ||
build-test-server-mac: | ||
runs-on: macos-12 | ||
steps: | ||
- run: | | ||
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" | ||
# For debugging | ||
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/ci | ||
env: | ||
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }} | ||
with: | ||
cmake_target: launchdarkly-cpp-server | ||
platform_version: 12 | ||
build-test-server-windows: | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Upgrade OpenSSL | ||
shell: bash | ||
run: | | ||
choco upgrade openssl --no-progress | ||
- name: Determine OpenSSL Installation Directory | ||
shell: bash | ||
run: | | ||
if [ -d "C:\Program Files\OpenSSL-Win64" ]; then | ||
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" >> "$GITHUB_ENV" | ||
else | ||
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL" >> "$GITHUB_ENV" | ||
fi | ||
- uses: actions/checkout@v3 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- uses: ./.github/actions/ci | ||
env: | ||
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }} | ||
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-client | ||
platform_version: 2022 | ||
toolset: msvc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
# Analytic Event Processor | ||
|
||
The Event Processor is responsible for consuming, batching, and delivering events generated | ||
by the server and client-side LaunchDarkly SDKs. | ||
|
||
```mermaid | ||
classDiagram | ||
IEventProcessor <|-- NullEventProcessor | ||
IEventProcessor <|-- AsioEventProcessor | ||
|
||
AsioEventProcessor *-- LRUCache | ||
AsioEventProcessor *-- Outbox | ||
AsioEventProcessor *-- WorkerPool | ||
AsioEventProcessor *-- Summarizer | ||
|
||
RequestWorker *-- EventBatch | ||
WorkerPool *-- "5" RequestWorker | ||
|
||
TrackEvent -- TrackEventParams: (alias) | ||
InputEvent *-- IdentifyEventParams | ||
InputEvent *-- FeatureEventParams | ||
InputEvent *-- TrackEventParams | ||
|
||
|
||
OutputEvent *-- IndexEvent | ||
OutputEvent *-- FeatureEvent | ||
OutputEvent *-- DebugEvent | ||
OutputEvent *-- IdentifyEvent | ||
OutputEvent *-- TrackEvent | ||
|
||
EventBatch --> Outbox: Pulls individual events from.. | ||
EventBatch --> Summarizer: Pulls summary events from.. | ||
|
||
IEventProcessor --> InputEvent | ||
Outbox --> OutputEvent | ||
|
||
Summarizer --> FeatureEventParams | ||
|
||
|
||
class IEventProcessor { | ||
<<interface>> | ||
+SendAsync(InputEvent event) void | ||
+FlushAsync() void | ||
+ShutdownAsync() void | ||
} | ||
|
||
class NullEventProcessor { | ||
|
||
} | ||
|
||
class AsioEventProcessor { | ||
|
||
} | ||
|
||
class EventBatch { | ||
+const Count() size_t | ||
+const Request() network:: HttpRequest | ||
+const Target() std:: string | ||
} | ||
|
||
class LRUCache { | ||
+Notice(std:: string value) bool | ||
+const Size() size_t | ||
+Clear() void | ||
} | ||
|
||
class Outbox { | ||
+PushDiscardingOverflow(std:: vector~OutputEvent~ events) bool | ||
+Consume() std:: vector~OutputEvent~ | ||
+const Empty() bool | ||
} | ||
|
||
class RequestWorker { | ||
+const Available() bool | ||
+AsyncDeliver(EventBatch, delivery_callback) | ||
} | ||
|
||
class WorkerPool { | ||
+Get(worker_callback) void | ||
} | ||
|
||
class Summarizer { | ||
+Update(FeatureEventParams) void | ||
+Finish() | ||
+const StartTime() Time | ||
+const EndTime() Time | ||
} | ||
|
||
%% note: the 'namespace' feature isn't supported on Github yet | ||
%% namespace events { | ||
class InputEvent { | ||
+std:: variant | ||
} | ||
|
||
|
||
class OutputEvent { | ||
+std:: variant | ||
} | ||
|
||
class FeatureEventParams { | ||
|
||
} | ||
|
||
class IdentifyEventParams { | ||
|
||
} | ||
|
||
class TrackEventParams { | ||
|
||
} | ||
|
||
class FeatureEvent { | ||
|
||
} | ||
|
||
class DebugEvent { | ||
|
||
} | ||
|
||
class IdentifyEvent { | ||
|
||
} | ||
|
||
class IndexEvent { | ||
|
||
} | ||
|
||
class TrackEvent { | ||
|
||
} | ||
|
||
%% } | ||
``` | ||
|
||
### Notes | ||
|
||
SDKs may be configured to disable events, so `NullEventProcessor` is made available. This component accepts | ||
events generated | ||
by the SDK and discards them. | ||
|
||
If events are enabled, SDKs use the `AsioEventProcessor` implementation, which is an asynchronous processor | ||
utilizing `boost::asio`. | ||
|
||
Most event definitions are shared between the server and client-side SDKs. Unique to the server-side SDK | ||
is `IndexEvent`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 remove the
server-side
part once merge (and in other workflows.)