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

DYN-6394: Add legacy trace warning when opening workspace #14628

Merged
merged 41 commits into from
Nov 28, 2023

Conversation

aparajit-pratap
Copy link
Contributor

@aparajit-pratap aparajit-pratap commented Nov 20, 2023

Purpose

  • Add legacy trace warning when opening workspace (both JSON and XML)
  • Ignore legacy trace data and pass empty trace data to callsite in this case so the callsite need not repeatedly check for soap formatted trace data
  • Add test to deserialize old trace data, run, and confirm that new trace data replaces the old format

image

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.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

Add legacy trace warning when opening workspace.

FYI @Amoursol for warning message.

@avidit avidit changed the title Dyn 6394: Add legacy trace warning when opening workspace DYN-6394: Add legacy trace warning when opening workspace Nov 22, 2023
@@ -44,6 +45,8 @@ public class EngineController : LogSourceBase, IAstNodeContainer, IDisposable
/// </summary>
internal static event Action VMLibrariesReset;

internal Version WorkspaceVersion { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

the name of this property confused me at first glance, shouldn't this be called something like engine version? I would think that WorkspaceVersion is the version of the currently loaded workspace.

Copy link
Contributor Author

@aparajit-pratap aparajit-pratap Nov 22, 2023

Choose a reason for hiding this comment

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

I moved this property from WorkspaceModel to EngineController as part of this latest refactoring as I need it before the workspace is initialized. It's meant to be the Dynamo version in which the workspace was initially created.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I guess my confusion stems from the fact that I see it get set from the AssemblyHelper? Maybe on EngineController it could have a different name?

Copy link
Member

Choose a reason for hiding this comment

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

It still gets serialized with the workspace - correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It gets set from AssemblyHelper only if there's no version serialized with the workspace being read. Yes, it still gets serialized as part of DynamoPreferencesData. I can think of another name.

@@ -313,14 +317,12 @@ where childNode.Name.Equals(sessionXmlTagName)
var callsiteId = string.Empty;
if (child.HasAttribute(Configurations.CallSiteID))
{
callsiteId = child.GetAttribute(Configurations.CallSiteID);
containsTraceData = true;
return loadedData;
Copy link
Member

Choose a reason for hiding this comment

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

so now, we just return an empty list no matter what, but we make a note that there was at least 1 node with trace data?

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 renamed the variable from containsTraceData to containsLegacyTraceData to make it clearer. This flag is only used to trigger the toast notification when opening an old workspace.

@@ -2323,6 +2323,10 @@ private void SetPeriodicEvaluation(WorkspaceModel ws)
var currentHomeSpace = Workspaces.OfType<HomeWorkspaceModel>().FirstOrDefault();
currentHomeSpace.UndefineCBNFunctionDefinitions();

// This is to handle the case of opening a JSON file that does not have a version string
EngineController.WorkspaceVersion = dynamoPreferences.Version ==
Copy link
Member

Choose a reason for hiding this comment

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

did you see any of these files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I haven't seen any. This comment has been copied from deleted lines of code below.

Copy link
Member

@mjkkirschner mjkkirschner left a comment

Choose a reason for hiding this comment

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

Looks solid.

// Ignore revision number.
var ver = workspace.WorkspaceVersion;
return new Version(ver.Major, ver.Minor, ver.Build, 0);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not used

@aparajit-pratap aparajit-pratap merged commit 5bbdd8b into DynamoDS:master Nov 28, 2023
20 of 21 checks passed
@aparajit-pratap aparajit-pratap deleted the dyn-6394 branch November 28, 2023 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants