Skip to content

DYN-9702: Log when shared definitions folder is missing#17221

Closed
jasonstratton wants to merge 2 commits into
DynamoDS:masterfrom
jasonstratton:DYN-9702-Log-missing-shared-definitions-folder
Closed

DYN-9702: Log when shared definitions folder is missing#17221
jasonstratton wants to merge 2 commits into
DynamoDS:masterfrom
jasonstratton:DYN-9702-Log-missing-shared-definitions-folder

Conversation

@jasonstratton

Copy link
Copy Markdown
Contributor

Purpose

DYN-9702 introduced a shared "definitions" folder (shipped with a built-in custom node, Curve_Validate.dyf) that DynamoCore.csproj copies next to DynamoCore.dll at build time, and that PathManager.DefinitionDirectories surfaces to the rest of Dynamo.

Regression introduced in: #17201, 2026-07-13.

If that folder is ever missing at runtime, DefinitionDirectories silently omits it from its returned list with no error or log line -- this exact silent-drop is what caused PackageManagerTests.PackageLoaderTests.BuiltInPackagesIsNotExposedInPathManager to fail deterministically on every daily CBCI build since 2026-07-14, with no visibility into why.

This is a small, standalone fix: add a diagnostic warning when the folder is expected but not found. It intentionally does not change behavior (the folder is not created, the returned list is unchanged) -- it only makes the omission observable. We have not yet root-caused why the folder is missing specifically in the CBCI build environment (it is present in every local build); that investigation is ongoing and a follow-up commit/PR will land the actual fix once identified.

Key changes:

  • PathManager.DefinitionDirectories now logs via Trace.TraceWarning when the shared definitions folder doesn't exist at the expected path. PathManager has no injected logger, so this follows the existing low-level Trace-based diagnostic precedent already used elsewhere in DynamoCore (e.g. AscSDKWrapper.cs) rather than adding a new logging dependency.

Declarations

Release Notes

N/A -- diagnostic logging only, no user-facing or behavioral change.

Reviewers

(FILL ME IN) Reviewer 1

FYIs

(FILL ME IN, Optional)

Copilot AI review requested due to automatic review settings July 15, 2026 17:28

@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

Adds low-level diagnostic logging to make a missing shared definitions folder observable at runtime, helping diagnose CI/build environments where the folder isn’t being deployed as expected.

Changes:

  • Emit a Trace.TraceWarning when the expected shared definitions directory (under CommonDataDirectory/definitions) does not exist.
  • Keep behavior unchanged: the directory is not created and the returned DefinitionDirectories list is unchanged.

Comment on lines 223 to +238
if (Directory.Exists(commonDefinitionsDirectory) &&
!definitionDirectories.Contains(commonDefinitionsDirectory, StringComparer.OrdinalIgnoreCase))
{
definitionDirectories.Add(commonDefinitionsDirectory);
}
else if (!Directory.Exists(commonDefinitionsDirectory))
{
// Diagnostic only: the shared "definitions" folder (e.g. Curve_Validate.dyf)
// is expected to be copied next to DynamoCore.dll at build time (see the
// Copy targets in DynamoCore.csproj). If it's missing, do not fabricate or
// add the path here -- just make the omission visible so this doesn't fail
// silently again (DYN-9702). PathManager has no injected logger, so this
// follows the existing low-level Trace-based diagnostic convention used
// elsewhere in DynamoCore instead of adding a new logging dependency.
Trace.TraceWarning("Expected shared definitions folder not found at: " + commonDefinitionsDirectory);
}

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 agree with this one is being evaluated twice

Add a Trace.TraceWarning in PathManager.DefinitionDirectories when the
common "definitions" folder (containing Curve_Validate.dyf, copied by
DynamoCore.csproj at build time) is not found at commonDataDir. This
is diagnostic-only -- the returned directory list is unchanged, and we
deliberately do not auto-create the folder (that approach was tried
and reverted). Previously this case failed completely silently, which
caused a hard-to-diagnose CI regression. PathManager has no injected
logger, so this follows the existing Trace-based diagnostic convention
used elsewhere in the codebase for logger-less, non-fatal issues
rather than adding a new logging dependency.

@RobertGlobant20 RobertGlobant20 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 with one minor comment

@jasonstratton

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate — superseded by #17222, which lands the same fix (null-guarding the PackageLoaderTests predicates so the non-package Curve_Validate node with a null PackageInfo is skipped). Roberto's PR got there first.

@sonarqubecloud

Copy link
Copy Markdown

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