-
Notifications
You must be signed in to change notification settings - Fork 664
9386: DYN-9286 - Remove Dynamo nodes marked for deprecation in Dynamo 2.x #16585
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
base: master
Are you sure you want to change the base?
9386: DYN-9286 - Remove Dynamo nodes marked for deprecation in Dynamo 2.x #16585
Conversation
This should remove all the obsolete nodes before the 3.0 release
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9386
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.
Pull Request Overview
This PR removes deprecated Dynamo nodes that were marked with [NodeObsolete]
in version 2.19.5 to clean up the codebase before the 3.0 release. The removal includes obsolete methods from Excel, FileSystem, String, and Analysis libraries along with their associated test files and documentation.
- Removed 17 deprecated methods across Excel, FileSystem, String, and Analysis classes
- Deleted entire obsolete Analysis data classes (SurfaceData, PointData, VectorData)
- Removed corresponding test files and XML documentation entries
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Libraries/DSOffice/Excel.cs | Removed obsolete Read method |
src/Libraries/CoreNodes/String.cs | Removed obsolete FromObject method |
src/Libraries/CoreNodes/FileSystem.cs | Removed 5 obsolete file operation methods |
src/Libraries/Analysis/SurfaceData.cs | Completely removed obsolete SurfaceData class |
src/Libraries/Analysis/PointData.cs | Completely removed obsolete PointData class |
src/Libraries/Analysis/VectorData.cs | Completely removed obsolete VectorData class |
test/Libraries/AnalysisTests/SurfaceDataTests.cs | Removed test file for deleted SurfaceData class |
test/Libraries/AnalysisTests/AnalysisTests.cs | Removed test file for deleted Analysis data classes |
doc/distrib/xml/en-US/Analysis.xml | Removed XML documentation for deleted Analysis classes |
@jasonstratton Some regressions to fix(remove) as well |
ToDo: update the file under test with the replacements for the obsolete nodes Dynamo\test\core\WorkflowTestFiles\File Migration\File.dyn
ToDo: create a new graph for testing, replacing the ReadText, ReadImage nodes, and load image code in the CBN
} | ||
|
||
[Test] | ||
[Ignore("Temp: DYN-9386 - Remove obsolete nodes in 2.x -> ToDo: create new test .dyn file")] |
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.
are you finding that this is just flaky? Or does it fail locally as well?
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.
It did fail locally. I marked it as [Ignore] in order to get the tests to pass and address the test shortly. I was not sure about how to replace the .dyn file right off. The test appears to expect an obsolete node and expects to see a popup. Maybe it is just as simple to replace the node in the graph with another that is still deprecated.
[SupportedOSPlatform("windows")] | ||
#endif | ||
[NodeObsolete("ReadImageObsolete", typeof(Properties.Resources))] | ||
public static Color[] ReadImage(string path, int xSamples, int ySamples) |
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.
so I think that in addition to removing these methods it's probably good to:
- as you've already done clean up the migration tests, I think you can just remove the old nodes from the graph - they're just not going to be migrated anymore. If we had the time it might make sense to see if we could migrate to something else - for example in this case there is the
Image
class - but it's not clear if auto migrating will be useful, it wasn't done when the node was obsoleted so maybe it doesn't make sense to do now with limited context for each node. - cleanup the migrations.xml files. If you search for the name of the node you'll find them - for example: https://github.com/DynamoDS/Dynamo/blob/master/src/Libraries/CoreNodes/DSCoreNodes.Migrations.xml#L13
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 sure. The resource string does say "Use File.FromPath -> Image.ReadFromFile -> Image.Pixels nodes instead" we could try to add a migration that does that
a. That reminds me to remove the obsolete resource strings - Thank you for that. I was unaware of the migrations.xml file
/// A class for storing structure point analysis data. | ||
/// </summary> | ||
[IsVisibleInDynamoLibrary(false)] | ||
public class PointData : IStructuredData<Point, double> //, IGraphicItem |
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.
so to be pedantic... this class and the other analysis classes were not actually marked obsolete... someone could still be using them without using the nodes ( I have no idea who that person would be or why)... the SAFEST thing to do is to keep the classes around and mark them obsolete. I will let you make that judgement call.
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 did consider that and thought the original intent was so that the node would not be used, which was equivalent to being made obsolete. But I guess if it was in a graph, the user would not see an obsolete message and take and action.
If I were to restore it and mark it as obsolete, would you happen to know what the action the graph author should take?
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.
what I meant, if it was not clear, is that the methods were marked obsolete, but the class was not. Someone could be using the class from c# or python because it was public.
If you just restore the class, not the methods and mark it as obsolete it should not be visible. I don't think theres any action anyone needs to take.
I do see that this class implements an interface and maybe it's not possible to remove the methods without removing the class anyhow because of compiler errors - in that case - I would not worry about it.
I do think it's worth being careful when differentiating between classes and members being marked obsolete.
/// </summary> | ||
public static class String | ||
{ | ||
// It has been moved to String.FromObject UI node, which is compiled |
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.
any idea what this comment was intending and if it was done?
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 don't know the intention or whether it was done. I guess I should not have assumed. I will research.
"Name": "", | ||
"Description": "Value of expression at line 1", | ||
"Name": "list", | ||
"Description": "[DSCore.Object.Type(DSCore.Data.ParseJSON(\"false\")), DSCore.Object.Type(DesignScript.Builtin.Get.ValueAtIndex(DSCore.Data.ParseJSON(\"[false]\"), 0)), DSCore.Object.Type(DSCore.Data.ParseJSON(\"{\"foo\": false}\")), DSCore.Object.Type(DSCore.Data.ParseJSON(\"\"another test\"\")), DSCore.Object.Type(DSCore.Data.ParseJSON(\"12\")), DSCore.Object.Type(DSCore.Data.ParseJSON(\"\"2009-02-15T00:00:00Z\"\")), DSCore.Object.Type(DSCore.Data.ParseJSON(\"1e10\")), DSCore.Object.Type(DSCore.Data.ParseJSON(\"{\"foo\": [1,{},3...", |
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.
oh man... I don't think this change comes from your PR ... this seems to have something to do with recent changes to codeblock UI...
@zeusongit is this intentional that such large amounts of DS code ends up duplicated in the description like this?
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.
hmm...seems weird, and not intentional, to have this move to description, where do you think the change is coming from?
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.
Oh, that's interesting. I just updated the graph so the test would pass, but I did not look into the contents of the .dyn file.
I followed the ReadTextObsolete resource string instructions and replaced FileSystem.ReadText with File.FromPath -> File.ReadText nodes
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 it's coming from the changes to codeblock that set the output name based on the variable name / value.
I think there are other resource strings (like the node obsolete messages) that need to be cleaned up, and since they are now stored in the repo (no comment on this) - I think that should all be cleaned up now as well for all languages, not just en-us. |
Yeah, I noted the resource strings in an earlier comment and made a note to remove them. I did not think about removing from the other languages. So I'll make a not eof that as well. |
I might be wrong about that. @zeusongit can you fill us in on the proper way to update resource strings these days? |
We just need to remove/update resource strings for en-US and the localization job should take care of the rest of the locale(s). |
Removed methods marked with [NodeObsolete] in v2.19.5
This should remove all the obsolete nodes before the 3.0 release
Still need to update the wiki
Purpose
DYN-9286 - Remove Dynamo nodes marked for deprecation in Dynamo 2.x
The purpose being to reduce the size of the codebase by removing deprecated code
Declarations
Check these if you believe they are true
Release Notes
Removed code for the following nodes:
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