Skip to content

DYN-9702: Add definition folder and dyf#17201

Merged
jasonstratton merged 3 commits into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Add-Definitions-folder-and-Dyf
Jul 13, 2026
Merged

DYN-9702: Add definition folder and dyf#17201
jasonstratton merged 3 commits into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Add-Definitions-folder-and-Dyf

Conversation

@Chloepeg

@Chloepeg Chloepeg commented Jun 30, 2026

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.
  • Cleared user-specific File Path values in doc/distrib/Templates/en-US/Import & Export Workflow.dyn, and set the associated files note to N/A.
    -Removed unused sample files from doc/distrib/Templates/Data/.

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
The Import & Export template- Us no longer includes hardcoded file paths or sample data files.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@johnpierson
@jnealb
@jasonstratton

@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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've updated it to always expect the shipped folder to exist and be included in DefinitionDirectories, with a fixed count of 3. CI should always meet that after the DynamoCore build copies doc/distrib/Definitions into the output.

"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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the description so true means curves must be closed, which matches the node logic and the group note.

},
{
"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",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Typo fixed

@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

Chloepeg added 3 commits July 13, 2026 10:43
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.
- Make definition directories test assert shipped definitions folder exists
- Clarify requireClosed description in Curve_Validate.dyf
- Fix Package/Library Search Paths typo in Curve_Validate note
Remove user-specific File Path values, set associated files note to N/A, and delete unused Templates/Data sample files.
@johnpierson
johnpierson force-pushed the DYN-9702-Add-Definitions-folder-and-Dyf branch from ede75b8 to 9fe0aee Compare July 13, 2026 16:43
@sonarqubecloud

Copy link
Copy Markdown

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

LGTM. Thank you for the changes Chloe

@jasonstratton
jasonstratton merged commit ef828fb into DynamoDS:master Jul 13, 2026
28 of 30 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.

3 participants