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

Add ADP opt-in ui under DebugMode #10638

Merged
merged 18 commits into from
May 18, 2020
Merged

Add ADP opt-in ui under DebugMode #10638

merged 18 commits into from
May 18, 2020

Conversation

pinzart
Copy link
Contributor

@pinzart pinzart commented May 11, 2020

Purpose

Added UI for ADP (replaces the Instrumentation consent UI)
Still fully under a debug mode.
Exposed the ADP opt-in/opt-out API in Preferences as a non-serializable property,
Google and ADP are handled separately.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.

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

@pinzart
Copy link
Contributor Author

pinzart commented May 11, 2020

ADP opt-in/opt-out values are common to all ADSK products (not per individual product). This means that Dynamo will not have exclusive control of ADP opt-in/opt-out.
This complicates how we can expose ADP optin/optout at API level. GoogleAnalytics is fully under Dynamo's control...and is exposed in Preferences (also serialized)...This might not make sense for ADP.
Maybe we can wrap both Google and ADP opt-in/opt-out under a Common Dynamo Analytics Toggle. This would ensure that ADP is under Dynamo full control. So something like this:
[X] Enable Analytics Reporting
--- [X] Enable Google Analytics
--- [X] Enable ADP Analytics

@QilongTang @mjkkirschner thoughts?

@mjkkirschner
Copy link
Member

mjkkirschner commented May 11, 2020

This needs to be reviewed carefully, I see you undid some recent changes by @QilongTang which stopped instrumentation and analytics from being started/loaded at all if disabled. These were put in to investigate http errors in specific proxy environments.

Was that needed?

@pinzart pinzart added the DNM Do not merge. For PRs. label May 11, 2020
@pinzart
Copy link
Contributor Author

pinzart commented May 12, 2020

@mjkkirschner Regarding
I see you undid some recent changes by @QilongTang which stopped instrumentation and analytics from being started/loaded at all if disabled. These were put in to investigate http errors in specific proxy environments.
THat check did not make a lot of sense to me...unless it was as you said...for some edge case ...
I added the check back (with adp in the condition)

{
//If not ReportingAnalytics, then set the idle time as infinite so idle state is not recorded.
Service.StartUp(product, new UserInfo(Session.UserId), preferences.IsAnalyticsReportingApproved ? TimeSpan.FromMinutes(30) : TimeSpan.MaxValue);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the backup value TimeSpan.MaxValue since it seems it was never hit before...

Copy link
Contributor

Choose a reason for hiding this comment

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

@pinzart Yes, now I remember because we made the change that if GA is not agreed, we do not initialize the client at all. It seems this change will undo that previous change though. e.g. if the ADP is agreed on, the service will be started regardless

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@QilongTang
ADP is agreed on, the service will be started regardless
That is correct. My intention was to make ADP and Google independent of each other. So if a user opts into ADP (but not Google) ...then Analytics service will be started (but only ADPTracker will process events). Similar if Google is opted in but ADP is not.

@pinzart
Copy link
Contributor Author

pinzart commented May 12, 2020

I did not refactor the code to remove the Instrumentation option (for logging PII). That can be done in a separate PR

@pinzart
Copy link
Contributor Author

pinzart commented May 12, 2020

In this PR, ADP analytics are still fully under a debug mode

@pinzart
Copy link
Contributor Author

pinzart commented May 12, 2020

image

@mjkkirschner
Copy link
Member

@QilongTang - I'm having trouble remembering the option added by Alias team, but we should make sure that this option to completely disable the UI for analytics (and also disable all analytics) continues to work.

@mjkkirschner
Copy link
Member

@pinzart this is the functionality I mean:
#10217

@pinzart
Copy link
Contributor Author

pinzart commented May 12, 2020

@mjkkirschner Regarding #10217
I just tested that..and it works as expected...Just hides the Agreement Menu Item and the First Run prompt window.

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM other than the comments we have not reached agreement.

@mjkkirschner
Copy link
Member

@pinzart @QilongTang - I think the host name is unneeded - as confusing as it is the AppVersion contains the process name.

return Process.GetCurrentProcess().ProcessName + "-"

@QilongTang
Copy link
Contributor

@mjkkirschner hmm process name for DynamoForAdavanceSteel and DynamoForCivil3D is same, both Acad. This could be a chance for us to fix that. What do you think?

* separate functions for tracker registrations

Use separate functions so that we do not load GA dll at runtime if it is not opted in..
// If the Analytics Client was initialized, shut it down.
// Otherwise skip this step because it would cause an exception.
if (Service.IsInitialized)
Service.ShutDown();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Service.ShutDown() will clean all factories and all tracker related data

@@ -30,20 +23,6 @@ public DynamoAnalyticsSession()

public void Start(DynamoModel model)
{
//Whether enabled or not, we still record the startup.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this tracker registration/cleanup code in the Client instance. (to have access to client's data)

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM with one last comment

@QilongTang QilongTang added LGTM Looks good to me and removed DNM Do not merge. For PRs. labels May 18, 2020
@pinzart pinzart merged commit 6320bd8 into master May 18, 2020
@pinzart pinzart deleted the adp_optin_ui branch May 18, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LGTM Looks good to me
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants