DYN-9719: Python auto migration leaves custom definitions marked as dirty#17185
Merged
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9719
Contributor
|
@ivaylo-matov , I have merged the PR. You can move the Jira issue to testing |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Purpose
This is a small PR that fixes a bug related to DYN-9719, although it does not have a dedicated Jira ticket.
Problem :
When a graph containing CPython nodes (or custom nodes that contain CPython nodes) is opened,
PythonMigrationViewExtension.SetEngine(...)automatically migrates those nodes to PythonNet3 and marks them as modified viaOnNodeModified().Since the graph is not executed during this process,
ClearDirtyFlag()is never called, leaving the migrated nodes withIsModified == true. Custom node workspaces are cached and shared byCustomNodeManager, so they remain in memory even after the host graph has been closed.As a result, when a user attempts to publish a package containing custom nodes that were auto-migrated,
PublishManagerViewModel.GetAllFiles(...)detectsworkspace.HasUnsavedChanges == trueand displays a warning that prevents the publishing process from continuing.Solution :
This PR replaces
OnNodeModified()withMarkNodesAsModified(). The new approach sets only theExecutionHintdirty flag and does not raise theModifiedevent, preventingNodeModifiedandHasUnsavedChangesfrom being updated.The PR also adds a regression test to
PythonMigrationViewExtensionTests.Before:
After:
Declarations
Check these if you believe they are true
Release Notes
Fixes a bug where auto-migrating CPython custom nodes prevents packages being published in the same Dynamo session.
Reviewers
@DynamoDS/eidos
@jasonstratton
@johnpierson
FYIs
@dnenov