Skip to content
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: in-process provider #149

Merged
merged 29 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
aa69b8b
extract rpc resolver into its own class
bacherfl Jan 10, 2024
b6f1887
use resolver in provider
bacherfl Jan 11, 2024
12d6b23
implementation of JsonLogic evaluator
bacherfl Jan 16, 2024
1f63a85
implemented in-process provider
bacherfl Jan 19, 2024
9105d7d
adapted unit tests
bacherfl Jan 22, 2024
0ce3ca4
some minor restructuring, unit tests for in process resolver
bacherfl Jan 22, 2024
7159e59
Merge branch 'main' into feat/in-memory-provider
bacherfl Jan 29, 2024
8ae2ea9
added ConfigureAwait
bacherfl Jan 29, 2024
85e963b
fixed unit test
bacherfl Jan 30, 2024
457fcea
fix linting errors
bacherfl Jan 30, 2024
9ebe097
updated README.md
bacherfl Jan 30, 2024
2c21152
incirporated suggestions from PR review
bacherfl Feb 7, 2024
16512e2
fixed formatting
bacherfl Feb 7, 2024
a7a7374
fix unit tests
bacherfl Feb 7, 2024
f55d305
fix formatting
bacherfl Feb 7, 2024
990d7f8
cleanup
bacherfl Feb 7, 2024
4126d07
adapted thrown exceptions to match expectations in e2e tests
bacherfl Feb 8, 2024
d8eb5f4
adapted to PR review
bacherfl Feb 9, 2024
af51e09
chore: flagd provider e2e tests (#150)
toddbaert Feb 9, 2024
ed4b4d3
Chore/in memory provider tests (#153)
toddbaert Feb 9, 2024
171d320
fixup: services
toddbaert Feb 9, 2024
f5513e9
fixup: rm no-build
toddbaert Feb 9, 2024
57e4668
fixup: rm no-build
toddbaert Feb 9, 2024
1e1524c
fixup: test setup
toddbaert Feb 9, 2024
a47f34e
fix: fix race?
toddbaert Feb 9, 2024
7256479
fixup: remove E2E=false from win
toddbaert Feb 9, 2024
a0e8666
fixup: shutdown
toddbaert Feb 12, 2024
738a5cd
fixup: assert-until default
toddbaert Feb 12, 2024
699cab9
fixup: init in tests
toddbaert Feb 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,13 @@ private async void HandleEvents(CountdownEvent latch)
// Read the response stream asynchronously
while (await call.ResponseStream.MoveNext(token))
{
var response = call.ResponseStream.Current;
_evaluator.Sync(FlagConfigurationUpdateType.ALL, response.FlagConfiguration);
Comment on lines +111 to +112
Copy link
Member

Choose a reason for hiding this comment

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

I think this was a race - we we signaling the latch before we read, which caused some issues.

if (!latch.IsSet)
{
latch.Signal();
}
HandleProviderReadyEvent();
var response = call.ResponseStream.Current;

_evaluator.Sync(FlagConfigurationUpdateType.ALL, response.FlagConfiguration);
}
}
catch (RpcException ex) when (ex.StatusCode == StatusCode.Unavailable)
Expand Down Expand Up @@ -154,7 +153,8 @@ private T BuildClient<T>(FlagdConfig config, Func<GrpcChannel, T> constructorFun
return chain.Build(cert);
};
#elif NET462_OR_GREATER
handler.ServerCertificateValidationCallback = (message, cert, chain, errors) => {
handler.ServerCertificateValidationCallback = (message, cert, chain, errors) =>
{
if (errors == SslPolicyErrors.None) { return true; }

chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority;
Expand Down Expand Up @@ -230,7 +230,8 @@ private FlagSyncService.FlagSyncServiceClient BuildClientForPlatform(FlagdConfig
return chain.Build(cert);
};
#elif NET462_OR_GREATER
handler.ServerCertificateValidationCallback = (message, cert, chain, errors) => {
handler.ServerCertificateValidationCallback = (message, cert, chain, errors) =>
{
if (errors == SslPolicyErrors.None) { return true; }

chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public EvaluationStepDefinitionsBase(ScenarioContext scenarioContext)
}

[Given(@"a provider is registered")]
public void Givenaproviderisregisteredwithcachedisabled()
public void Givenaproviderisregistered()
{

}
Expand Down
Loading