-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9196:net10-migration-resolve long file paths #16520
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-9196:net10-migration-resolve long file paths #16520
Conversation
- created test to cover all resource file paths and prompts the long ones ( > 260 characters) - manually resolved the violating files
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-9196
| /// when resource paths become too long. | ||
| /// </summary> | ||
| [TestFixture] | ||
| public class ResourcePathLengthTests : UnitTestBase |
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.
@saintentropy I created a new test class here, thinking that we may want to reuse the resx transverse logic for further work, as per your original intent to do a follow-up job on the image resource analysis.
|
Oh interesting fix @dnenov , would you rebase this branch after your last fix, because it seems the only failure on the job is a test you already fixed |
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 resolves Windows path length limitation issues for .NET 10 migration by implementing a systematic approach to shorten resource file paths that exceed the 260-character limit. The main solution involves replacing verbose method override naming patterns with numerical identifiers and consolidating duplicate resources that reference identical image files.
Key changes:
- Creates comprehensive test coverage to detect and prevent future long path issues
- Shortens resource file paths by replacing parameter-based naming with numerical suffixes
- Consolidates duplicate TSpline resources that reference the same underlying image files
Reviewed Changes
Copilot reviewed 2 out of 28 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/DynamoCoreTests/ResourcePathLengthTests.cs | Adds comprehensive test suite to validate resource paths don't exceed Windows limits and detect problematic patterns |
| src/Libraries/GeometryUIWpf/ProtoGeometryImages.resx | Updates resource references to use shortened file paths, replacing verbose parameter names with numerical identifiers |
| // Calculate estimated server path length | ||
| var serverPathLength = ESTIMATED_SERVER_PREFIX_LENGTH + relativePath.Length; |
Copilot
AI
Sep 25, 2025
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.
The server path length calculation only considers the relative path length but ignores intermediate directory structure. This may not accurately reflect the actual full path length on CI servers which could include additional nested directories.
| // Calculate estimated server path length | |
| var serverPathLength = ESTIMATED_SERVER_PREFIX_LENGTH + relativePath.Length; | |
| // Calculate estimated server path length, including intermediate directories | |
| var serverPathLength = ESTIMATED_SERVER_PREFIX_LENGTH + (actualPath.Length - Path.GetPathRoot(actualPath).Length); |
Yes, absolutely, will do. I do expect more devs to comment on this one, there are some arbitrary choices I made, so definitely expecting pushback or reconsideration. |
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 are the changes made to these pngs?
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.
The files were renamed. TSplineEdge1-Edge1-int-bool-bool-int-double-bool-double-double-bool substring is removed from the file name. The resource now points to the new, trimmed file name. The long file paths no longer break the build, that's was the whole logic here.
...y/LargeIcons/Autodesk.DesignScript.Geometry.TSpline.TSplineSurface.FlattenVertices.Large.png
Show resolved
Hide resolved
aparajit-pratap
left a comment
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.
@dnenov so from what I understand, you just renamed some png files, and that fixed the issue; there are no code changes involved to get the icons to work with these new filenames, is that correct?
That is exactly right @aparajit-pratap . And I created a test to make sure no future resources will go beyond that limit. |
|
I think the file changes here will resolve the currently failing SelfServe process. The test is for posterity/futureproofing. |
|
I have not reviewed in depth here but I wanted to point out that we’ve solved this same issue before for the docs files included in the docs browser - can we reuse the hashing implementation there instead of solving this twice in different ways(or manually)? Apologies if that code is already being leveraged. |
Thank you for the suggestion @mjkkirschner ! Can you think of a PR, or the implementation in code, or the person that worked on it so I can follow up with them? |
@RobertGlobant20 pointed me to the resource! Thanks again!! |
- added a perpetually [IGNORE] test that contains the renaming functionality - reusing the existing Dynamo.Utilities.Hash.GetHashFilenameFromString - follows logging patterns based on NodeDocumentationMarkdownGenerator
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 this just a change log for future reference?
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, just so there is a trace of what hash names correspond to what methods. Of course, this information is somewhat redundand, as we can see which hash corresponds to what method right in the resx file (sorry for the formatting): <data name="Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.Small" type="System.Resources.ResXFileRef, System.Windows.Forms"><value>..\..\Resources\ProtoGeometry\SmallIcons\AAKZVHCLWTXU5RUM5FFYOV63E2FFR2WTBC3X7N67EPUEO4HPFXFQ.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data>
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 thought in your PR description, you mentioned that we are keeping only one copy of the png's for all Tspline nodes as they're all the same, did I understand that correctly?
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 changed that when we move to the hashed names. Now we have a unique hash key for each unique 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 using the hash names for the png's here? It looks like you're truncating the parameter names and using numbers to distinguish between overloads in this case?
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 using the new hashed png names from now on. We are no-longer truncating the parameters from the name. It is exactly as written in the log file: renamed Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.Large: KSOB3IWYSUML6WJZTWA5LCRHIQV32SFCCGUANVBEKJLC7XCJ4PVA
|
The build does pass, https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/18445/ |
Purpose
A small part of the new .png resources shipped recently as part of the migration to net10 violate the max character restriction. The main reason is that we use unique file naming for identical node names with different overrides:
Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector.LargeAutodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.LargeThis PR resolves the path length conflicts by implementing hash-based renaming for problematic resource files, following the same approach used by the NodeDocumentationMarkdownGenerator. For example:
Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector.Large.png→a1b2c3d4e5f6.Large.pngAutodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.Large.png→f6e5d4c3b2a1.Large.pngThe hash names are generated using Dynamo.Utilities.Hash.GetHashFilenameFromString() to ensure uniqueness while keeping filenames short. Original names are preserved as comments in the updated .resx files for searchability.
Declarations
Check these if you believe they are true
Release Notes
Reviewers
@zeusongit
@QilongTang
@avidit
FYIs
@saintentropy