-
Notifications
You must be signed in to change notification settings - Fork 636
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
wrap launch darkly in CLI to avoid bringing in new deps #12801
Conversation
instantiate feature flags manager in core test message box in view add feature flags man project with config file update compiler unsafe to v 5
wrap startup in try catch unsub logger handler add prod key use shared key add try catch and logging around LD api methods
set owner
move under tools dir refactor out small base class
Maybe we can have a self destruct functionality inside the launchDarkly process. In case it becomes a zombie.. |
good idea! I'm looking at the build failure. It's not obvious to me which path doesn't exist. |
Regarding deadlocks or lack of timeouts... |
Is there any fundamental difference in this implementation compared to the markdown tool? I kind of remember that I had very few issues with zombies in the end with the markdown tool. One thing that could cause this is if the process creates threads that is not properly destroyed. Maybe something that happens in the LD SDK? |
dont log messages unless under debug - TBD
moved to draft while I try to reproduce the test hang locally. |
this is no longer timing out the build machines - but there is a single failure, looking at it. |
dispose process to release handles to os.
add test mode to cli which just returns mock data
|
||
//run process startup/reading on another thread so we don't block dynamo startup. | ||
//if we end up needing to control aspects of dynamo model or view startup that we can't make | ||
//event based/async then just run this on main thread - ie get rid of the Task.Run() |
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.
By if we end up needing to control aspects of dynamo model or view startup
, do you mean a case where we'll need to check for feature flags at some point before the model is instantiated?
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.
yes, and where we cannot recreate or reset that aspect of the model or view.
one failure
|
Tests passed now, running master-15 serial tests as well. PTAL! |
{94CF053D-BB66-4FC7-883B-48F072701BA9}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{94CF053D-BB66-4FC7-883B-48F072701BA9}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{94CF053D-BB66-4FC7-883B-48F072701BA9}.Release|x64.ActiveCfg = Release|Any CPU | ||
{94CF053D-BB66-4FC7-883B-48F072701BA9}.Release|x64.Build.0 = Release|Any CPU |
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.
do we want to build this tool by default ....with the rest of the solution ?
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.
We do so for the other CLI tools, why wouldn't we?
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.
I guess if the tool does not directly depend on any other Dynamo projects it may have a slower dev cycle than the rest.
But I guess it is a small project (few cs files) so it does not really slow down the build process that much
@@ -873,6 +905,28 @@ protected DynamoModel(IStartConfiguration config) | |||
DynamoReady(new ReadyParams(this)); | |||
} | |||
|
|||
private void CheckFeatureFlagTest() | |||
{ | |||
if (DynamoModel.FeatureFlags.CheckFeatureFlag<bool>("EasterEggIcon1", false)) |
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.
we will need to store the possible feature flag names in some way (config file?) right ?
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.
why? To what end?
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.
I should mention that the keys, once created in launch darkly, are immutable. (besides being deletable)
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.
In our discussions it seemed necessary to provide a way for feature flags to work offline (Like for ALIAS)
I may have misunderstood.
It is fine for now regardless.
</ImportGroup> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<OutputPath>$(OutputPath)\DynamoFeatureFlags\</OutputPath> |
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.
Remind me, the output will not be part of DynamoCore right?
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.
It will be placed in Bin\AnyCPU\{config}\DynamoFeatureFlags
subfolder so it will be part of DynamoCoreRuntime release zip and artifactory build - but it won't pollute the root bin folder. The way this tool currently works, even sandbox users will have access to feature flags.
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.
Some comments.
LGTM
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.
LGTM!
Purpose
Updated 4/18 to short lived CLI process.
An alternative to:
#12790
in this PR instead of pulling LD sdk and its dependencies into the same process as Dynamo/Host - it's wrapped in a CLI following a very similar pattern to the markdown2html conversion tool.
How it works:
I've added the
start of data
messages so I can safely log other information.The process then shuts down.
If somehow Dynamo shuts down during the brief window where the flags were being retrieved, the CLI will also shut down if the host process is no longer running. It checks this every 10 seconds.
The CLI tool/wrapper are started on another thread using
Task.Run
to avoid blocking the startup of DynamoModel/DynamoView - this makes synchronizing when to check flags a bit complicated, so I've added an event that can be subscribed to - still, it's not foolproof as the event may have fired before you have a chance to subscribe to it, in this case thecheckFlag
API can be queried directly.If we encounter a case in the future where we absolutely must control DynamoModel/DynamoView constructors via feature flags, then we can just remove the
Task.Run
and wait for the flags to be retrieved synchronously, and get rid of the event.issues/TODO:
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Add FeatureFlagsManager internal component for querying live feature flags.
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of