Skip to content

fix: revert Groovy 5.0.4 to 4.0.28 — GremlinServerPlugin fails to start#3725

Merged
robfrank merged 1 commit intomainfrom
fix/3724-gremlin-server-plugin-valueOf-conflict
Mar 25, 2026
Merged

fix: revert Groovy 5.0.4 to 4.0.28 — GremlinServerPlugin fails to start#3725
robfrank merged 1 commit intomainfrom
fix/3724-gremlin-server-plugin-valueOf-conflict

Conversation

@robfrank
Copy link
Copy Markdown
Collaborator

Summary

  • Reverts groovy.version in gremlin/pom.xml from 5.0.4 back to 4.0.28
  • Dependabot's major-version bump (commit 63b536a41) is incompatible with TinkerPop 3.8.0, which targets Groovy 4.x (<groovy.version>4.0.25</groovy.version> in its parent POM)
  • Groovy 5 rejects the multiple wildcard static enum imports (import static SomeEnum.*) added by TinkerPop's ImportGroovyCustomizer, because all enums share a valueOf(String) method — causing "The name valueOf is already declared"
  • Adds regression test GremlinGroovyEngineTest that exercises the exact initialization path

Closes #3724

Test plan

  • New GremlinGroovyEngineTest.groovyEngineInitializesWithCoreImports passes
  • GremlinGAVTest (8 tests) passes
  • SQLFromGremlinTest passes
  • Pre-existing failures in CypherQueryEngineTest, CypherTest, GremlinTest.gremlinFromDatabase confirmed unrelated (fail on main before this change)

🤖 Generated with Claude Code

…rt (#3724)

Dependabot bumped groovy.version from 4.0.28 to 5.0.4, but TinkerPop 3.8.0
targets Groovy 4.x. Groovy 5 rejects the multiple wildcard static enum imports
added by ImportGroovyCustomizer with "The name valueOf is already declared",
preventing the Gremlin script engine from initializing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical startup failure in GremlinServerPlugin by reverting the Groovy dependency version to an earlier, compatible release. The issue stemmed from Groovy 5.x's stricter handling of static enum imports, which conflicted with TinkerPop 3.8.0's initialization process. A new regression test has been added to ensure the Gremlin Groovy engine initializes correctly and to safeguard against similar problems in the future.

Highlights

  • Groovy Version Reversion: Reverted the groovy.version in gremlin/pom.xml from 5.0.4 back to 4.0.28 to resolve incompatibility issues with TinkerPop 3.8.0.
  • TinkerPop Compatibility Fix: Addressed a startup failure where Groovy 5.x rejected multiple wildcard static enum imports from TinkerPop's ImportGroovyCustomizer, causing "The name valueOf is already declared" errors.
  • Regression Test Added: Introduced GremlinGroovyEngineTest to specifically test the Gremlin Groovy script engine's initialization path with core imports, preventing future regressions of this issue.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@claude
Copy link
Copy Markdown

claude bot commented Mar 25, 2026

Code Review

This is a clean, well-motivated fix. The root cause analysis is correct: TinkerPop 3.8.x targets Groovy 4.x, and Groovy 5's stricter duplicate-symbol rules break ImportGroovyCustomizer's wildcard static enum imports. Reverting to 4.0.28 is the right call.

Positives

  • Minimal, focused change — exactly one line in pom.xml
  • Excellent Javadoc in the regression test explaining the exact mechanism of the failure
  • Test exercises the real initialization path (uses actual CoreGremlinPlugin customizers), not a mock
  • AssertJ assertions and final keywords follow project conventions
  • License header is correct

Issue: Resource Leak in the Test

GremlinGroovyScriptEngine implements AutoCloseable (via GremlinScriptEngine). The current test creates an engine but never closes it, which can leak thread pools and class loaders. Suggest using try-with-resources and changing "throws ScriptException" to "throws Exception" since AutoCloseable.close() declares a checked Exception.

Minor Nit

The assertion assertThat(engine.eval("1 + 1")).isEqualTo(2) is correct — Groovy returns Integer(2) and autoboxing handles the comparison. No change needed.


Overall this PR is in good shape. The resource-leak fix in the test is the only substantive concern before merging.

@github-actions
Copy link
Copy Markdown
Contributor

📜 License Compliance Check

✅ License check passed. See artifacts for full report.

License Summary (first 50 lines)

Lists of 389 third-party dependencies.
     (Apache License 2.0) LZ4 Java Compression (at.yawk.lz4:lz4-java:1.10.4 - https://github.com/yawkat/lz4-java)
     (EPL 2.0) (GNU Lesser General Public License) Logback Classic Module (ch.qos.logback:logback-classic:1.5.32 - http://logback.qos.ch/logback-classic)
     (EPL 2.0) (GNU Lesser General Public License) Logback Core Module (ch.qos.logback:logback-core:1.5.32 - http://logback.qos.ch/logback-core)
     (Apache 2) ArcadeDB BOLT Protocol (com.arcadedb:arcadedb-bolt:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-bolt/)
     (Apache 2) ArcadeDB Console (com.arcadedb:arcadedb-console:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-console/)
     (Apache 2) ArcadeDB Engine (com.arcadedb:arcadedb-engine:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-engine/)
     (Apache 2) ArcadeDB GraphQL (com.arcadedb:arcadedb-graphql:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-graphql/)
     (Apache 2) ArcadeDB Gremlin (com.arcadedb:arcadedb-gremlin:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-gremlin/)
     (Apache 2) ArcadeDB gRPC Stubs (com.arcadedb:arcadedb-grpc:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-grpc/)
     (Apache 2) ArcadeDB gRPC Client (com.arcadedb:arcadedb-grpc-client:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-grpc-client/)
     (Apache 2) ArcadeDB gRpcW (com.arcadedb:arcadedb-grpcw:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-grpcw/)
     (Apache 2) ArcadeDB Integration (com.arcadedb:arcadedb-integration:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-integration/)
     (Apache 2) ArcadeDB Metrics (com.arcadedb:arcadedb-metrics:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-metrics/)
     (Apache 2) ArcadeDB MongoDB Wire Protocol (com.arcadedb:arcadedb-mongodbw:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-mongodbw/)
     (Apache 2) ArcadeDB Network (com.arcadedb:arcadedb-network:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-network/)
     (Apache 2) ArcadeDB PostgresW (com.arcadedb:arcadedb-postgresw:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-postgresw/)
     (Apache 2) ArcadeDB RedisW (com.arcadedb:arcadedb-redisw:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-redisw/)
     (Apache 2) ArcadeDB Server (com.arcadedb:arcadedb-server:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-server/)
     (Apache 2) ArcadeDB Studio (com.arcadedb:arcadedb-studio:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-studio/)
     (Apache 2) ArcadeDB Test Utils (com.arcadedb:arcadedb-test-utils:26.4.1-SNAPSHOT - https://arcadedata.com/arcadedb-test-utils/)
     (Apache License 2.0) HPPC Collections (com.carrotsearch:hppc:0.7.1 - http://labs.carrotsearch.com/hppc.html/hppc)
     (Apache License 2.0) Metrics Core (com.codahale.metrics:metrics-core:3.0.2 - http://metrics.codahale.com/metrics-core/)
     (The Apache License, Version 2.0) com.conversantmedia:disruptor (com.conversantmedia:disruptor:1.2.21 - https://github.com/conversant/disruptor)
     (Apache License 2.0) Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.20 - https://github.com/FasterXML/jackson)
     (Apache License 2.0) Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.21 - https://github.com/FasterXML/jackson)
     (Apache License 2.0) Jackson-core (com.fasterxml.jackson.core:jackson-core:2.21.1 - https://github.com/FasterXML/jackson-core)
     (Apache License 2.0) Jackson-core (com.fasterxml.jackson.core:jackson-core:2.21.2 - https://github.com/FasterXML/jackson-core)
     (Apache License 2.0) jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.21.1 - https://github.com/FasterXML/jackson)
     (Apache License 2.0) jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.21.2 - https://github.com/FasterXML/jackson)
     (Apache License 2.0) Jackson-dataformat-YAML (com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.21.1 - https://github.com/FasterXML/jackson-dataformats-text)
     (Apache License 2.0) Jackson datatype: JSR310 (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.1 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310)
     (Apache License 2.0) Caffeine cache (com.github.ben-manes.caffeine:caffeine:2.3.1 - https://github.com/ben-manes/caffeine)
     (Apache License 2.0) docker-java-api (com.github.docker-java:docker-java-api:3.7.1 - https://github.com/docker-java/docker-java)
     (Apache License 2.0) docker-java-transport (com.github.docker-java:docker-java-transport:3.7.1 - https://github.com/docker-java/docker-java)
     (Apache License 2.0) docker-java-transport-zerodep (com.github.docker-java:docker-java-transport-zerodep:3.7.1 - https://github.com/docker-java/docker-java)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) btf (com.github.java-json-tools:btf:1.3 - https://github.com/java-json-tools/btf)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) jackson-coreutils (com.github.java-json-tools:jackson-coreutils:2.0 - https://github.com/java-json-tools/jackson-coreutils)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) jackson-coreutils-equivalence (com.github.java-json-tools:jackson-coreutils-equivalence:1.0 - https://github.com/java-json-tools/jackson-coreutils)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) json-patch (com.github.java-json-tools:json-patch:1.13 - https://github.com/java-json-tools/json-patch)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) json-schema-core (com.github.java-json-tools:json-schema-core:1.2.14 - https://github.com/java-json-tools/json-schema-core)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) json-schema-validator (com.github.java-json-tools:json-schema-validator:2.2.14 - https://github.com/java-json-tools/json-schema-validator)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) msg-simple (com.github.java-json-tools:msg-simple:1.2 - https://github.com/java-json-tools/msg-simple)
     (Apache Software License, version 2.0) (Lesser General Public License, version 3 or greater) uri-template (com.github.java-json-tools:uri-template:0.10 - https://github.com/java-json-tools/uri-template)
     (Apache License 2.0) (GNU Lesser General Public License) javaparser-core (com.github.javaparser:javaparser-core:3.26.3 - https://github.com/javaparser/javaparser-core)
     (Apache License 2.0) JCIP Annotations under Apache License (com.github.stephenc.jcip:jcip-annotations:1.0-1 - http://stephenc.github.com/jcip-annotations)
     (Apache License 2.0) Google Android Annotations Library (com.google.android:annotations:4.1.1.4 - http://source.android.com/)
     (BSD 3-Clause) API Common (com.google.api:api-common:2.53.0 - https://github.com/googleapis/sdk-platform-java)
     (Apache License 2.0) proto-google-common-protos (com.google.api.grpc:proto-google-common-protos:2.67.0 - https://github.com/googleapis/sdk-platform-java)

@robfrank robfrank added this to the 26.4.1 milestone Mar 25, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an incompatibility issue between Groovy 5 and TinkerPop 3.8.x by downgrading the Groovy version to 4.0.28. A new regression test, GremlinGroovyEngineTest, has been added to verify that the Gremlin Groovy script engine initializes correctly with core imports. The review suggests enhancing this test to more directly confirm the availability of Gremlin-specific imports, which were the root cause of the original problem.

Comment on lines +50 to +51
// A successful eval proves the engine started without "valueOf is already declared"
assertThat(engine.eval("1 + 1")).isEqualTo(2);
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.

medium

While eval("1 + 1") confirms the script engine is alive, it doesn't verify that the Gremlin-specific imports (which were the source of the original issue) are working correctly. A more robust test would be to evaluate an expression that uses one of the core Gremlin imports, such as an enum from T. This would make the regression test more specific and less likely to pass if there are other import-related issues.

    // A successful eval proves the engine started without "valueOf is already declared"
    // and that core Gremlin imports are available.
    assertThat(engine.eval("T.id")).isEqualTo(org.apache.tinkerpop.gremlin.structure.T.id);

@robfrank robfrank merged commit a07cbc9 into main Mar 25, 2026
21 of 26 checks passed
@robfrank robfrank deleted the fix/3724-gremlin-server-plugin-valueOf-conflict branch March 25, 2026 17:33
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-16.14%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (dc4d0b8) 115224 84407 73.25%
Head commit (5ec2081) 146168 (+30944) 83483 (-924) 57.11% (-16.14%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3725) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.13%. Comparing base (dc4d0b8) to head (5ec2081).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3725      +/-   ##
==========================================
- Coverage   64.43%   56.13%   -8.31%     
==========================================
  Files        1579     1579              
  Lines      115224   115224              
  Branches    24378    24378              
==========================================
- Hits        74247    64676    -9571     
- Misses      30846    41436   +10590     
+ Partials    10131     9112    -1019     

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

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.

GremlinServerPlugin not working

1 participant