imbajin opened a new pull request, #3259:
URL: https://github.com/apache/hugegraph/pull/3259
## Purpose of the PR
HG-19 follow-up to #3241, within #3242. The proposed top-level `errors`
field makes existing Java clients reject even successful Cypher responses. Move
the metadata into `status.attributes.errors` while preserving the existing
envelope, status and message. Recognize actual translation-1.0.4 parser
failures as `HugeGraph.Cypher.SyntaxError` and remove the unavailable
parameter-binding hint/code.
This branch preserves Nguyen Quang Minh's original commit
`ed8344d19ab303a46cb4e9fdb67340815c37e1c4` as its parent. **Depends on #3241**:
the PR targets Apache `master` because the source PR is in another
contributor's fork; until #3241 lands, GitHub includes its original commit in
this comparison. The repair-only diff is
`ed8344d19ab303a46cb4e9fdb67340815c37e1c4..HEAD`. Please coordinate integration
of both PRs; this does not supersede or overwrite the original contribution.
## Main Changes
- Keep only `requestId`, `status` and `result` at the top level. Put the
existing structured error list in the client-compatible attributes map on
failure.
- Classify invalid input, unknown functions and statement-count errors;
limit the variable hint to actual undefined-variable messages, and keep
undefined index labels in execution errors.
- Add real-parser/envelope unit tests, exact API code/hint assertions and a
standalone actual-Java-Client compatibility test without introducing a
Server-to-Client dependency cycle.
- Document request limits, response schema, complete codes/hints and
reproducible client checks in `docs/cypher-api.md`.
## Verifying these changes
- [x] Need tests and can be verified as follows:
- Java 11.0.29 / Maven 3.9.11: full `mvn clean compile
-Dmaven.javadoc.skip=true` passes; `mvn editorconfig:format` and `git diff
--check` pass.
- `mvn test -pl hugegraph-server/hugegraph-test -am -P unit-test
-Dtest=CypherErrorTest -Dsurefire.failIfNoSpecifiedTests=false`: 8 tests, 0
failures/errors/skips. Original head: 6 of the 8 regression tests fail.
- Standalone `CypherClientCompatibilityTest` using real
`RestResult.readObject(Response.class)`: 4/4 pass with each locally available
Client 1.7.0 and development 1.8.0 jar. Original head fails both
current-success and current-failure deserialization for each jar; legacy
fixtures and the top-level-errors negative control pass. Commands are in the
API doc.
- Actual parser probes cover malformed MATCH, misspelled RETURN, multiple
statements, unknown `date()`, and undefined variables. Unbound `$name` still
translates to Cypher null.
Limitations: live `CypherApiTest` and Hubble UI were not run; Hubble's
`QueryService.executeCypher` -> Client `CypherManager` -> `CypherAPI` ->
`RestResult` path was traced at Toolchain
`3b385c3d2f1c04f7fa4b4534b4b1ec220627bfb5`. No cluster, live-data or
matching-RC acceptance was performed. Independent repair verification remains
with the originating reviewer through HG-17.
## Does this PR potentially affect the following parts?
- [ ] Dependencies
- [ ] Modify configurations
- [x] The public API
- [ ] Other affects
- [ ] Nope
## Documentation Status
- [x] `Doc - TODO`: repository documentation is complete; paired website
alignment remains with its author before coordinated publication.
- [ ] `Doc - Done`
- [ ] `Doc - No Need`
Repository: `docs/cypher-api.md`. Paired website:
https://github.com/apache/hugegraph-doc/pull/499 at
`6f52040de2b7613690fb6cc50aafd6aa7af031a2`, left untouched. The optional
bound-query fork https://github.com/hugegraph/hugegraph/pull/238 and TinkerPop
migration are outside this repair.
--
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]