Add new configuration option to disable ADP#11513
Add new configuration option to disable ADP#11513mjkkirschner merged 5 commits intoDynamoDS:masterfrom
Conversation
use it to call disable raise warnings or throw if we fail to disable adp
…method more logging at startup update adp/analytics binaries
| } | ||
| } | ||
|
|
||
| if (isHeadless) |
There was a problem hiding this comment.
I modified how late we bail out if isHeadless is true because some clients need to disable ADP and still use Dynamo as a headless runner.
There was a problem hiding this comment.
Can you remind me, the isHeadless is set to true only when using command line, right? For Dynamo Player and GD, analytics is on because we are using Dynamo as a server.
There was a problem hiding this comment.
I believe player does not use headless, I am not sure about GD.
|
@pinzart90 @aparajit-pratap - please see my note above on difficulties testing this - one approach I do think would work is to create an internal enum to record the state of the disable call - something like:
what do you think? |
pinzart90
left a comment
There was a problem hiding this comment.
See comment ..then looks good
src/DynamoCore/Models/DynamoModel.cs
Outdated
|
|
||
| if (areAnalyticsDisabledFromConfig && disableADP) | ||
| { | ||
| throw new ConfigurationException("Incompatible configuration: could not start Dynamo with both [Analytics disabled] and [ADP disabled] config options enabled"); |
src/DynamoCore/Models/DynamoModel.cs
Outdated
|
|
||
| if(IsTestMode && disableADP) | ||
| { | ||
| this.Logger.Log("Incompatible configuration: [IsTestMode] and [ADP disabled] "); |
There was a problem hiding this comment.
what does this case mean?
There was a problem hiding this comment.
this is the case where testmode is active (during most tests) and some test might try to disable ADP - but we can't guarantee that we have access to the core sdks in different testing scenarios, and I could not find a nice way to mock this dependency, so thought it would be valuable to log the case, because it's likely adp is not really disabled.
I forgot the most important part!!
Also - we don't initialize analytics in test mode, so downstream of this in AnalyticsService.Start() we break out if we're in test mode and don't even try to call disable.
There was a problem hiding this comment.
That is exactly what I was going to mention. We always bail out during test mode so I dont think ADP will be loaded at all. https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoCore/Models/DynamoModel.cs#L1429 Do we really need this warning?
There was a problem hiding this comment.
we don't need it - but I think it might help avoid wasted time. It would be nice if Dynamo provided feedback on incompatible options since to a client it's not obvious what headless and testmode actually control.
There was a problem hiding this comment.
Thanks @mjkkirschner If that's the case, it seems this warning can be moved into beginning of AnalyticsService.Start(). What do you think?
|
Thank you. Looks good to me |
* add new configuration option use it to call disable raise warnings or throw if we fail to disable adp * modify analytics startup to check testmode and headless inside start method more logging at startup update adp/analytics binaries * review comments * review comments, unify name * move test mode error log to analytics start Co-authored-by: michael kirschner <[email protected]>
* add new configuration option use it to call disable raise warnings or throw if we fail to disable adp * modify analytics startup to check testmode and headless inside start method more logging at startup update adp/analytics binaries * review comments * review comments, unify name * move test mode error log to analytics start Co-authored-by: michael kirschner <[email protected]> Co-authored-by: michael kirschner <[email protected]>
|
Why are these empty files added: |
|
@aparajit-pratap they are not empty or added - they are updated binaries:
check the history of the files, it shows "empty file" since it was added, not sure why. |
Purpose
TODO:
- [ ] add testI found it's difficult to add a test here without refactoring the analyticsServices classes because static types cannot be mocked, and during testing we may not actually have the ADP core binaries around. Because we have tests in the ADP project, and the test here would basically just be asserting the configuration bool is set correctly, I'm thinking it's not worth it - open to suggestions though.Declarations
Check these if you believe they are true
*.resxfiles