Skip to content

Conversation

@dnenov
Copy link
Collaborator

@dnenov dnenov commented Sep 25, 2025

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.Large
Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.Large

This 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.pnga1b2c3d4e5f6.Large.png
Autodesk.DesignScript.Geometry.CoordinateSystem.ByOriginVectors.Point-Vector-Vector-Vector.Large.pngf6e5d4c3b2a1.Large.png

The 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

  • created test to cover all resource file paths and prompts the long ones ( > 260 characters)
  • manually resolved the violating files

Reviewers

@zeusongit
@QilongTang
@avidit

FYIs

@saintentropy

- created test to cover all resource file paths and prompts the long ones ( > 260 characters)
- manually resolved the violating files
Copy link

@github-actions github-actions bot left a 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
Copy link
Collaborator Author

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.

@dnenov dnenov requested a review from zeusongit September 25, 2025 11:43
@QilongTang
Copy link
Contributor

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
Dynamo.Tests.CodeBlockNodeTests.IntegerOverflow
FYI: @avidit

@QilongTang QilongTang requested review from a team, Copilot and saintentropy September 25, 2025 13:56
Copy link
Contributor

Copilot AI left a 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

Comment on lines +127 to +128
// Calculate estimated server path length
var serverPathLength = ESTIMATED_SERVER_PREFIX_LENGTH + relativePath.Length;
Copy link

Copilot AI Sep 25, 2025

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.

Suggested change
// 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);

Copilot uses AI. Check for mistakes.
@dnenov
Copy link
Collaborator Author

dnenov commented Sep 25, 2025

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 Dynamo.Tests.CodeBlockNodeTests.IntegerOverflow FYI: @avidit

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.

Copy link
Contributor

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?

Copy link
Collaborator Author

@dnenov dnenov Sep 26, 2025

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.

Copy link
Contributor

@aparajit-pratap aparajit-pratap left a 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?

@dnenov
Copy link
Collaborator Author

dnenov commented Sep 26, 2025

@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.

@dnenov
Copy link
Collaborator Author

dnenov commented Sep 26, 2025

I think the file changes here will resolve the currently failing SelfServe process. The test is for posterity/futureproofing.

@mjkkirschner
Copy link
Member

mjkkirschner commented Sep 26, 2025

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.

@dnenov
Copy link
Collaborator Author

dnenov commented Sep 26, 2025

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?

@dnenov
Copy link
Collaborator Author

dnenov commented Sep 26, 2025

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.

@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
@dnenov dnenov marked this pull request as draft September 26, 2025 19:43
@dnenov dnenov marked this pull request as ready for review September 29, 2025 14:49
Copy link
Contributor

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?

Copy link
Collaborator Author

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>

Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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?

Copy link
Collaborator Author

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

@zeusongit
Copy link
Contributor

@aparajit-pratap aparajit-pratap merged commit 9e688e4 into DynamoDS:master Sep 30, 2025
26 of 29 checks passed
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.

5 participants