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.
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.
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.
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.
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.
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 (!noNetworkMode) | ||
| { | ||
| // Known hosts | ||
| knownHosts = PackageManagerClient.GetKnownHosts(); |
There was a problem hiding this comment.
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.
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.
Looks like the defualts are in this PR
IEnumerable<string> knownHosts = new List<string> { "Revit", "Civil 3D", "Alias", "Advance Steel", "FormIt" };
| } | ||
|
|
||
| public class StartupUtils | ||
| public static class StartupUtils |
There was a problem hiding this comment.
would it be too much of a breaking change to make this internal ?
There was a problem hiding this comment.
Why are you suggesting we make this internal?
There was a problem hiding this comment.
Just to reduce the number public footprint. Do you think it is valuable as public facing API or risky to make internal?
| /// <param name="cmdLineArgs"></param> | ||
| /// <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.
we are ok with breaking changes right ?
| /// <summary> | ||
| /// For nunit-teardown | ||
| /// </summary> | ||
| internal void ForceShutDownAllApps() |
|
|
||
| [Test] | ||
| [Category("Failure")] | ||
| public void DummyDisposableEvents() |
There was a problem hiding this comment.
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:
DisableAnalyticsandNoNetworkModeflags - Now it's possible to disable analytics even when onlineNoNetworkModefor network traffic and verified zero traffic using process monitorNoNetworkModeproperty 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
*.resxfilesRelease 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