Skip to content

TINKERPOP-3183: Upgrade to Groovy 6 - #3773

Open
Iryna-Kahamlyk wants to merge 3 commits into
apache:masterfrom
Iryna-Kahamlyk:groovy-upgrade
Open

Iryna-Kahamlyk wants to merge 3 commits into
apache:masterfrom
Iryna-Kahamlyk:groovy-upgrade

Conversation

@Iryna-Kahamlyk

Copy link
Copy Markdown
Contributor

JIRA: https://issues.apache.org/jira/browse/TINKERPOP-3183

Upgrades Groovy from 4.0.32 to 6.0.0. The Gremlin Console now runs on the Groovy 6 shell (groovysh 6, built on
JLine 4) through its embedding API, replacing groovysh 4 and the unmaintained JLine 2.

gremlin-groovy

  • Kept def variables visible across scripts in interpreter mode with Groovy 6's AST changes.
  • Fixed g.inject(null) choosing Groovy 5's new inject() helpers, and a recursion in the sugar plugin's property lookup.
  • Kept the last of two imports with the same simple name, which Groovy 5+ otherwise rejects (keeps a plugin able to override __).
  • Allowed ArrayGroovyMethods in the sandbox allowlists, where Groovy 5 moved the array extension methods.

gremlin-console

  • Ported the Gremlin commands (:plugin, :set, :install, :uninstall, :cls) to JLine commands. They keep their
    names, messages and Tab completion; :help /plugin or :plugin --help shows their help.
  • Restored line continuation after a trailing . or operator (e.g. g.V().), which groovysh 5/6 no longer support.
  • Kept : commands, -i/-e scripts with Gremlin commands, piped input, preferences, plugins, colors and result iteration.
  • ctrl+c now stops printing results and running statements and leaves the console usable.

Behavior changes (documented in the upgrade notes)

  • An assignment line displays ==>null instead of the value, and an assigned traversal is not iterated.
  • Commands, empty lines, comments, imports and method/class definitions display ==>null.
  • The symbol shortcuts (:?, :+, :-, :=) and several groovysh 4 commands (:show, :purge, :record, ...) are
    gone; replacements are listed in the upgrade notes.
  • fail() shows only FailException: <message> unless the traversal is iterated on the line, e.g. with toList().
  • :load reports Loaded: <file>, :save needs a file name, and history from earlier versions is not read.

Testing

  • Unit tests (gremlin-groovy)
  • Unit tests (gremlin-console)
  • Python console tests

Runs the Gremlin Console on groovysh 6 and makes gremlin-groovy compatible with Groovy 6.

Assisted-by: Kiro:claude-opus-5.5
@codecov-commenter

codecov-commenter commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.83425% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.93%. Comparing base (a28cd1f) to head (e09d815).
⚠️ Report is 975 commits behind head on master.

Files with missing lines Patch % Lines
...rg/apache/tinkerpop/gremlin/console/Console.groovy 69.11% 20 Missing and 22 partials ⚠️
...erpop/gremlin/console/ColonCommandCompleter.groovy 60.86% 8 Missing and 1 partial ⚠️
...jsr223/ast/InterpreterModeASTTransformation.groovy 81.81% 2 Missing and 4 partials ⚠️
...e/tinkerpop/gremlin/console/StatementParser.groovy 91.66% 2 Missing and 2 partials ⚠️
.../apache/tinkerpop/gremlin/console/Colorizer.groovy 66.66% 1 Missing and 2 partials ⚠️
.../gremlin/console/commands/GremlinSetCommand.groovy 93.33% 1 Missing and 1 partial ⚠️
...rpop/gremlin/console/commands/PluginCommand.groovy 81.81% 0 Missing and 2 partials ⚠️
.../apache/tinkerpop/gremlin/console/PluggedIn.groovy 88.88% 1 Missing ⚠️
...nkerpop/gremlin/console/commands/ClsCommand.groovy 66.66% 0 Missing and 1 partial ⚠️
...pop/gremlin/console/commands/GremlinCommand.groovy 92.85% 0 Missing and 1 partial ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3773      +/-   ##
============================================
+ Coverage     76.35%   77.93%   +1.57%     
- Complexity    13424    15152    +1728     
============================================
  Files          1012     1054      +42     
  Lines         60341    67138    +6797     
  Branches       7075     8027     +952     
============================================
+ Hits          46076    52325    +6249     
- Misses        11548    11573      +25     
- Partials       2717     3240     +523     

☔ 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.

@Iryna-Kahamlyk
Iryna-Kahamlyk marked this pull request as ready for review November 5, 2026 23:56
@spmallette

Copy link
Copy Markdown
Contributor

For committers - Created PR root bead: tp-sg0i

🤖 Agent assisted comment.

Comment thread CHANGELOG.asciidoc Outdated
* Fixed `CountStrategy` so that it no longer adds a `limit()` before `count().is(P)` when the capped count can pass the predicate and is then observed downstream, e.g. `out().count().is(gt(2))`.
* Removed the per-request `userAgent` option from all drivers so the user agent is sent only as the `User-Agent` header controlled by `enableUserAgentOnConnect`.
* Fixed `gremlin-mcp` to include the server's reason when a query fails rather than only reporting that it failed.
* Bumped Groovy to 6.0.0 *(breaking)*.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove "breaking" label. that's not for changelog entries.

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.

3 participants