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

[AGD-1882] Support storing user defined graph documentation #11444

Conversation

SHKnudsen
Copy link
Contributor

Purpose

This pull request addresses JIRA task AGD-1882.

Example of .dyn file storing a Base64 thumbnail:

{
  "Uuid": "35aa6c06-f083-4e4f-9817-ed5d234c4ca2",
  "IsCustomNode": false,
  "Description": null,
  "Name": "thumbnailTest3",
  "ElementResolver": {
    "ResolutionMap": {}
  },
  "Inputs": [],
  "Outputs": [],
  "Nodes": [],
  "Connectors": [],
  "Dependencies": [],
  "NodeLibraryDependencies": [],
  "ExtensionWorkspaceData": [],
  "Thumbnail": "iVBORw0KGgoAAAANSUhEUgAAAIQAAACmCAYAAAAbICeaAAAVRElEQVR42uzc+VNUVxYHcH/PD/ktP6Zq/oBUhRgV2ZFFZFFkFUVAaZYGWZRNaLZmb3aQHUEiuOLuuIvGNSQxY5aZJCaxyjFTZZxJZmI5mZhJMmfeIdGjPqW7733Lfdi36ltlReVVeT7ce965pOcpsT72D35ZSthH/sGN1/2DTlzzC7rxgV/Qj0/nT/5BJ6XfH5D+rPlycJz7PNeaWwsRSAXeJQF48K5f4K/TfoHgaN7zC/z5SkD49ydC1h5rjaqpbFnVs1zKa/Ncy5AQVkvf7Z9JRf2FisyXXUHxYFm++duyldab5VG1B6wxNhcSA0B4FY8EgqBsLvkvhf6lKZAfUfwoRSvKHyGpiWm2SUASEImUl+a5lr67gnQ03MXCqZ39gTFQHF7wOIxnIqmIqjtVFd3Q7kKi8ZKaxT7aFbTJySURYA3LIQh2Urii7N7myKrblqiaKRcSUTHwHyHPQuFCYmwM/CjKwjc+XWwXEj16BsKgb84uCYeSCFlP4UKiIYbXqIEUI4eCYmBTRNHTxXQh0WLhq6U4GCjDy9Y9C4ULidpHBU0dxcrZgAjoCMt6FgoXErUWTiDFw0DZGZL4PB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DUUL2u6reabd7QE2CyCJcjMIPJQIAzGmZjDEmCzKC0hrFDQbQJgcD5JlxLnTBHUQXPweMbWKvF/fktJWoK4UOyHK6lf0+K8bqyfHTSuSUsI4bSARNMjMDbZ5FmftMzLuXnzGUUq3LsPWIjBltRlurk5mcluAFTsfNJTylsPKVLRWp0DHKy5ebAUBsgqq7X/FwPgffbzSfZnNVZ1ipSUlJRUiPQXQ5W7HO3VUgwAAAAASUVORK5CYII=",
  "Bindings": [],
  "View": {
    "Dynamo": {
      "ScaleFactor": 1.0,
      "HasRunWithoutCrash": true,
      "IsVisibleInDynamoLibrary": true,
      "Version": "2.11.0.3973",
      "RunType": "Manual",
      "RunPeriod": "1000"
    },
    "Camera": {
      "Name": "Background Preview",
      "EyeX": -17.0,
      "EyeY": 24.0,
      "EyeZ": 50.0,
      "LookX": 12.0,
      "LookY": -13.0,
      "LookZ": -58.0,
      "UpX": 0.0,
      "UpY": 1.0,
      "UpZ": 0.0
    },
    "NodeViews": [],
    "Annotations": [],
    "X": 0.0,
    "Y": 0.0,
    "Zoom": 1.0
  }
}

This pull request does

  • Adds new Thumbnail property to the workspace model, which stores a Base64 encoded string.

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

Reviewers

@saintentropy
@nate-peters

FYIs

@mjkkirschner

Copy link

@nate-peters nate-peters left a comment

Choose a reason for hiding this comment

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

LGTM! @SHKnudsen

@mjkkirschner
Copy link
Member

mjkkirschner commented Mar 17, 2021

@SHKnudsen the tests ran so long ago that the console logs are now gone - I've started a new build here:
https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/2150/
please check it out for any failures when it is complete.

@mjkkirschner
Copy link
Member

only one test failure:

MESSAGE:
  Expected: True
  But was:  False

+++++++++++++++++++
STACK TRACE:
   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
   at DynamoCoreWpfTests.SerializationTests.JSONisSameBeforeAndAfterSaveWithDummyNodes() in c:\WorkspaceDynamo\test\DynamoCoreWpfTests\SerializationTests.cs:line 444

@SHKnudsen
Copy link
Contributor Author

only one test failure:

MESSAGE:
  Expected: True
  But was:  False

+++++++++++++++++++
STACK TRACE:
   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
   at DynamoCoreWpfTests.SerializationTests.JSONisSameBeforeAndAfterSaveWithDummyNodes() in c:\WorkspaceDynamo\test\DynamoCoreWpfTests\SerializationTests.cs:line 444

Thanks @mjkkirschner,

So this fails because its trying to compare a dyn file before getting opened and after getting saved. The old file will not have these new properties we are adding in this PR, but when its saved they will be appended, resulting in the files now being different.

I can see that we previously ignored a new property (the ExtensionWorkspaceData) in the test, but do we want to keep doing that or should we update the test file so it contains thoese new properties?

This is the file the test is using https://github.com/DynamoDS/Dynamo/blob/master/test/core/dummy_node/2080_JSONTESTCRASH%20undo_redo.dyn

@mjkkirschner
Copy link
Member

@SHKnudsen either is fine with me - but guess it's better to update the test file if it's not too onerous?

@@ -203,6 +203,8 @@ internal int CurrentPasteOffset
private DateTime lastSaved;
private string author = "None provided";
private string description;
private string thumbnail;
Copy link
Member

@mjkkirschner mjkkirschner Mar 18, 2021

Choose a reason for hiding this comment

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

before this gets merged- a quick thought, do all of these new properties make sense on both home workspaces and custom node workspaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tbh I hadn't considered that this also affected the CN workspace. Most of these probably don't make sense on the CN, maybe the Author is okay, but not sure i see the need for the others.

@nate-peters @saintentropy, any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, just noticed that its the same with the new ExtensionWorkspaceData not sure that makes sense in the CN workspace either?

@mjkkirschner mjkkirschner merged commit b49c661 into DynamoDS:master Mar 18, 2021
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.

3 participants