-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-6232: Add No-network mode #14526
Conversation
src/DynamoCore/Models/DynamoModel.cs
Outdated
/// <summary> | ||
/// Configuration option to start Dynamo in offline mode. | ||
/// </summary> | ||
bool NoNetworkMode { get; set; } |
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 allows host integrators to control this flag in their custom startup configurations or by setting it while creating a DefaultStartConfiguration
.
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 wonder if this is a good time to do this TODO on line 512
I was mentioning this to @QilongTang today on slack.
// TODO_Dynamo3.0: Replace the IStartConfiguration with a class or struct instance in order to avoid future breaking changes for every new option added.
We could also look at interfaces with defaults - though I am not sure we can use default properties...
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've made this a default property as suggested. Hopefully, it shouldn't be a breaking change any longer.
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.
they're not as straight forward to use as I thought... the objects only seem to inherit the default implementations when they are declared as those interfaces.
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.
You mean code using RevitStartConfiguration
, for example, will need to be recompiled? I'm not sure I follow what you're suggesting we do here.
if (!Dynamo.Logging.Analytics.DisableAnalytics) | ||
|
||
//we don't ask dpm for known hosts in offline mode. | ||
if (!noNetworkMode) | ||
{ | ||
// Known hosts | ||
knownHosts = PackageManagerClient.GetKnownHosts(); |
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 think that for 2.19.1 I implemented something similar but also defaulted to some known hosts, can we unify that logic? I can't recall where though.
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 what I was referring to: https://github.com/DynamoDS/Dynamo/compare/RC2.19.0_master..RC2.19.1_master (a comparison between 2.19.1 and 2.19.0). The changes that went into 2.19.1 somehow also seemed to be present in master so I didn't need to do anything extra.
I haven't changed the logic other than replacing DisableAnalytics
with noNetworkMode
. Please let me know if I'm missing something.
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.
Looks like the defualts are in this PR
IEnumerable<string> knownHosts = new List<string> { "Revit", "Civil 3D", "Alias", "Advance Steel", "FormIt" };
@@ -64,7 +67,7 @@ internal class CMDLineOptions | |||
public bool ServiceMode { get; set; } | |||
} | |||
|
|||
public class StartupUtils | |||
public static class StartupUtils |
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.
would it be too much of a breaking change to make this internal ?
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 are you suggesting we make this internal?
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.
Just to reduce the number public footprint. Do you think it is valuable as public facing API or risky to make internal?
/// <returns></returns> | ||
public static DynamoModel MakeCLIModel(string asmPath, string userDataFolder, string commonDataFolder, HostAnalyticsInfo info = new HostAnalyticsInfo(), bool isServiceMode = false) | ||
public static DynamoModel MakeCLIModel(CommandLineArguments cmdLineArgs) |
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 are ok with breaking changes 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.
Yes.
/// <summary> | ||
/// For nunit-teardown | ||
/// </summary> | ||
internal void ForceShutDownAllApps() |
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.
not used anymore ?
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.
no
|
||
[Test] | ||
[Category("Failure")] | ||
public void DummyDisposableEvents() |
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.
is anything in this test still useful ?
@QilongTang FYI
Purpose
Added a new no-network mode to Dynamo. This does away with the need to maintain a separate special build for Alias as this option has been added to the mainline.
Changes include:
DisableAnalytics
andNoNetworkMode
flags - Now it's possible to disable analytics even when onlineNoNetworkMode
for network traffic and verified zero traffic using process monitorNoNetworkMode
property to their custom start configuration typesNo-network mode disables the following:
Note: I didn't end up adding any unit tests as it wasn't straightforward. I could add a follow-up for tests.
Follow-up tasks:
TODO:
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
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