Skip to content

fix(loader): accept response file arguments - #61

Closed
imbajin wants to merge 1 commit into
masterfrom
fix/loader-response-file-arguments
Closed

imbajin wants to merge 1 commit into
masterfrom
fix/loader-response-file-arguments

Conversation

@imbajin

@imbajin imbajin commented Oct 11, 2026 •

Copy link
Copy Markdown

Purpose of the PR

Loader expands a valid @loader.args file, then rejects it because the original process argument count is less than three. The parser now relies on the required mapping option and existing validators, accepting response files and minimal commands using defaults while invalid inputs still fail. Related to the acceptance discussion.

Main Changes

Remove the raw argument-count check. Add separate-process regressions for response files, spaced filenames, defaults, and invalid inputs. Document argument-file syntax and the writable mapping directory needed for progress output in Kubernetes.

Verifying these changes

  • Need tests: complete Loader unit profile, Checkstyle, and EditorConfig checks passed with the locked Java 17 candidate SDK.

Does this PR potentially affect the following parts?

  • Other affects: Loader CLI argument validation.

Documentation Status

  • Doc - Done: Loader README updated.

Summary by CodeRabbit

  • 新功能
    • Loader 支持通过 @loader.args 从参数文件读取启动选项及其值。文件中的路径相对于工作目录解析;含凭据的文件应限制为仅所有者可读写,映射目录则需可写。
  • 修复
    • 调整命令行参数校验:仅提供映射文件时,不再因参数数量不足而失败,可使用默认 graph 和 host;缺少必需参数或端口无效时仍会报错。

Paired website documentation: ASF #518. The same code branch is submitted in ASF toolchain #808. Coordinate the code and website merges.

- rely on required options and validators after expansion
- cover response files, defaults, and invalid parser input
- document private argument files and writable mappings
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

Loader 选项解析不再要求至少三个命令行参数。测试新增默认值、响应文件解析和错误场景覆盖。README 新增参数文件用法及相关注意事项。

Changes

Loader 参数解析

Layer / File(s) Summary
选项解析与参数文件说明
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java, hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/unit/LoadOptionsTest.java, hugegraph-loader/README.md
移除命令行参数数量下限检查,保留后续选项校验。测试覆盖默认 graph 和 host、响应文件选项解析、缺少必需选项和非法端口等失败场景,并按预期判断用法输出。README 增加参数文件示例,并说明路径解析、凭据文件权限和映射目录可写要求。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4ea17

No actionable issue is established that needs to block merging after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题准确概括了主要变更:Loader 支持响应文件参数。标题简洁、明确,并与代码、测试和文档变更一致。

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR




🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

小兔捧着参数清单,
一行一项排得整齐。
默认图名轻轻填上,
响应文件传来新意。
检查错误也有记录,
跳过草丛,欢快前行。

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T23:30:26.141056Z 4ea1757 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔇 Additional comments (5)
hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/unit/LoadOptionsTest.java (4)

59-61: LGTM!


63-75: LGTM!


116-137: LGTM!


77-114: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

临时文件创建在当前工作目录,且 File.createTempFile 默认不限制权限。

createTempFile(..., new File(".")) 会在工作目录创建文件。如果测试在 finally 之前被强制终止,会在源码目录留下残留文件。测试使用的是非敏感内容,权限风险很低。可以改用 java.nio.file.Files.createTempFile,或使用 JUnit 的 TemporaryFolder。这样文件会放在系统临时目录并自动清理。此项为可选改进。

Source: Linters/SAST tools

hugegraph-loader/README.md (1)

112-131: LGTM!


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 97350ab6-fe28-43e4-91cf-3ccb3cb162fe
📥 Commits

Reviewing files that changed from the base of the PR and between 039153c and 4ea1757.

📒 Files selected for processing (3)
  • hugegraph-loader/README.md
  • hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java
  • hugegraph-loader/src/test/java/org/apache/hugegraph/loader/test/unit/LoadOptionsTest.java
💤 Files with no reviewable changes (1)
  • hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.75%. Comparing base (039153c) to head (4ea1757).

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #61      +/-   ##
============================================
- Coverage     46.97%   44.75%   -2.23%     
+ Complexity     4509     3323    -1186     
============================================
  Files           602      377     -225     
  Lines         29432    22484    -6948     
  Branches       3454     3005     -449     
============================================
- Hits          13825    10062    -3763     
+ Misses        14321    11351    -2970     
+ Partials       1286     1071     -215     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant