-
Notifications
You must be signed in to change notification settings - Fork 3
fix: refactor Variation methods for correctness & clarity #203
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
Merged
cwaldren-ld
merged 57 commits into
server-side
from
cw/sc-213848/refactor-variation-methods
Aug 25, 2023
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
607024a
add <array> header
cwaldren-ld f49d534
add another missing <array>
cwaldren-ld 53c8c54
rename sdk-contract-tests to client-contract-tests
cwaldren-ld d14350b
copy client-side contract test server to server-side
cwaldren-ld f1ebea7
refactor contract tests data model into dedicated library
cwaldren-ld aa85920
fix client name and version in contract test binaries
cwaldren-ld 709c995
update evaluation/evaluation detail commands to deserialize contexts
cwaldren-ld 5406b59
re-enable client-entity
cwaldren-ld e45741b
value-init data model types during deserialization
cwaldren-ld 298c6d8
add server Github action workflow
cwaldren-ld d1976df
update client Github action workflow to fix contract test binary path
cwaldren-ld dbb541d
be accepting of an empty PUT path
cwaldren-ld 0b3f00a
more suppressions
cwaldren-ld ac96b10
fix all custom event contract tests
cwaldren-ld 2d4e5b8
attempt to make CI run
cwaldren-ld 0829bca
fix some event tests
cwaldren-ld e2d01df
remove a bunch of suppressions
cwaldren-ld 37e604a
add missing version to feature events
cwaldren-ld 22911a2
fix debug event tests
cwaldren-ld 2ddf672
fix some feature event emission
cwaldren-ld a41423f
remove old PR branch from server.yml
cwaldren-ld d5ce5af
update comment
cwaldren-ld 0145069
add server.yml
cwaldren-ld 57f5f9c
initial implementation of AllFlagsState method and structs
cwaldren-ld e9c068d
begin adding unit tests
cwaldren-ld e578ad1
unsupress contract tests due to lack of AllFlagsState API
cwaldren-ld 9b9a984
cleanup AllFlagsState api and types
cwaldren-ld 796ff70
doc comments on AllFlagsState
cwaldren-ld 3713595
renamings
cwaldren-ld 144d705
refactor AllFlagsStateOptions into enum nested in AllFlagsState struct
cwaldren-ld 059b21a
fix build
cwaldren-ld 43f27cb
fix regressed test
cwaldren-ld 07663f7
revert change to DetailsOnlyForTrackedFlags unit test
cwaldren-ld daef5cb
only return empty AllFlagsState if not initialized and memory store u…
cwaldren-ld 47ad8bb
additional suppressions for bucketing
cwaldren-ld ca9a74e
refactor variation methods to separate out event generation
cwaldren-ld d5cd0fa
refactor IsExperimentationEnabled into data_model::Flag
cwaldren-ld 219d7a9
remove a bunch of evaluation suppressions
cwaldren-ld 33944c7
remove some event suppressions
cwaldren-ld 41a9e4c
remove more event suppressions
cwaldren-ld 14e0c14
remove obsolete methods
cwaldren-ld 1a3a405
better encapsulation of EventScope
cwaldren-ld d8754a5
re-add variation call logging
cwaldren-ld 405693f
const correctness for EventScope
cwaldren-ld 1cf9666
add const to LogVariationCall
cwaldren-ld 4ce9dc9
refactor event scope to pass IEventProcessor in callback
cwaldren-ld 63e3ad1
remove disabled bool from EventScope and rely on polymorphism
cwaldren-ld 275b238
Merge branch 'server-side' into cw/sc-213848/refactor-variation-methods
cwaldren-ld 2e49214
rename EventScope::Get to Send
cwaldren-ld 5b7e08e
remove NullEventProcessor from server-side SDK and document EventScope
cwaldren-ld a6589e7
feat: implement prerequisite event recording (#204)
cwaldren-ld 6b1f647
add unit tests for EventScope
cwaldren-ld 15f362e
fix evaluator tests
cwaldren-ld b1d1398
add some event factory tests
cwaldren-ld 8b0fbac
typo
cwaldren-ld 73b8900
Merge branch 'server-side' into cw/sc-213848/refactor-variation-methods
cwaldren-ld 1cf17bb
fix a lint
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -26,4 +26,26 @@ Flag::Rollout::Rollout(std::vector<WeightedVariation> variations_) | |
| bucketBy("key"), | ||
| contextKind("user") {} | ||
|
|
||
| bool Flag::IsExperimentationEnabled( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just moving this from where the |
||
| std::optional<EvaluationReason> const& reason) const { | ||
| if (!reason) { | ||
| return false; | ||
| } | ||
| if (reason->InExperiment()) { | ||
| return true; | ||
| } | ||
| switch (reason->Kind()) { | ||
| case EvaluationReason::Kind::kFallthrough: | ||
| return this->trackEventsFallthrough; | ||
| case EvaluationReason::Kind::kRuleMatch: | ||
| if (!reason->RuleIndex() || | ||
| reason->RuleIndex() >= this->rules.size()) { | ||
| return false; | ||
| } | ||
| return this->rules.at(*reason->RuleIndex()).trackEvents; | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| } // namespace launchdarkly::data_model | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Woohoo! Just streaming issues left.