Skip to content

Optimize dynamic creation of diagram documents#444

Merged
imbajin merged 12 commits intoapache:masterfrom
Tsukilc:fix-doc
Jan 21, 2026
Merged

Optimize dynamic creation of diagram documents#444
imbajin merged 12 commits intoapache:masterfrom
Tsukilc:fix-doc

Conversation

@Tsukilc
Copy link
Contributor

@Tsukilc Tsukilc commented Jan 19, 2026

Optimize dynamic creation of diagram documents

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 19, 2026
@Tsukilc Tsukilc changed the title fix: fix graphs.md Optimize dynamic creation of diagram documents Jan 19, 2026
@dosubot dosubot bot added the bug Something isn't working label Jan 19, 2026
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jan 19, 2026
@imbajin imbajin requested a review from Copilot January 19, 2026 12:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request optimizes documentation for HugeGraph by adding configuration examples, clarifying setup instructions, and improving consistency across API documentation.

Changes:

  • Added PD (Placement Driver) configuration examples with authentication support for both English and Chinese HugeGraph server documentation
  • Updated REST API graph operation examples to use more consistent naming (e.g., cloneGraph instead of hugegraph_clone)
  • Added important notes about version-specific requirements for hstore backend configuration

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
content/en/docs/quickstart/hugegraph/hugegraph-server.md Added PD configuration example with authentication and pd.peers settings for multi-node setup
content/en/docs/clients/restful-api/graphs.md Updated graph naming examples, improved formatting, and added version-specific configuration note
content/cn/docs/quickstart/hugegraph/hugegraph-server.md Chinese version of PD configuration changes with authentication examples
content/cn/docs/clients/restful-api/graphs.md Chinese version of REST API documentation updates with consistent graph naming

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Create a non-auth graph (set `Content-Type: application/json`)
**Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in
the request body
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‼️ Critical Issue - Missing hstore complete example

The new note at line 170 mentions that hstore backend requires task.scheduler_type: distributed for version 1.7.0 and earlier, but there is no complete example showing this configuration in the "Create graph" section.

Suggestion:
Add a complete hstore example in section 6.1.5 to help users understand the full configuration:

{
  "gremlin.graph": "org.apache.hugegraph.HugeFactory",
  "backend": "hstore",
  "serializer": "binary",
  "store": "hugegraph2",
  "task.scheduler_type": "distributed",
  "pd.peers": "127.0.0.1:8686"
}

This would make the documentation much more user-friendly for new hstore users.

##### Request Body

创建一个非鉴权模式的图(设置 `Content-Type: application/json`)
**注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‼️ Critical Issue - Missing hstore complete example (CN version)

第 170 行提到 hstore 后端在 1.7.0 及之前版本需要 task.scheduler_type: distributed,但在「创建图」章节没有提供完整的 hstore 示例。

建议:
在 6.1.5 节添加完整的 hstore 示例,帮助用户理解完整配置:

{
  "gremlin.graph": "org.apache.hugegraph.HugeFactory",
  "backend": "hstore",
  "serializer": "binary",
  "store": "hugegraph2",
  "task.scheduler_type": "distributed",
  "pd.peers": "127.0.0.1:8686"
}

这样对想使用 hstore 后端的新用户会更友好。

```

```properties
# Full example (with authentication)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Important - Missing task.scheduler_type in English version

Same issue as the Chinese version - the simplified example starting at line 220 is missing task.scheduler_type=distributed which is required for hstore backend (as noted in graphs.md:171).

Suggestion:
Add to the configuration example:

task.scheduler_type=distributed

##### Request Body

创建一个非鉴权模式的图(设置 `Content-Type: application/json`)
**注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Minor - Consider adding cross-reference link

For better user experience, consider adding a link to the hugegraph-server.md configuration guide here, since users dynamically creating hstore graphs via API also need to configure the server properly first.

Suggestion:

**注意**!!1.7.0 及之前,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时需要确保 HugeGraph-Server 已正确配置 PD,详见[配置 HStore](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储-hstore)


Create a non-auth graph (set `Content-Type: application/json`)
**Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in
the request body
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Minor - Consider adding cross-reference link (EN)

For better user experience, consider adding a link to the hugegraph-server.md configuration guide.

Suggestion:

**Note**!! For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore)

store=hugegraph

# pd config
pd.peers=127.0.0.1:8686
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Minor - Missing pd.peers explanation in simplified example

The comment says "pd config" but doesn't explain what pd.peers is or how to configure it for different scenarios (single PD vs multiple PD nodes).

Suggestion:

# PD 配置(必须)- 配置 PD 服务的地址和 RPC 端口
# 单个 PD 节点时配置一个地址,多个 PD 节点时用逗号分隔
pd.peers=127.0.0.1:8686

Tsukilc and others added 5 commits January 19, 2026 20:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 19, 2026
@imbajin imbajin requested a review from Copilot January 20, 2026 08:26
}
```

**HStore 示例:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ HStore 示例标题不够明确

第 190 行的标题 "HStore 示例:" 缺少版本和模式说明,用户无法清楚知道这个示例适用于什么场景。

建议修改:

Suggested change
**HStore 示例:**
**HStore 示例(非鉴权模式 - 仅适用于 1.7.0 及之前版本)**

或者,如果要提供 1.7.0+ 的示例,应该使用:

Suggested change
**HStore 示例:**
**HStore 示例(鉴权模式 - 适用于 1.7.0+)**
\`\`\`json
{
"gremlin.graph": "org.apache.hugegraph.auth.HugeFactoryAuthProxy",
"backend": "hstore",
"serializer": "binary",
"store": "hugegraph2",
"task.scheduler_type": "distributed",
"pd.peers": "127.0.0.1:8686"
}
\`\`\`

```

> Note:
**HStore Example (for version 1.7.0 and earlier):**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 英文版 HStore 示例标题需要补充版本说明

与中文版类似,英文版的 HStore 示例也需要明确版本适用范围。

建议修改:

Suggested change
**HStore Example (for version 1.7.0 and earlier):**
**HStore Example (for version 1.7.0 and earlier - non-auth mode):**

或提供 1.7.0+ 版本的示例(建议同时提供两个版本的示例)。

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
```

**HStore 示例:**
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Chinese HStore example section title is missing version information for consistency with the English version. The English version says "HStore Example (for version 1.7.0 and earlier):" while the Chinese version only says "HStore 示例:". Consider adding version information like "HStore 示例(1.7.0 及之前):" to match the English documentation.

Suggested change
**HStore 示例:**
**HStore 示例(1.7.0 及之前)**

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码层面默认不携带 http:// 前缀, 作为默认 prefix_scheme

当用户自己指定 https 或其他 scheme 再覆盖

doc 之后统一为 ip+port 默认值

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


**注意**!!
1. 在 1.7.0 版本中,动态创建图会导致 NPE 错误。该问题已在 [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912) 中修复。当前 master 版本和 1.7.0 之前的版本不受此问题影响。
2. 1.7.0 及之前版本,如果 backend 是 hstore,必须在请求体加上 "task.scheduler_type": "distributed"。同时请确保 HugeGraph-Server 已正确配置 PD,参见 [HStore 配置](/cn/docs/quickstart/hugegraph/hugegraph-server/#511-分布式存储hstore)。
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note mentions "1.7.0 及之前版本" (version 1.7.0 and earlier) but the first point says "在 1.7.0 版本中" (in version 1.7.0) the issue exists and "1.7.0 之前的版本不受此问题影响" (versions before 1.7.0 are not affected). This creates confusion about whether version 1.7.0 itself has the issue. If only 1.7.0 has the issue, then point 2 should say "1.7.0 版本" not "1.7.0 及之前版本".

Copilot uses AI. Check for mistakes.

**Note**!!
1. In version 1.7.0, dynamic graph creation would cause a NPE. This issue has been fixed in [PR#2912](https://github.com/apache/incubator-hugegraph/pull/2912). The current master version and versions after 1.7.0 do not have this problem.
2. For version 1.7.0 and earlier, if the backend is hstore, you must add "task.scheduler_type": "distributed" in the request body. Also ensure HugeGraph-Server is properly configured with PD, see [HStore Configuration](/docs/quickstart/hugegraph/hugegraph-server/#511-distributed-storage-hstore).
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note mentions "For version 1.7.0 and earlier" but point 1 states that the NPE issue exists in version 1.7.0 and that "versions after 1.7.0 do not have this problem." This creates confusion about whether versions before 1.7.0 also need the workaround. If only 1.7.0 has the issue, then this should say "For version 1.7.0" not "For version 1.7.0 and earlier".

Copilot uses AI. Check for mistakes.
```properties
usePD=true

# 若需要 auth
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "若需要 auth" (if auth is needed) but should be more specific. The English version says "If auth is needed" which is also vague. Both should clarify when authentication is actually needed or recommended, matching the context from the examples which use auth mode by default.

Suggested change
# 若需要 auth
# 在生产环境或需要访问控制/多租户隔离时,建议启用鉴权功能,可取消注释并配置如下:

Copilot uses AI. Check for mistakes.
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 21, 2026
@imbajin imbajin merged commit 515fb75 into apache:master Jan 21, 2026
1 check passed
github-actions bot pushed a commit that referenced this pull request Jan 21, 2026
* fix: fix graphs.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> 515fb75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants