Repository navigation
Docs: Update version references to v0.26.1 in READMEs and docs - #16158
Conversation
📝 WalkthroughWalkthroughVersion bump from v0.26.0 to v0.26.1 across the entire repository: Python package manifests ( ChangesRAGFlow v0.26.0 → v0.26.1 Version Bump
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
eace3c3 to
2ba5fc9
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
setup_test_account.sh (3)
129-139: 💤 Low value
provider_existsfunction is defined but never called.This function appears to be dead code. Either use it (e.g., before calling
add_providerto skip redundant API calls) or remove it to reduce maintenance burden.♻️ Suggestion: Use it for idempotency check
+# In main(), before add_provider calls: + if ! provider_exists "ZHIPU-AI" "$AUTH_TOKEN"; then + add_provider "ZHIPU-AI" "$AUTH_TOKEN" + fiOr remove the function if
add_provideralready handles duplicates gracefully (which it does via the "duplicated|already exist" check).🤖 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 `@setup_test_account.sh` around lines 129 - 139, The provider_exists function is defined but never invoked, making it dead code that should be cleaned up. Since the add_provider function already handles duplicate providers gracefully through its error checking, you should remove the entire provider_exists function definition to eliminate maintenance burden and keep the script focused on actual operations. If in the future idempotency checks are needed before calling add_provider, this function can be re-introduced and called appropriately, but for now it should be deleted.
76-82: ⚡ Quick winAdd curl timeouts to prevent indefinite hangs.
All
curlcalls lack timeout settings. If the server is unresponsive or there are network issues, the script will hang indefinitely. This is particularly problematic in CI/CD pipelines.Add
--connect-timeoutand--max-timeto all curl invocations:♻️ Proposed fix for api_post (apply similarly to other functions)
api_post() { local endpoint="$1" local json_data="$2" - curl -s -X POST "${API_BASE}${endpoint}" \ + curl -s --connect-timeout 10 --max-time 30 -X POST "${API_BASE}${endpoint}" \ -H "Content-Type: application/json" \ -d "$json_data" }🤖 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 `@setup_test_account.sh` around lines 76 - 82, The curl command in the api_post function lacks timeout settings, which can cause the script to hang indefinitely if the server is unresponsive or network issues occur. Add --connect-timeout and --max-time flags to the curl invocation in the api_post function to set reasonable timeout limits (for example, --connect-timeout 10 and --max-time 30), and apply the same timeout flags to all other curl commands throughout the script to prevent indefinite hangs.
186-213: ⚡ Quick winLogin request is made twice unnecessarily.
The function calls the login endpoint twice: once via
api_post(line 189) to check the response code, and again withcurl -D -(lines 202-205) to extract headers. This is inefficient and could trigger rate limiting.Consolidate into a single request that captures both headers and body:
♻️ Proposed fix
login_and_get_token() { log_info "Logging in to get auth token" - local response - response=$(api_post "/auth/login" "{\"email\": \"${EMAIL}\", \"password\": \"${PASSWORD}\"}") - local code - code=$(echo "$response" | grep -oP '(?<="code":)[0-9]+') - - if [ "$code" != "0" ]; then - local message - message=$(echo "$response" | grep -oP '(?<="message":")[^"]+') - log_error "Login failed: $message" - exit 1 - fi - - # Extract token from Authorization header - curl -D dumps headers to stdout - local auth_header - auth_header=$(curl -s -D - -X POST "${API_BASE}/auth/login" \ + local headers_file + headers_file=$(mktemp) + local response + response=$(curl -s -D "$headers_file" -X POST "${API_BASE}/auth/login" \ -H "Content-Type: application/json" \ - -d "{\"email\": \"${EMAIL}\", \"password\": \"${PASSWORD}\"}" \ - | grep -i "^authorization:" | tr -d '\r') + -d "{\"email\": \"${EMAIL}\", \"password\": \"${PASSWORD}\"}") + + local code + code=$(echo "$response" | sed -n 's/.*"code":\([0-9]*\).*/\1/p') + + if [ "$code" != "0" ]; then + local message + message=$(echo "$response" | sed -n 's/.*"message":"\([^"]*\)".*/\1/p') + log_error "Login failed: $message" + rm -f "$headers_file" + exit 1 + fi - AUTH_TOKEN="${auth_header#authorization: }" + AUTH_TOKEN=$(grep -i "^authorization:" "$headers_file" | tr -d '\r' | sed 's/^[Aa]uthorization: //') + rm -f "$headers_file" + if [ -z "$AUTH_TOKEN" ]; then log_error "Failed to extract auth token" exit 1 fi log_success "Logged in successfully, token obtained" }🤖 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 `@setup_test_account.sh` around lines 186 - 213, The login_and_get_token() function makes two separate API requests to the same endpoint, which is inefficient. Consolidate these into a single curl request that captures both response headers and body using the -D flag. Store the full response (headers and body) in a variable, then parse both the response code from the body and the Authorization header from the captured headers using grep to extract the values needed for the code check and AUTH_TOKEN assignment. Remove the redundant api_post call and the second curl invocation to have only one login request.
🤖 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 `@setup_test_account.sh`:
- Around line 32-34: The three API key variable assignments ZHIPU_AI_API_KEY,
SILICONFLOW_API_KEY, and TONGYI_QIANWEN_API_KEY contain hardcoded default values
that appear to be real credentials, which poses a security risk. Remove the
hardcoded fallback values from the parameter expansion syntax for all three
variables so they either use empty defaults or require explicit user-provided
environment variables. This will ensure the validate_config check can properly
detect and reject missing required API keys instead of silently accepting the
hardcoded defaults.
- Around line 171-173: The grep -oP regex flag is a GNU extension that fails on
macOS systems. Replace the grep -oP commands used to extract the code and
message variables with a portable JSON parsing approach. Use jq if available, or
sed/awk as fallback options. Specifically, the code variable extraction and
message variable extraction both use the non-portable grep -oP pattern that
needs to be replaced with a macOS-compatible alternative for reliable
cross-platform JSON parsing.
---
Nitpick comments:
In `@setup_test_account.sh`:
- Around line 129-139: The provider_exists function is defined but never
invoked, making it dead code that should be cleaned up. Since the add_provider
function already handles duplicate providers gracefully through its error
checking, you should remove the entire provider_exists function definition to
eliminate maintenance burden and keep the script focused on actual operations.
If in the future idempotency checks are needed before calling add_provider, this
function can be re-introduced and called appropriately, but for now it should be
deleted.
- Around line 76-82: The curl command in the api_post function lacks timeout
settings, which can cause the script to hang indefinitely if the server is
unresponsive or network issues occur. Add --connect-timeout and --max-time flags
to the curl invocation in the api_post function to set reasonable timeout limits
(for example, --connect-timeout 10 and --max-time 30), and apply the same
timeout flags to all other curl commands throughout the script to prevent
indefinite hangs.
- Around line 186-213: The login_and_get_token() function makes two separate API
requests to the same endpoint, which is inefficient. Consolidate these into a
single curl request that captures both response headers and body using the -D
flag. Store the full response (headers and body) in a variable, then parse both
the response code from the body and the Authorization header from the captured
headers using grep to extract the values needed for the code check and
AUTH_TOKEN assignment. Remove the redundant api_post call and the second curl
invocation to have only one login request.
🪄 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: 7de8fad6-e611-4bfa-a101-50d9c23acfa4
⛔ Files ignored due to path filters (3)
admin/client/uv.lockis excluded by!**/*.locksdk/python/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (33)
README.mdREADME_ar.mdREADME_fr.mdREADME_id.mdREADME_ja.mdREADME_ko.mdREADME_pt_br.mdREADME_tr.mdREADME_tzh.mdREADME_zh.mdadmin/client/README.mdadmin/client/pyproject.tomldocker/.envdocker/README.mddocker/entrypoint.shdocker/launch_backend_service.shdocs/administrator/admin/ragflow_cli.mddocs/administrator/configurations/configurations.mddocs/administrator/migration/database_schema_and_migration.mddocs/administrator/upgrade_ragflow.mdxdocs/develop/build_docker_image.mdxdocs/faq.mdxdocs/guides/dataset/configure_knowledge_base.mddocs/guides/manage_files.mddocs/quickstart.mdxhelm/values.yamlpyproject.tomlsdk/python/pyproject.tomlsetup_test_account.shtest/README.mdtools/scripts/README.mdtools/scripts/db_schema_sync.pytools/scripts/mysql_migration.py
| ZHIPU_AI_API_KEY="${ZHIPU_AI_API_KEY:-5c4e7cd09d0642c498d9754d2d1d29cc.uDJ0SEHTl5ybURO5}" | ||
| SILICONFLOW_API_KEY="${SILICONFLOW_API_KEY:-sk-cshvllbhctirrygmocywmdseuyyuwnskwjssmbstyfjsnocb}" | ||
| TONGYI_QIANWEN_API_KEY="${TONGYI_QIANWEN_API_KEY:-sk-bb0a831c9ac447d19ac85c6b8af1fc1b}" |
There was a problem hiding this comment.
Hardcoded API keys pose a security risk and should be removed.
The fallback default values contain what appear to be real API keys. Even if intended for testing, committing credentials to source control exposes them in git history and violates security best practices. The validate_config check on lines 146-157 will also never fail because these defaults always provide a value.
Remove the hardcoded defaults and require explicit environment variables:
🔒 Proposed fix
-ZHIPU_AI_API_KEY="${ZHIPU_AI_API_KEY:-5c4e7cd09d0642c498d9754d2d1d29cc.uDJ0SEHTl5ybURO5}"
-SILICONFLOW_API_KEY="${SILICONFLOW_API_KEY:-sk-cshvllbhctirrygmocywmdseuyyuwnskwjssmbstyfjsnocb}"
-TONGYI_QIANWEN_API_KEY="${TONGYI_QIANWEN_API_KEY:-sk-bb0a831c9ac447d19ac85c6b8af1fc1b}"
+ZHIPU_AI_API_KEY="${ZHIPU_AI_API_KEY:-}"
+SILICONFLOW_API_KEY="${SILICONFLOW_API_KEY:-}"
+TONGYI_QIANWEN_API_KEY="${TONGYI_QIANWEN_API_KEY:-}"🤖 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 `@setup_test_account.sh` around lines 32 - 34, The three API key variable
assignments ZHIPU_AI_API_KEY, SILICONFLOW_API_KEY, and TONGYI_QIANWEN_API_KEY
contain hardcoded default values that appear to be real credentials, which poses
a security risk. Remove the hardcoded fallback values from the parameter
expansion syntax for all three variables so they either use empty defaults or
require explicit user-provided environment variables. This will ensure the
validate_config check can properly detect and reject missing required API keys
instead of silently accepting the hardcoded defaults.
Source: Linters/SAST tools
| code=$(echo "$response" | grep -oP '(?<="code":)[0-9]+') | ||
| local message | ||
| message=$(echo "$response" | grep -oP '(?<="message":")[^"]+') |
There was a problem hiding this comment.
grep -oP is not portable and will fail on macOS.
The Perl regex flag (-P) is a GNU grep extension not available on macOS's BSD grep. This will cause script failures with "invalid option -- P" on macOS systems.
Consider using sed, awk, or installing jq for reliable JSON parsing:
♻️ Proposed fix using sed (portable)
- code=$(echo "$response" | grep -oP '(?<="code":)[0-9]+')
+ code=$(echo "$response" | sed -n 's/.*"code":\([0-9]*\).*/\1/p')
local message
- message=$(echo "$response" | grep -oP '(?<="message":")[^"]+')
+ message=$(echo "$response" | sed -n 's/.*"message":"\([^"]*\)".*/\1/p')Or better, use jq for robust JSON parsing:
code=$(echo "$response" | jq -r '.code')
message=$(echo "$response" | jq -r '.message')📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| code=$(echo "$response" | grep -oP '(?<="code":)[0-9]+') | |
| local message | |
| message=$(echo "$response" | grep -oP '(?<="message":")[^"]+') | |
| code=$(echo "$response" | sed -n 's/.*"code":\([0-9]*\).*/\1/p') | |
| local message | |
| message=$(echo "$response" | sed -n 's/.*"message":"\([^"]*\)".*/\1/p') |
🤖 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 `@setup_test_account.sh` around lines 171 - 173, The grep -oP regex flag is a
GNU extension that fails on macOS systems. Replace the grep -oP commands used to
extract the code and message variables with a portable JSON parsing approach.
Use jq if available, or sed/awk as fallback options. Specifically, the code
variable extraction and message variable extraction both use the non-portable
grep -oP pattern that needs to be replaced with a macOS-compatible alternative
for reliable cross-platform JSON parsing.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README_fr.md (1)
193-193: ⚡ Quick winAddress static analysis typographical issues on line 193.
The static analysis tool flagged three issues on line 193:
- Incorrect apostrophe character — French typography requires proper directional quotation marks or apostrophes.
- Missing space after period — Ensure proper spacing follows the period in the sentence.
- Word choice suggestion — Consider more precise terminology for the instruction.
These are minor formatting issues that should be corrected for consistency with French documentation standards.
🤖 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 `@README_fr.md` at line 193, Correct the three typographical issues on line 193 in the French documentation. First, replace the straight apostrophes in contractions like "l'édition" and "l'image" with proper French directional apostrophes (curly quotes) to match French typography standards. Second, verify that all periods in the sentence are followed by proper spacing between clauses. Third, review the word choice throughout the sentence and consider if more precise or idiomatic French terminology would better convey the instruction to users downloading the Docker image.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.
Nitpick comments:
In `@README_fr.md`:
- Line 193: Correct the three typographical issues on line 193 in the French
documentation. First, replace the straight apostrophes in contractions like
"l'édition" and "l'image" with proper French directional apostrophes (curly
quotes) to match French typography standards. Second, verify that all periods in
the sentence are followed by proper spacing between clauses. Third, review the
word choice throughout the sentence and consider if more precise or idiomatic
French terminology would better convey the instruction to users downloading the
Docker image.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6e3c0963-59b1-4641-acba-816653173778
⛔ Files ignored due to path filters (3)
admin/client/uv.lockis excluded by!**/*.locksdk/python/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (32)
README.mdREADME_ar.mdREADME_fr.mdREADME_id.mdREADME_ja.mdREADME_ko.mdREADME_pt_br.mdREADME_tr.mdREADME_tzh.mdREADME_zh.mdadmin/client/README.mdadmin/client/pyproject.tomldocker/.envdocker/README.mddocker/entrypoint.shdocker/launch_backend_service.shdocs/administrator/admin/ragflow_cli.mddocs/administrator/configurations/configurations.mddocs/administrator/migration/database_schema_and_migration.mddocs/administrator/upgrade_ragflow.mdxdocs/develop/build_docker_image.mdxdocs/faq.mdxdocs/guides/dataset/configure_knowledge_base.mddocs/guides/manage_files.mddocs/quickstart.mdxhelm/values.yamlpyproject.tomlsdk/python/pyproject.tomltest/README.mdtools/scripts/README.mdtools/scripts/db_schema_sync.pytools/scripts/mysql_migration.py
✅ Files skipped from review due to trivial changes (21)
- admin/client/README.md
- test/README.md
- docker/README.md
- README_id.md
- docs/guides/manage_files.md
- admin/client/pyproject.toml
- README_zh.md
- docs/administrator/migration/database_schema_and_migration.md
- docs/guides/dataset/configure_knowledge_base.md
- docs/quickstart.mdx
- README_tzh.md
- docs/administrator/upgrade_ragflow.mdx
- docs/administrator/configurations/configurations.md
- tools/scripts/README.md
- docker/entrypoint.sh
- docs/administrator/admin/ragflow_cli.md
- README_ko.md
- pyproject.toml
- tools/scripts/db_schema_sync.py
- docs/faq.mdx
- tools/scripts/mysql_migration.py
🚧 Files skipped from review as they are similar to previous changes (5)
- docker/launch_backend_service.sh
- README.md
- sdk/python/pyproject.toml
- docker/.env
- helm/values.yaml
What problem does this PR solve?
Type of change