feat(client): add support for skipping required checks in HugeClientBuilder#718
Open
FrostyHec wants to merge 3 commits intoapache:masterfrom
Open
feat(client): add support for skipping required checks in HugeClientBuilder#718FrostyHec wants to merge 3 commits intoapache:masterfrom
FrostyHec wants to merge 3 commits intoapache:masterfrom
Conversation
Member
There was a problem hiding this comment.
Pull request overview
This PR adds an opt-in flag to HugeClientBuilder/HugeClient.builder(...) to bypass required url/graph argument validation, enabling more flexible client initialization flows (e.g., deferring configuration until later).
Changes:
- Added
skipRequiredCheckstoHugeClientBuilder(new constructor overload + conditional validation in ctor/build). - Added a new
HugeClient.builder(..., boolean skipRequiredChecks)overload. - Added a new unit test class covering skip vs non-skip behavior; minor formatting update in
User.UserRole.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| hugegraph-client/src/test/java/org/apache/hugegraph/unit/HugeClientBuilderTest.java | Adds tests for the new skipRequiredChecks behavior (but currently has some issues around determinism/coverage). |
| hugegraph-client/src/main/java/org/apache/hugegraph/structure/auth/User.java | Wraps a long generic type declaration for line-length; introduces trailing whitespace. |
| hugegraph-client/src/main/java/org/apache/hugegraph/driver/HugeClientBuilder.java | Introduces skipRequiredChecks flag and conditionally skips required argument validation. |
| hugegraph-client/src/main/java/org/apache/hugegraph/driver/HugeClient.java | Adds a new public builder overload exposing skipRequiredChecks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Purpose of the PR
Due to the logic upgrade of the HugeGraph server, certain operations (such as authentication) no longer require a specific
graphspacesorgraph. However, some interfaces inHugeClientare currently incompatible and still necessitate these parameters during connection initialization. Therefore, an adaptation upgrade is required. Here, a backward-compatible upgrade solution was selected.This pull request introduces a new option to bypass required argument checks when building a
HugeClientBuilder, allowing for more flexible client initialization. The main changes include updating constructors and builder methods to support theskipRequiredChecksflag, modifying validation logic, and adding unit tests to verify this new behavior.Main Changes
Enhancements to client builder flexibility:
skipRequiredChecksboolean parameter to theHugeClientBuilderconstructor and the correspondingHugeClient.builderstatic method, allowing users to bypass mandatory checks forurlandgrapharguments when needed.build()method ofHugeClientBuilderto conditionally skip argument checks based on theskipRequiredChecksflag.Testing:
HugeClientBuilderTestwith tests to ensure that the builder behaves correctly with and without theskipRequiredChecksflag, including cases where required arguments are missing.Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need