-
Notifications
You must be signed in to change notification settings - Fork 18
Add uuid4FromHash utility to codegen (node_id skipping disabled pending vembda fix) #3272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ated UUID Co-Authored-By: [email protected] <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
dvargas92495
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI add a snapshot test to generic-node.test.ts to show this in action
…ule path Co-Authored-By: [email protected] <[email protected]>
|
Added snapshot tests to
Also fixed the implementation to use |
ee/codegen/src/utils/uuids.ts
Outdated
| * @param className - The class name | ||
| * @returns A UUID v4 string | ||
| */ | ||
| export function getNodeIdFromModuleAndName( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI update this helper to accept the full definition instead of forcing the consumer to split the fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed all feedback:
-
Updated helper to accept full definition - Renamed
getNodeIdFromModuleAndNametogetNodeIdFromDefinitionand updated it to accept the full definition object (withmoduleandnameproperties) instead of separate fields -
Commented out the node_id check - The check in
base.tsis now commented out with a TODO marker pending vembda-side fixes -
Skipped the tests - The
describeblock for node_id skipping tests is now usingdescribe.skipwith a TODO marker
| definitionModule && definitionName | ||
| ? getNodeIdFromModuleAndName(definitionModule, definitionName) | ||
| : undefined; | ||
| if (expectedNodeId === undefined || this.nodeData.id !== expectedNodeId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI comment out this check for now - there are some vembda-side problems we need to solve first
| }); | ||
| }); | ||
|
|
||
| describe("node_id skipping when it matches hash-generated UUID", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DevinAI keep this test but skip it for now while we solve some issues on the vembda side
… out check, skip tests Co-Authored-By: [email protected] <[email protected]>
NgoHarrison
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
Summary
Duplicates the
uuid4_from_hashutility fromee/vellum_eeintoee/codegenas a TypeScript implementation. The utility is designed to skip generating thenode_idattribute in Node Display classes when the UUID matches what would be generated from the node's definition module path and class name (matching the Python SDK'suuid4_from_hash(f"{node_class.__module__}.{node_class.__qualname__}")pattern).Note: The node_id skipping check is currently commented out pending vembda-side fixes. The utility and tests are in place but disabled until those issues are resolved.
Review & Testing Checklist for Human
uuid4FromHashimplementation produces identical output to the Pythonuuid4_from_hashfor the same inputs (tested withmy_nodes.my_custom_node.MyCustomNode→1be19097-e8d7-4acc-8bb5-2a99dc12dece)getNodeIdFromDefinitionhelper correctly handles undefined definitions by returning undefinedbase.tsNotes
base.tsis commented out with TODO markersgeneric-node.test.tsare skipped withdescribe.skipuntil vembda-side issues are resolvedbase-case-merge.test.ts(7 tests) are unrelated to this change