imbajin opened a new pull request, #3289:
URL: https://github.com/apache/hugegraph/pull/3289

   ## Purpose of the PR
   
   Cypher POST previously accepted only raw query text, missing parameters 
could silently become null,
   and a failed write could leave changes visible after later reads. This 
change accepts validated JSON
   bindings and rolls back traversal failures on the thread that owns the 
transaction.
   
   This is a standalone change on current Apache master, which now includes the 
Java 17 / TinkerPop 3.8.1
   upgrade. The translator remains `translation:1.0.4`. Related organization PR:
   https://github.com/hugegraph/hugegraph/pull/238. Paired website 
documentation:
   https://github.com/apache/hugegraph-doc/pull/499; coordinate its merge with 
this change.
   
   ## Main Changes
   
   - Preserve GET and legacy raw POST under `application/json`; accept
     `{ "cypher": "RETURN $name AS name", "parameters": { "name": "marko" } }`.
     Reject malformed/non-object JSON and unsupported `text/plain` requests.
   - Keep values separate from query text, reject missing bindings and the 
translator's reserved null
     marker, and retain binding type/count validation. Real null and parameter 
names such as `id` remain valid.
   - Commit before the terminal success response; roll back and close the 
traversal on its execution
     thread after failures, including Java errors, and send a terminal failure 
response.
   - Preserve the merged REST client's native charset handling while 
recognizing JSON media types with
     charset parameters. Release Gremlin HTTP requests exactly once on success 
and error paths.
   
   ```text
   query + parameters -> validation -> traversal worker
                                      success: commit -> response
                                      failure: rollback -> error response
   ```
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [ ] Already covered by existing tests.
   - [x] Need tests and can be verified as follows:
     - Java 17, TinkerPop 3.8.1, translator 1.0.4, and a live RocksDB-backed 
Server.
     - Cypher request, binding, regex, routing and write/rollback regression 
tests, including native readback.
     - Real-executor fatal-error response/rollback tests; Gremlin HTTP request 
ownership and auth-context tests.
     - REST JSON/map charset tests with UTF-8/UTF-16, gzip and an ASCII-default 
JVM.
     - Related Gremlin and Login API regressions, formatting, root clean 
compile and reactor installation.
   
   All selected regressions, formatting, root clean compile and installation 
passed. Gremlin API retained
   one existing non-shared-backend skip; Cypher tests had no skips. Advanced 
Cypher constructs, HStore, Bolt,
   cross-request transactions and performance remain outside the verified 
scope. The compatibility note
   also records the translator's reserved null-marker limitation for literals 
and stored properties.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ] Dependencies
   - [ ] Modify configurations
   - [x] The public API
   - [ ] Other affects
   - [ ] Nope
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`: required documentation is pending; complete it before 
merging.
   - [x] `Doc - Done`: documentation is included here or linked below.
   - [ ] `Doc - No Need`: no user-visible documentation is affected.
   
   Repository documentation: `docs/cypher-compatibility.md`, the Server README, 
Commons README and
   `docs/upgrade-tinkerpop-3.8.md`. Paired website PR: 
https://github.com/apache/hugegraph-doc/pull/499.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to