Skip to content

TINKERPOP-2063 Add Tree support to the GLVs (Python, .NET, Go, JavaScript)#3495

Open
GumpacG wants to merge 2 commits into
apache:masterfrom
GumpacG:tree-glv
Open

TINKERPOP-2063 Add Tree support to the GLVs (Python, .NET, Go, JavaScript)#3495
GumpacG wants to merge 2 commits into
apache:masterfrom
GumpacG:tree-glv

Conversation

@GumpacG

@GumpacG GumpacG commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR brings a matching native Tree type to all Gremlin Language Variants so that a server-produced
tree() result deserializes into a first-class object with the same read/navigation
API instead of an untyped map (or, in JavaScript, a serializer stub that threw).

The work is deserialization + read-navigation focused: trees are computed on the
server and streamed to the client, so each GLV gains (1) a native Tree type and
(2) a GraphBinary 0x2b (de)serializer. A symmetric serialize path is included for
round-trip/test symmetry.

What changed per variant

  • gremlin-python: Tree class in structure/graph.py; TreeIO in graphbinaryV4.py
    (auto-registered for 0x2b); removed the @StepTree feature-test skip.
  • gremlin-dotnet: Structure/Tree.cs and GraphBinary4/Types/TreeSerializer.cs;
    registered DataType.Tree; implemented the Gherkin tree-structure assertion; removed
    the @StepTree skip.
  • gremlin-go: driver/tree.go plus treeType (0x2b), readTree/treeWriter, and
    registration; removed the ~@StepTree cucumber tag.
  • gremlin-javascript: Tree class in structure/graph.ts; TreeSerializer.js
    replacing the previous stub; exported Tree; removed the named tree ignores.

Testing

  • Per-GLV unit tests covering the full read API, structural equality, GraphBinary
    round-trips (nested, empty, null-key), duplicate-sibling-key collapse, element-key
    equality (by id and concrete type), childAt on a missing key, addTree null
    rejection, splitParents edge cases, and getLeafTrees.
  • Per-GLV integration tests run g.V(1).out().out().tree() against the modern graph
    and navigate the native result.
  • The shared Gherkin tree() feature scenarios were un-skipped in each GLV and assert
    tree structure through the read API.

Notes

  • Scope is the GLVs; the Java core change shipped in Make Tree no longer extend HashMap #3448.
  • Tree results travel server -> client; the serialize path exists for symmetry and
    round-trip tests rather than a common workflow.

https://issues.apache.org/jira/browse/TINKERPOP-2063

Assisted-by: Kiro: Claude Opus 4.8

Tree in JS
Tree in Python
Tree in Go
Tree in .NET

Assisted-by: Kiro: Claude Opus 4.8
@codecov-commenter

codecov-commenter commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.18%. Comparing base (a28cd1f) to head (315f4c8).
⚠️ Report is 167 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3495      +/-   ##
============================================
- Coverage     76.35%   76.18%   -0.18%     
- Complexity    13424    13864     +440     
============================================
  Files          1012     1031      +19     
  Lines         60341    62918    +2577     
  Branches       7075     7338     +263     
============================================
+ Hits          46076    47931    +1855     
- Misses        11548    12014     +466     
- Partials       2717     2973     +256     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GumpacG GumpacG changed the title Add Tree support to the GLVs (Python, .NET, Go, JavaScript) TINKERPOP-2063 Add Tree support to the GLVs (Python, .NET, Go, JavaScript) Jun 30, 2026
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.

2 participants