@@ -34,28 +34,38 @@ complete list of all the modifications that are part of this release.
3434
3535==== Gremlin Server Initialization Without Groovy
3636
37- Gremlin Server no longer requires Groovy for server initialization. Three new YAML configuration mechanisms replace
38- the Groovy init scripts that were previously used to create `TraversalSource` bindings, load data, and run lifecycle
39- hooks.
37+ Previous versions of Gremlin Server relied on the Groovy script engine for basic server initialization; binding
38+ traversal sources, loading data, and running lifecycle hooks all required Groovy init scripts. This meant the Groovy
39+ script engine was active by default, even for users who only needed to send standard Gremlin queries. An active
40+ scripting engine capable of executing arbitrary code introduces a security surface that is difficult to harden and
41+ easy to misconfigure.
4042
41- ===== Auto-Created TraversalSources
43+ As of this release, Groovy is completely disabled by default throughout the entire server lifecycle. Server
44+ initialization is handled through new declarative YAML configuration, and standard Gremlin queries are processed by the
45+ `gremlin-lang` engine. Users who explicitly need Groovy script execution can still opt in, but it is no longer
46+ required for any standard usage.
4247
43- Any graph defined in the `graphs` section that does not have an explicit `traversalSources` entry will automatically
44- get a `TraversalSource` binding. A graph named `graph` is bound to `g`; all others are bound to `g_<name>`.
48+ ===== Simplified Server Configuration
4549
46- A minimal server configuration is now:
50+ The most basic server setup, initializing a basic graph with a traversal source, previously required a Groovy init
51+ script just to create the `g` binding. Now, any graph defined in the `graphs` section automatically gets a
52+ `TraversalSource` according to these rules:
53+
54+ * A graph named `graph` is implicitly bound to `g`
55+ * All others are bound to `g_<graph-name>` (e.g. `modern` gets `g_modern`)
56+
57+ A fully functional minimal configuration is now simply:
4758
4859[source,yaml]
4960----
5061graphs: {
5162 graph: conf/tinkergraph-empty.properties}
5263----
5364
54- This automatically creates a `g` binding — no init script needed.
55-
56- ===== Declarative `traversalSources`
65+ ===== Strategy Configuration via `traversalSources`
5766
58- A new `traversalSources` YAML section allows explicit `TraversalSource` creation with optional strategy configuration:
67+ For cases that require custom traversalSource naming or strategies on a `TraversalSource` (e.g. `ReadOnlyStrategy`), the
68+ `traversalSources` YAML section provides explicit control without scripting:
5969
6070[source,yaml]
6171----
@@ -66,14 +76,18 @@ traversalSources: {
6676
6777Each entry specifies:
6878
69- - `graph` (required) — references a key in the `graphs` section
70- - `gremlinExpression` (optional) — a Gremlin expression evaluated with a base traversal source bound as `g`
71- - `language` (optional) — which script engine to use for the expression (defaults to `gremlin-lang`, or the sole
79+ - `graph` (required): references a key in the `graphs` section
80+ - `gremlinExpression` (optional): a Gremlin expression evaluated with a base traversal source bound as `g`
81+ - `language` (optional): which script engine to use for the expression (defaults to `gremlin-lang`, or the sole
7282 configured engine if only one is present)
7383
74- ===== Java-Based `lifecycleHooks`
84+ Graphs with explicit `traversalSources` entries are excluded from the implicitly defined traversal sources described in
85+ the previous section.
7586
76- A new `lifecycleHooks` YAML section replaces Groovy-based `LifeCycleHook` creation:
87+ ===== Java-Based Lifecycle Hooks
88+
89+ For startup and shutdown logic that goes beyond declarative configuration such as loading sample data, initializing
90+ caches, or custom setup, Java-based `LifeCycleHook` implementations can now replace Groovy init scripts:
7791
7892[source,yaml]
7993----
@@ -83,16 +97,14 @@ lifecycleHooks:
8397----
8498
8599Each entry specifies a `className` implementing `LifeCycleHook` and an optional `config` map passed to the hook's
86- `init()` method. The built-in `TinkerFactoryDataLoader` supports datasets: `modern `, `classic `, `crew `, `grateful `,
87- `sink `, and `airroutes `.
100+ `init()` method. The built-in `TinkerFactoryDataLoader` supports datasets: `airroutes `, `modern `, `classic `, `crew `,
101+ `grateful `, and `sink `.
88102
89- ===== Deprecation of Groovy Init Scripts
103+ ===== Migrating from Groovy Init Scripts
90104
91105Creating `TraversalSource` and `LifeCycleHook` instances via Groovy init scripts is now deprecated. Existing scripts
92- continue to work, but a deprecation warning is logged at startup. Migrate to the YAML-based configuration described
93- above.
94-
95- ===== Migration Examples
106+ continue to work when `GremlinGroovyScriptEngine` is explicitly configured, but a deprecation warning is logged at
107+ startup. Support for Groovy script initialization and customization may be dropped in a future release.
96108
97109*Before (Groovy init script):*
98110
@@ -117,7 +129,7 @@ lifecycleHooks:
117129 - { className: org.apache.tinkerpop.gremlin.server.util.TinkerFactoryDataLoader, config: {graph: graph, dataset: modern}}
118130----
119131
120- The `g` binding is auto- created from the `graph` entry. No `scriptEngines` section is needed.
132+ The `g` binding is implicitly created from the `graph` entry. No `scriptEngines` section is needed.
121133
122134== TinkerPop 4.0.0-beta.2
123135
0 commit comments