Skip to content

DYN-10078-InfoMessages-Version-Fix#16910

Closed
RobertGlobant20 wants to merge 18 commits intoDynamoDS:masterfrom
RobertGlobant20:DYN-10078-InfoMessages-Version-Fix
Closed

DYN-10078-InfoMessages-Version-Fix#16910
RobertGlobant20 wants to merge 18 commits intoDynamoDS:masterfrom
RobertGlobant20:DYN-10078-InfoMessages-Version-Fix

Conversation

@RobertGlobant20
Copy link
Contributor

Purpose

Show/Hide node info messages according to the Dynamo version in which the graph was created.
I've added the new method OnLogInfoMessage(string message, Version introducedInVersion) in the LogWarningMessageEvent class. This will allow that when a node is raising a info message it could provide the Version in which was introduced in this way in new Dynamo version we won't be showing the info message. In DynamoModel is the logic that will decide if it will show the info message or not based in the Version that was used to create a dyn file and the current Dynamo version. Finally I've updated the PublicAPI.Unshipped.txt file adding the public methods.

Declarations

Check these if you believe they are true

Release Notes

Show/Hide node info messages according to the Dynamo version in which the graph was created.

Reviewers

@zeusongit @aparajit-pratap @jasonstratton

FYIs

I've added the new method OnLogInfoMessage(string message, Version introducedInVersion) in the LogWarningMessageEvent class.
This will allow that when a node is raising a info message it could provide the Version in which was introduced in this way in new Dynamo version we won't be showing the info message.
In DynamoModel is the logic that will decide if it will show the info message or not based in the Version that was used to create a dyn file and the current Dynamo version.
Finally I've updated the PublicAPI.Unshipped.txt file adding the public methods.
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-10078

@RobertGlobant20
Copy link
Contributor Author

GIF showing the validation of the next 3 test cases:

  • In Dynamo 4.1.0, create a new workspace (not save to dyn), create a graph which contains the PolyCurve.ByPoints node and run it (the info message is not shown).
  • In Dynamo 4.1.0 open a existing graph (created in 3.6.1) which contains the PolyCurve.ByPoints node, run it  (the info message should be shown).
  • In Dynamo 4.1.0 open a existing graph (created in 4.1.0) which contains the PolyCurve.ByPoints node, run it  (the info message is not shown).

powershell_ise_U27dtDjApg

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 introduces version-aware filtering for node info messages, so that informational messages introduced in newer Dynamo versions can be suppressed when opening graphs created in those newer versions.

Changes:

  • Added IntroducedInVersion to LogWarningMessageEventArgs and a new OnLogInfoMessage(string, Version) overload to emit versioned info messages.
  • Added logic in DynamoModel to decide whether to log an info message based on the workspace version vs. the message’s introduced version.
  • Preserved EngineController.CurrentWorkspaceVersion across certain engine resets.

Reviewed changes

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

File Description
src/NodeServices/MessageEvents.cs Adds API surface to carry an “introduced in version” for info messages and an overload to emit versioned info messages.
src/DynamoCore/Models/DynamoModel.cs Filters info messages based on workspace version; preserves workspace version across some engine resets.
src/DynamoCore/PublicAPI.Unshipped.txt Adds new public API entries (currently appears to target DynamoServices symbols).

Comment on lines 2118 to 2122
// Save the workspace version before resetting the engine
var workspaceVersion = EngineController.CurrentWorkspaceVersion;
ResetEngine(true);
// Restore the workspace version after engine reset
EngineController.CurrentWorkspaceVersion = workspaceVersion;
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The workspace version preservation around ResetEngine is implemented in ForceRun/SetPeriodicEvaluation, but other ResetEngine call sites (e.g. python engine reload via DynamoModelEvents.OnRequestPythonReset) will still recreate EngineController and reset CurrentWorkspaceVersion to the current Dynamo version. With the new version-based info filtering, that can cause versioned info messages to be hidden/shown incorrectly after those resets. Consider moving the save/restore of EngineController.CurrentWorkspaceVersion into ResetEngine/ResetEngineInternal so it’s applied consistently for all resets.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check this? This comment sounds like it should be investigated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this comment was already addressed the code was moved to ResetEngine() method

Comment on lines 3201 to 3203
DynamoServices.LogWarningMessageEventArgs.IntroducedInVersion.get -> System.Version
DynamoServices.LogWarningMessageEventArgs.LogWarningMessageEventArgs(string msg, System.Version introducedInVersion) -> void
DynamoServices.LogWarningMessageEvents.OnLogInfoMessage(string message, System.Version introducedInVersion) -> void
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

These PublicAPI.Unshipped.txt entries appear to be for DynamoServices (NodeServices) symbols, not DynamoCore symbols. Microsoft.CodeAnalysis.PublicApiAnalyzers validates that entries correspond to public APIs in the current project; adding symbols from a referenced assembly will typically trigger RS0017 and break the build. Consider removing these entries from src/DynamoCore/PublicAPI.Unshipped.txt and instead updating the PublicAPI file for the project that actually defines these APIs (or adding PublicApiAnalyzers/PublicAPI files to DynamoServices if that project is intended to participate in API tracking).

Suggested change
DynamoServices.LogWarningMessageEventArgs.IntroducedInVersion.get -> System.Version
DynamoServices.LogWarningMessageEventArgs.LogWarningMessageEventArgs(string msg, System.Version introducedInVersion) -> void
DynamoServices.LogWarningMessageEvents.OnLogInfoMessage(string message, System.Version introducedInVersion) -> void

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with the copilot suggestion again. I would consider moving these symbols to the Public.Unshipped.txt file of DynamoServices. Also, since DynamoServices.LogWarningMessageEvents.OnLogInfoMessage is part of our public API and is very much shipped, I would add it to the Shipped.txt file.

Comment on lines 1979 to 1982
{
if (!ShouldLogVersionedInfoMessage(args))
return;
Validity.Assert(EngineController.LiveRunnerRuntimeCore != null);
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The new behavior (filtering info messages based on IntroducedInVersion vs EngineController.CurrentWorkspaceVersion) doesn’t appear to have test coverage. MessageLogTests already asserts info message logging; it would be good to add/extend tests to cover (1) versioned info messages being suppressed when workspaceVersion >= introducedInVersion, and (2) being logged when workspaceVersion < introducedInVersion (including an unsaved workspace scenario).

Copilot generated this review using guidance from repository custom instructions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, can you add unit tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can add dummy nodes using the new versioned info messages to FFITarget.dll, then use those nodes in your tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Add tests for all these cases:

  • Empty FileName (new workspace) and non-null IntroducedInVersion → suppresses
  • Empty FileName (new workspace) and no IntroducedInVersion → logs
  • No IntroducedInVersion → always logs
  • workspaceVersion < introducedInVersion → logs
  • workspaceVersion >= introducedInVersion → suppresses

if (workspaceVersion == null)
return true;

return workspaceVersion < introducedInVersion;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is workspaceVersion the same as the one defined in the DYN file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, workspaceVersion (EngineController.CurrentWorkspaceVersion;) should have the same Version defined in the DYN file.
I found a case in which was being overwritten after the ResetEngine() was executed but was fixed after the code was moved to ResetEngine() method.

RobertGlobant20 and others added 3 commits February 23, 2026 08:54
applying fix for unversioned info messages

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
In DynamoMode I've changed the place in which EngineController.CurrentWorkspaceVersion is set due that previously was setting the current Dynamo version instead of using the version read from the dyn file (just changing the place in which this was happening).
Removed the entries from PublicAPI.Unshipped.txt due that was using the DynamoCore project instead of NodeServices, so now the PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt were added to NodeServices project.
Finally I've added 6 unit tests for validating the next cases:

- Empty FileName (new workspace) and non-null IntroducedInVersion → suppresses info messages
- Empty FileName (new workspace) and no IntroducedInVersion → log info messages
- No IntroducedInVersion → always logs info messages
- workspaceVersion < introducedInVersion → logs info messages
- workspaceVersion >= introducedInVersion → suppresses info messages
Adding comment and fixing the return value due that If CurrentWorkspace is null(unexpected state), the info message is silently dropped. A safer default is return true.
@mjkkirschner
Copy link
Member

curious what is the use case for this?

@RobertGlobant20
Copy link
Contributor Author

curious what is the use case for this?

As a developer for adding an info message to a node for a specific Dynamo version and older versions.
For example like described in the jira task for nodes that belong to PolyCurve which the message should only should appear in Dynamo 4.0 and older versions.
image

RobertGlobant20 and others added 13 commits February 23, 2026 15:33
Fixing the build due that there were method missing in src\NodeServices\PublicAPI.Shipped.txt and src\NodeServices\PublicAPI.Unshipped.txt
Updating entries in src\NodeServices\PublicAPI.Unshipped.txt
Updating entries in src\NodeServices\PublicAPI.Unshipped.txt
Updating entries in src\NodeServices\PublicAPI.Unshipped.txt
Updating entries in src\NodeServices\PublicAPI.Unshipped.txt
Updating the DynamoService.csproj in the Code Analysis section similar like DynamoCore or DynamoCoreWPF to see if it fixes the problem.
Updating entries in src\NodeServices\PublicAPI.Unshipped.txt
Reverting changes about Microsoft.CodeAnalysis.PublicApiAnalyzers due that were already introduced in a previous PR.
removed files already added to the repo and fixes for PublicAPI.Unshipped.txt for new added methods.
@sonarqubecloud
Copy link

reverting change done when merging master to feature branch
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.

4 participants