Skip to content

fix(client): prepare legacy graph compatibility - #776

Merged
imbajin merged 14 commits into
apache:masterfrom
hugegraph:java17-client-prep
Oct 5, 2026
Merged

imbajin merged 14 commits into
apache:masterfrom
hugegraph:java17-client-prep

Conversation

@imbajin

@imbajin imbajin commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Purpose of the PR

Legacy servers return graph configuration as JSON text, while newer APIs use Properties. Normalize that configuration for create/clone requests so the Client retains Server 1.5 compatibility. A legacy clone without configuration now sends an empty entity instead of the literal text null.

Legacy graph configuration compatibility

Original preparation and review: hugegraph#41.

Depends on #775. Merge the shared build preparation first. This PR targets master and currently includes prerequisite changes; after the prerequisite lands, rebase this same organization branch onto the updated upstream base and revalidate the module diff before merging.

Main Changes

  • Convert supported legacy configuration values and reject null or nested values explicitly.
  • Preserve create/clone request encoding and verify the real legacy HTTP route and empty clone body.
  • Update task/target tests for their current cancellation and URL contracts.
  • Retain the existing bytecode baseline and runtime dependency versions.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage.
  • Already covered by Client unit tests and Checkstyle.
  • Need tests and can be verified as follows:
    • JDK 11 preparation validation used hash-verified released dependencies.
    • The latest graph configuration/request regressions passed on native Java 17, including a real loopback HTTP request.
    • Current-head organization CI is still running/queued; upstream checks will run separately.

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (build/test tooling only; runtime payload is unchanged by this preparation)
  • Modify configurations (CI/test configuration)
  • The public API (compatible behavior; signatures unchanged)
  • Other affects: tests and validation tooling

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

- manage compiler, surefire and coverage plugin versions
- keep Java 8 output and use compatible Mockito 4
- resolve optional server repositories, refs and pins
- verify checkout and package servers without install
- share authenticated startup and filter AppleDouble files
- connect repository and fetch refs to all server installers
- reuse the shared installer for Tools and Spark validation
- preserve Loader source caching with verified checkouts
- isolate fixture builds and retain separate HTTPS RPC ports
- preserve Mockito 2 interaction assertions with the equivalent API
- align test-only Byte Buddy dependencies with Mockito 4
- retain the Spring Boot 2 and Java 11 shared baseline
- run shared server selection and installer tests in one CI job
- document Maven 3.6.3 as the minimum source build version
- report missing or ambiguous server archives before exiting
- trigger push checks for client installer changes
- trigger pull request checks for the same source path
- cover the installer exercised by the existing contracts
- encode legacy graph configuration as properties
- keep task and target tests aligned with server contracts
- inherit shared compiler and coverage plugin versions
- preserve Java 8 APIs in compatibility tests
- Give each HTTPS test its own client and clean it up only when opened.
- Clear the client even when closing fails so teardown cannot reuse it.
- Prepare the pinned official trust store once per class and verify downloads.
- Compile and probe negative builder lifecycle on JDK 11 and 17 without server writes.
- encode absent legacy clone config as empty text
- verify the actual HTTP request body and route
- cover rejected null and nested config values
@github-actions github-actions Bot added hubble hugegraph-hubble loader hugegraph-loader client hugegraph-client tools hugegraph-tools spark labels Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.06%. Comparing base (b066b80) to head (813f155).
⚠️ Report is 246 commits behind head on master.

Files with missing lines Patch % Lines
...ava/org/apache/hugegraph/api/graphs/GraphsAPI.java 87.87% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master     #776       +/-   ##
=============================================
- Coverage     62.49%   46.06%   -16.44%     
- Complexity     1903     4402     +2499     
=============================================
  Files           262      602      +340     
  Lines          9541    29394    +19853     
  Branches        886     3442     +2556     
=============================================
+ Hits           5963    13539     +7576     
- Misses         3190    14551    +11361     
- Partials        388     1304      +916     

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

- close the loopback request stream after reading
- retain HTTP body and route assertions
- verify the existing client unit suite
- Keep one active run per workflow and PR
- Preserve push and manual workflow executions
- Cover CI workflows on this PR target branch
- group labeler runs by PR and event
- cancel older metadata updates for the same PR
- preserve independent workflow runs
- retain standard property escaping for legacy servers
- encode spaces without Commons parser trimming
- verify leading trailing and all-space string values
- keep empty clone and scalar validation behavior

@bitflicker64 bitflicker64 left a comment

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.

Blocking: yes. Summary: The JSON-to-properties conversion itself round-trips correctly through the Server 1.5 parser, but it leaves non-ASCII characters raw in a text/plain body with no charset, so on a client JVM whose default charset is not UTF-8 those config values reach the server corrupted. Score 7/10. Evidence: read the full exact-head diff and the 1.5.0 server endpoint (GraphsAPI.create consumes TEXT_PLAIN, GraphManager.cloneGraph skips an empty configText, ConfigUtil.buildConfig uses PropertiesConfiguration.read); ran the PR's encoder against commons-configuration2 2.8.0 for 17 key/value shapes (separators, comment chars, backslashes, spaces, non-ASCII), all round-trip; reproduced the charset loss with String.getBytes() under -Dfile.encoding=windows-1252 on JDK 17, where the server-side UTF-8 decode of jdbc.password=李四é yields jdbc.password=???. All latest-head checks pass except codecov/project, which reflects the stale base.

- encode non-ASCII config characters as Unicode escapes
- retain whitespace and literal backslash semantics
- verify ASCII bodies across three charset encodings
- merge upstream master after shared build preparation
- retain upstream fixture and cache provenance fixes
- preserve client compatibility changes and regressions
@github-actions github-actions Bot removed hubble hugegraph-hubble loader hugegraph-loader tools hugegraph-tools spark labels Oct 5, 2026
@imbajin
imbajin merged commit 9967aa2 into apache:master Oct 5, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client hugegraph-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants