Repository navigation
Document[Go-develop]: update Go development docs - #16229
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughTwo sections of ChangesCLI Docs: SEARCH → RETRIEVE and dataset search documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 markdownlint-cli2 (0.22.1)internal/development.mdmarkdownlint-cli2 v0.22.1 (markdownlint v0.40.0) 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
internal/cli/user_parser_test.go (1)
147-180: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd a lowercase
search ... on datasets ...retrieve-path test.Given this PR’s stated fix scope, add an explicit lowercase retrieve-case assertion to prevent regressions (
search 'AI' on datasets 'test2'should map tosearch_on_datasets).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/cli/user_parser_test.go` around lines 147 - 180, Add a new test function after TestParseSearchOnDatasetsCommand to test the lowercase variant of the search on datasets command. The test should create a Parser with the lowercase input string "search 'AI' on datasets 'test2'", call Parse with APIMode, and then assert that cmd.Type equals "search_on_datasets" and that the question and datasets parameters are correctly extracted as "AI" and "test2" respectively. This ensures that both uppercase and lowercase syntax variants are properly handled and prevents regressions in the parser's handling of lowercase retrieve-path commands.internal/cli/parser.go (1)
302-309: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winConstrain
ON DATASETSdetection to the retrieve-clause position.The helper currently matches any adjacent
ON DATASETSpair in the raw input, which can misroute ambiguous filesystemsearchstrings. Consider anchoring detection to the expected retrieve shape (after search question parsing) rather than scanning all fields.Suggested direction
-func isSearchOnDatasetsCommand(input string) bool { - fields := strings.Fields(strings.ToUpper(input)) - for i := 0; i+1 < len(fields); i++ { - if fields[i] == "ON" && fields[i+1] == "DATASETS" { - return true - } - } - return false -} +func isSearchOnDatasetsCommand(input string) bool { + fields := strings.Fields(strings.ToUpper(input)) + if len(fields) < 4 || fields[0] != "SEARCH" { + return false + } + // Require ON DATASETS to appear as clause boundary after the question segment. + for i := 2; i+1 < len(fields); i++ { + if fields[i] == "ON" && fields[i+1] == "DATASETS" { + return true + } + } + return false +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/cli/parser.go` around lines 302 - 309, The isSearchOnDatasetsCommand function currently scans the entire input string for any adjacent ON DATASETS pair, which can incorrectly match these keywords when they appear in filesystem search strings. Instead of searching through all fields in the raw input, constrain the ON DATASETS detection to the expected retrieve-clause position by anchoring it after the search question has been parsed. This means checking for ON DATASETS at a specific expected position in the parsed command structure rather than performing a full-field scan of the raw input string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/cli/parser.go`:
- Around line 302-309: The isSearchOnDatasetsCommand function currently scans
the entire input string for any adjacent ON DATASETS pair, which can incorrectly
match these keywords when they appear in filesystem search strings. Instead of
searching through all fields in the raw input, constrain the ON DATASETS
detection to the expected retrieve-clause position by anchoring it after the
search question has been parsed. This means checking for ON DATASETS at a
specific expected position in the parsed command structure rather than
performing a full-field scan of the raw input string.
In `@internal/cli/user_parser_test.go`:
- Around line 147-180: Add a new test function after
TestParseSearchOnDatasetsCommand to test the lowercase variant of the search on
datasets command. The test should create a Parser with the lowercase input
string "search 'AI' on datasets 'test2'", call Parse with APIMode, and then
assert that cmd.Type equals "search_on_datasets" and that the question and
datasets parameters are correctly extracted as "AI" and "test2" respectively.
This ensures that both uppercase and lowercase syntax variants are properly
handled and prevents regressions in the parser's handling of lowercase
retrieve-path commands.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8e2e1a43-327c-44ba-bd57-1ab20a41eb2f
📒 Files selected for processing (2)
internal/cli/parser.gointernal/cli/user_parser_test.go
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/development.md`:
- Line 476: The SEARCH to RETRIEVE command rename has been applied to
internal/development.md but the same command examples in other documentation
files (internal/cli/README.md and admin/client/COMMAND.md) still reference the
old SEARCH command. Update all SEARCH command examples to RETRIEVE in the
internal/cli/README.md and admin/client/COMMAND.md files to maintain consistency
across the entire documentation set, ensuring the rename is uniformly applied
throughout the codebase.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7427baf5-c3f1-453b-867b-dfd3983d193a
📒 Files selected for processing (1)
internal/development.md
| - Search chunks | ||
| ``` | ||
| RAGFlow(api/default)> SEARCH 'AI' ON DATASETS 'test' | ||
| RAGFlow(api/default)> RETRIEVE 'AI' ON DATASETS 'test' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that no SEARCH command examples remain in the documentation
# Search for remaining SEARCH command examples (case-insensitive)
echo "=== Checking for remaining SEARCH command examples ==="
rg -n "SEARCH\s+" --type md
echo ""
echo "=== Checking for remaining 'Search' command examples in CLI contexts ==="
rg -n "RAGFlow.*>\s*(Search|search)" --type mdRepository: infiniflow/ragflow
Length of output: 732
Verify whether other documentation files should be updated as part of this rename.
The SEARCH→RETRIEVE rename is consistently applied within internal/development.md (lines 476–552). However, verification reveals that other documentation files still contain SEARCH command examples:
internal/cli/README.md(lines 106–108)admin/client/COMMAND.md(lines 664, 673)
If this PR intends to rename the command across the entire codebase, these files should also be updated. Clarify whether updating these files is within scope for this PR.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@internal/development.md` at line 476, The SEARCH to RETRIEVE command rename
has been applied to internal/development.md but the same command examples in
other documentation files (internal/cli/README.md and admin/client/COMMAND.md)
still reference the old SEARCH command. Update all SEARCH command examples to
RETRIEVE in the internal/cli/README.md and admin/client/COMMAND.md files to
maintain consistency across the entire documentation set, ensuring the rename is
uniformly applied throughout the codebase.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/development.md (1)
523-553:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winClean up the markdownlint violations in this section.
Both CLI example fences are missing a language tag, and the note list has extra spaces after
>. Adding a fence language such astextand normalizing the blockquote spacing will keep the doc lint-clean and render more predictably.Suggested edit
-``` +```text @@ -> - `search` is the simple filesystem search command and only accepts `query [path] [-n number]`. -> - `RETRIEVE` / `SEARCH ... ON DATASETS ...` is the SQL-like search command and supports full `WITH` option expansion. -> - `WITH` options include: `top_k`, `page_size`, `page`, `similarity_threshold`, `vector_similarity_weight`, `keyword`, `use_kg`, `rerank_id`, `search_id`, `cross_languages`, `doc_ids`, and `meta_data_filter`. +> - `search` is the simple filesystem search command and only accepts `query [path] [-n number]`. +> - `RETRIEVE` / `SEARCH ... ON DATASETS ...` is the SQL-like search command and supports full `WITH` option expansion. +> - `WITH` options include: `top_k`, `page_size`, `page`, `similarity_threshold`, `vector_similarity_weight`, `keyword`, `use_kg`, `rerank_id`, `search_id`, `cross_languages`, `doc_ids`, and `meta_data_filter`. @@ -``` +```textAlso applies to: 556-573
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/development.md` around lines 523 - 553, The markdown code fences containing RETRIEVE command examples are missing a language tag specification, and the blockquote lines starting with `>` have inconsistent spacing with extra spaces after the blockquote marker. Add the language tag `text` to both code fence opening markers (```text) before the RETRIEVE examples and after the closing fence. For the blockquote lines that list search command descriptions and WITH options, ensure each line uses exactly one space after the `>` marker (change `-> ` pattern to `> `) to maintain consistent blockquote formatting throughout the section.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@internal/development.md`:
- Around line 523-553: The markdown code fences containing RETRIEVE command
examples are missing a language tag specification, and the blockquote lines
starting with `>` have inconsistent spacing with extra spaces after the
blockquote marker. Add the language tag `text` to both code fence opening
markers (```text) before the RETRIEVE examples and after the closing fence. For
the blockquote lines that list search command descriptions and WITH options,
ensure each line uses exactly one space after the `>` marker (change `-> `
pattern to `> `) to maintain consistent blockquote formatting throughout the
section.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4f10056d-846c-425b-bf6f-39e44ac71539
📒 Files selected for processing (1)
internal/development.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16229 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
As title
Document updated:
Type of change