Skip to content

DYN-9702: Add definition folder and dyf#17201

Open
Chloepeg wants to merge 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Add-Definitions-folder-and-Dyf
Open

DYN-9702: Add definition folder and dyf#17201
Chloepeg wants to merge 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Add-Definitions-folder-and-Dyf

Conversation

@Chloepeg

Copy link
Copy Markdown
Contributor

Purpose

This PR addresses DYN-9702.

This update adds the .dyf file used by the custom node template introduced in DYN-9927(#16861). The code changes ensure that Curve_Validate.dyf ships with Dynamo as a proper custom node definition, making it available from the Add-ons section of the Dynamo library when starting.

dyf gif

changes :

  • Added a new shipped definitions source folder at doc/distrib/Definitions.
  • Added Curve_Validate.dyf as a shipped custom node definition.
  • Updated DynamoCore.csproj to copy shipped definitions into the runtime definitions folder during build.
  • Updated PathManager.DefinitionDirectories to include the shipped runtime definitions folder when it exists.
  • Updated the related path manager test to account for the optional shipped definitions path.

Declarations

Check these if you believe they are true

Release Notes

Curve_Validate.dyf is now shipped as a custom node definition, appears in the Dynamo library under Add-ons, and is available for Make a Custom Node.dyn template introduced in DYN-9927

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@johnpierson
@jnealb
@jasonstratton

add a Definitions folder for custom node .dyf files, similar to how templates are already shipped from doc/distrib/Templates. The new Curve_Validate.dyf file is copied into the build output definitions folder, and Dynamo now includes that shipped folder when scanning for custom node definitions at startup.

DynamoCore.csproj now treats doc/distrib/Definitions as a source folder for shipped custom node definitions and copies it to the runtime definitions folder.
PathManager.DefinitionDirectories now includes the shipped definitions folder if it exists, while keeping the existing user/package definition paths unchanged.
The related test now allows the extra shipped definitions path when that folder is present.
@github-actions github-actions Bot changed the title Add definition folder and dyf DYN-9702: Add definition folder and dyf Jun 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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-9702

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for shipping a custom node definition (Curve_Validate.dyf) with Dynamo by introducing a new doc/distrib/Definitions source folder, copying those assets into the build output, and extending PathManager.DefinitionDirectories to include the shipped runtime definitions folder when present.

Changes:

  • Adds a new shipped definitions source folder and includes Curve_Validate.dyf.
  • Updates DynamoCore.csproj to copy shipped definitions into the build output under definitions/.
  • Updates PathManager.DefinitionDirectories (and its related test) to include the shipped runtime definitions folder when it exists.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/Libraries/PackageManagerTests/PackageLoaderTests.cs Updates a PathManager-related test to account for an additional optional definitions directory.
src/DynamoCore/DynamoCore.csproj Adds DefinitionFiles items and copies them to $(OutputPath)definitions\... during build.
src/DynamoCore/Configuration/PathManager.cs Extends DefinitionDirectories to append a common/runtime definitions directory when present.
doc/distrib/Definitions/Curve_Validate.dyf Adds the shipped custom node definition to be included in runtime definitions.

Comment on lines +1433 to +1434
var commonDefinitions = Path.Combine(pathManager.CommonDataDirectory, PathManager.DefinitionsDirectoryName);
var expectedDefinitionDirectoryCount = Directory.Exists(commonDefinitions) ? 3 : 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I was going to make a similar comment. But maybe my analysis is wrong. When this test runs in the CI pipeline, the directory is created by the CI process and should always return 3, right? ... When does it return 2? When testing locally?

And if the CI fails to create the dir, won't the assert still pass with a value of 2?

What happens if we ever add another directory or want to remove one? Does the test suddenly start failing? Probably an easy fix though.

"TypeName": "bool",
"TypeRank": 0,
"DefaultValue": "false",
"Description": "Closed rule\ntrue = closed curves allowed\nfalse = open curves allowed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch by copilot here. The description should indicate only closed curved accepted. It reads like if the parameter is true, both closed and open curves are accepted

},
{
"Id": "a4e7bab50f804226a58b34748879b6eb",
"Title": "ADDITIONAL COMMENTS\n_____________________________________________________ \n\nCustom nodes are typically found in the Add-ons section of the Library.\r\nThis custom node is located under:\r\nAdd-ons → Standards → Curve → Curve_Validate\r\n\r\nIf it does not appear:\r\n\r\nCheck that the .dyf file is in your custom nodes folder\r\n\r\nGo to:\r\nPackages → Package Manager → Package Settings → Package/Lirary Search Paths\r\nVerify the folder path is listed or add a new path\r\nRestart Dynamo after adding new custom nodes\n",

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just address the Copilot comments and it is good.

Comment on lines +1433 to +1434
var commonDefinitions = Path.Combine(pathManager.CommonDataDirectory, PathManager.DefinitionsDirectoryName);
var expectedDefinitionDirectoryCount = Directory.Exists(commonDefinitions) ? 3 : 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I was going to make a similar comment. But maybe my analysis is wrong. When this test runs in the CI pipeline, the directory is created by the CI process and should always return 3, right? ... When does it return 2? When testing locally?

And if the CI fails to create the dir, won't the assert still pass with a value of 2?

What happens if we ever add another directory or want to remove one? Does the test suddenly start failing? Probably an easy fix though.

"TypeName": "bool",
"TypeRank": 0,
"DefaultValue": "false",
"Description": "Closed rule\ntrue = closed curves allowed\nfalse = open curves allowed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch by copilot here. The description should indicate only closed curved accepted. It reads like if the parameter is true, both closed and open curves are accepted

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