-
Notifications
You must be signed in to change notification settings - Fork 634
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
Add new configuration option to disable ADP #11513
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
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.
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"); |
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.
👍🏻
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this case mean?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mjkkirschner If that's the case, it seems this warning can be moved into beginning of AnalyticsService.Start()
. What do you think?
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, can do.
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
*.resx
files