Skip to content

Conversation

kirill-stepanishin
Copy link

Summary

This PR improves GLV examples reliability and adds user-friendly root-level examples that work out-of-the-box with published drivers.

This is a follow-up to PR #3213 which fixed GLV examples reliability issues but required switching examples to local code so that fixes could be applied immediately. However, that approach meant new users had to build TinkerPop from source to run examples. This PR addresses that limitation by adding a separate set of root-level examples using published drivers.

Issues Fixed

GLV Examples Reliability (from PR #3213):

  • Go WriteBufferSize=0 causing E1201 buffer errors and nil pointer crashes
  • Node.js v22+ WebSocket API incompatibility (fix originally from PR Fix WebSocket API inconsistency in Gremlin connection #3204 by @xhuberty)
  • Python dependency conflicts preventing example builds
  • .NET outdated dependencies
  • Inconsistent documentation for running examples

User Experience (New):

  • No easy way for new users to run examples without building TinkerPop from source
  • Examples scattered across different locations with varying setup requirements

Changes Made

GLV Examples Fixes (from PR #3213):

  • Fix WriteBufferSize=0 validation in Go gorillaTransporter
  • Add conditional WebSocket .on() method usage for Node.js compatibility (credit: @xhuberty's fix from PR Fix WebSocket API inconsistency in Gremlin connection #3204)
  • Resolve dependency conflicts in Python examples
  • Configure all module-level examples to consistently use local development code
  • Add comprehensive documentation with prerequisites and build steps

Root-Level Examples (New):

  • Create glv-examples/ directory with examples for all 5 GLVs using published drivers (3.7.4)
  • Add comprehensive README with server setup and usage instructions
  • Update main documentation to reference root-level examples for users
  • Update release process documentation to include version update requirements
  • Add developer documentation explaining dual example structure

Approach

  • Module-level examples (gremlin-*/examples/): Use local development code for contributors and testing
  • Root-level examples (glv-examples/): Use published drivers for end users, manually updated during releases

Known Limitations

  • JavaScript root-level examples: Only work with Node.js v20, fail with v22+ until next release incorporates WebSocket compatibility fixes (originally from PR Fix WebSocket API inconsistency in Gremlin connection #3204)
  • Go root-level examples: Connections example has nil pointer issue until next release incorporates buffer validation fixes
  • Manual version updates: Root-level example versions must be manually updated as part of the release process (automatic updates are out of scope)

Credits

JavaScript WebSocket compatibility fix originally contributed by @xhuberty in PR #3204.

GLV Examples Fixes:
- Fix Go WriteBufferSize=0 causing E1201 buffer errors and nil pointer crashes
- Fix Node.js v22+ WebSocket API incompatibility with conditional .on() method usage
- Resolve Python dependency conflicts preventing example builds
- Configure all examples to consistently use local development code
- Add comprehensive documentation with prerequisites and build steps

Root-level Examples:
- Create glv-examples/ directory with examples for all 5 GLVs using published drivers (3.7.4)
- Add comprehensive README with server setup and usage instructions
- Update main documentation to reference root-level examples for users
- Update release process documentation to include version update requirements
- Add developer documentation explaining dual example structure

Provides reliable GLV examples for development and out-of-the-box examples
for new users while maintaining separation between local and published versions.
@kirill-stepanishin kirill-stepanishin force-pushed the glv-examples-fixes-and-root-level branch from 5f7f8d5 to 3c8b784 Compare September 26, 2025 19:22
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.23%. Comparing base (9b46b67) to head (7c2f8a9).
⚠️ Report is 380 commits behind head on 3.7-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##             3.7-dev    #3218      +/-   ##
=============================================
+ Coverage      76.14%   76.23%   +0.09%     
- Complexity     13152    13307     +155     
=============================================
  Files           1084     1092       +8     
  Lines          65160    67657    +2497     
  Branches        7285     7378      +93     
=============================================
+ Hits           49616    51581    +1965     
- Misses         12839    13335     +496     
- Partials        2705     2741      +36     

☔ View full report in Codecov by Sentry.
📢 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.

- Remove incorrect claim about build execution of GLV examples
- Move GLV examples section from build commands list to dedicated section
@kirill-stepanishin kirill-stepanishin force-pushed the glv-examples-fixes-and-root-level branch from 6604f36 to 7c2f8a9 Compare September 29, 2025 16:47
@Cole-Greer
Copy link
Contributor

Thanks @kirill-stepanishin, the changes LGTM.

VOTE +1


### Java
```bash
cd gremlin-java
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be gremlin-driver for consistency with the module package name?

Copy link
Author

Choose a reason for hiding this comment

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

That is a fair point, I'm not sure. Module package name is gremlin-driver, but the documentation lists it as gremlin-java along the other gremlin variants and drivers https://tinkerpop.apache.org/docs/current/reference/#gremlin-java

The package-lock.json file in gremlin-javascript/examples/ directory was
orphaned with no corresponding package.json file and no dependencies.
The actual package.json files are in the browser/ and node/ subdirectories.
Added explanation that root-level GLV examples use published drivers
for out-of-the-box usage, while module-level examples use local code.
@kirill-stepanishin kirill-stepanishin force-pushed the glv-examples-fixes-and-root-level branch from 407e156 to b509b0f Compare October 3, 2025 18:52
@kirill-stepanishin kirill-stepanishin force-pushed the glv-examples-fixes-and-root-level branch from b509b0f to d44ee51 Compare October 3, 2025 18:57
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