Repository navigation
Document: github release for RAGFlow Go CLI - #16036
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)
📝 WalkthroughWalkthroughAdds two installer scripts ( ChangesCLI Install Scripts and Release Pipeline
Sequence Diagram(s)sequenceDiagram
participant User
participant install_sh as install.sh / install.ps1
participant GitHubAPI as GitHub Releases API
participant GitHubAssets as GitHub Release Assets
participant Filesystem as Local Filesystem
User->>install_sh: execute (optional version flag/env)
install_sh->>install_sh: detect platform and arch via uname / env
install_sh->>GitHubAPI: GET /releases/latest (if version=latest)
GitHubAPI-->>install_sh: tag_name
install_sh->>install_sh: compose asset filename and URLs
install_sh->>GitHubAssets: download binary to temp path
install_sh->>GitHubAssets: download SHA256SUMS to temp path
GitHubAssets-->>install_sh: binary and checksum files
install_sh->>install_sh: verify SHA-256 checksum
install_sh->>Filesystem: move binary to INSTALL_DIR, set permissions
install_sh->>Filesystem: update PATH if needed
install_sh->>Filesystem: run installed binary --version
install_sh-->>User: installation complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/INSTALL_SCRIPTS_README.md (1)
15-29: ⚡ Quick winDocument a non-piped install option alongside
curl | sh.Lines 15-29 currently show only direct pipe-to-shell execution. Please add a “download, inspect, then execute” alternative for stricter security environments.
🤖 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 @.github/INSTALL_SCRIPTS_README.md around lines 15 - 29, The INSTALL_SCRIPTS_README.md file currently documents only the direct curl piped execution pattern (curl | sh) in lines 15-29. Add an additional code example section that demonstrates the safer "download, inspect, then execute" approach. This alternative should show users how to first download the install.sh script to a local file, optionally review its contents, and then explicitly execute it. Include examples showing this pattern with and without the VERSION and INSTALL_DIR environment variables for consistency with the existing piped examples.
🤖 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 @.github/workflows/release.yml:
- Around line 139-146: The grep pattern checking for static linking on line 140
only matches "not a dynamic executable" but some toolchains report "statically
linked" instead, causing false failures. Update the grep command in the ldd
check to accept both possible outputs by modifying the pattern to match either
"not a dynamic executable" or "statically linked" using extended regex or basic
grep alternation syntax.
- Line 42: Replace floating version tags with immutable commit SHAs for GitHub
Actions to strengthen supply-chain integrity. In the
.github/workflows/release.yml file, update all uses statements that reference
floating tags (such as actions/setup-go@v5) to pin them to specific commit SHAs
instead. This ensures workflow actions cannot be unexpectedly modified and
aligns with strict pinning security policies.
In `@install.sh`:
- Line 108: The curl commands on line 108 and line 132 lack explicit timeout and
retry mechanisms, making them vulnerable to network hangs and transient failures
during installation. Add the --max-time option to specify a timeout limit for
each curl request and the --retry option to automatically retry failed requests
a configurable number of times. Apply these options to both curl invocations to
ensure resilient network fetches throughout the install script.
---
Nitpick comments:
In @.github/INSTALL_SCRIPTS_README.md:
- Around line 15-29: The INSTALL_SCRIPTS_README.md file currently documents only
the direct curl piped execution pattern (curl | sh) in lines 15-29. Add an
additional code example section that demonstrates the safer "download, inspect,
then execute" approach. This alternative should show users how to first download
the install.sh script to a local file, optionally review its contents, and then
explicitly execute it. Include examples showing this pattern with and without
the VERSION and INSTALL_DIR environment variables for consistency with the
existing piped examples.
🪄 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: ee9ddd8e-70ca-4488-b97f-9bfef6653b3b
📒 Files selected for processing (4)
.github/INSTALL_SCRIPTS_README.md.github/workflows/release.ymlinstall.ps1install.sh
|
|
||
| # https://github.com/actions/setup-go | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n 'uses:\s*[^@]+@(v[0-9]+|main|master|latest)$' .github/workflows/release.ymlRepository: infiniflow/ragflow
Length of output: 185
🏁 Script executed:
cat -n .github/workflows/release.yml | head -50Repository: infiniflow/ragflow
Length of output: 2088
🏁 Script executed:
cat -n .github/workflows/release.yml | sed -n '30,45p'Repository: infiniflow/ragflow
Length of output: 731
🏁 Script executed:
cat -n .github/workflows/release.yml | sed -n '150,165p'Repository: infiniflow/ragflow
Length of output: 640
🏁 Script executed:
# Check for any action-pinning policies or configurations in the repo
find . -type f \( -name "*.md" -o -name "*.yml" -o -name "*.yaml" -o -name ".github/**" \) | xargs grep -l "pin\|action\|security" 2>/dev/null | head -10Repository: infiniflow/ragflow
Length of output: 266
🏁 Script executed:
# Count total floating action tags in the entire release.yml file
wc -l .github/workflows/release.ymlRepository: infiniflow/ragflow
Length of output: 96
🏁 Script executed:
# Search for all uses statements in the release.yml file
rg -n 'uses:' .github/workflows/release.ymlRepository: infiniflow/ragflow
Length of output: 205
🏁 Script executed:
# Check for any GitHub security policy or action pinning requirements
cat SECURITY.md 2>/dev/null | head -50Repository: infiniflow/ragflow
Length of output: 1337
🏁 Script executed:
# Look for dependabot config that might define action pinning requirements
fd -e yml -e yaml | xargs grep -l "dependabot\|action\|pin" 2>/dev/null | head -5Repository: infiniflow/ragflow
Length of output: 175
Pin all GitHub Actions to immutable commit SHAs.
Lines 34, 42, and 157 use floating version tags, which weakens workflow supply-chain integrity and conflicts with strict pinning policies.
Proposed hardening patch
- name: Check out code
- uses: actions/checkout@v6
+ uses: actions/checkout@<pin-to-full-commit-sha>
- name: Set up Go
- uses: actions/setup-go@v5
+ uses: actions/setup-go@<pin-to-full-commit-sha>
- name: Upload Go CLI release assets
- uses: softprops/action-gh-release@v2
+ uses: softprops/action-gh-release@<pin-to-full-commit-sha>🧰 Tools
🪛 zizmor (1.25.2)
[error] 42-42: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 42-42: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): this step
(cache-poisoning)
🤖 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 @.github/workflows/release.yml at line 42, Replace floating version tags with
immutable commit SHAs for GitHub Actions to strengthen supply-chain integrity.
In the .github/workflows/release.yml file, update all uses statements that
reference floating tags (such as actions/setup-go@v5) to pin them to specific
commit SHAs instead. This ensures workflow actions cannot be unexpectedly
modified and aligns with strict pinning security policies.
Source: Linters/SAST tools
| if command -v ldd >/dev/null 2>&1; then | ||
| if ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 | grep -q "not a dynamic executable"; then | ||
| echo "Verified linux/amd64 CLI is not dynamically linked" | ||
| else | ||
| echo "::error::linux/amd64 CLI is dynamically linked" | ||
| ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" || true | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Accept both common ldd static-link outputs.
Line 140 currently only accepts not a dynamic executable. On some runners/toolchains, static binaries report statically linked, which would fail this step incorrectly.
Proposed compatibility patch
- if command -v ldd >/dev/null 2>&1; then
- if ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 | grep -q "not a dynamic executable"; then
+ if command -v ldd >/dev/null 2>&1; then
+ ldd_out="$(ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" 2>&1 || true)"
+ if printf '%s\n' "$ldd_out" | grep -Eq "not a dynamic executable|statically linked"; then
echo "Verified linux/amd64 CLI is not dynamically linked"
else
echo "::error::linux/amd64 CLI is dynamically linked"
- ldd "${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-linux-amd64" || true
+ printf '%s\n' "$ldd_out"
exit 1
fi
fi🤖 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 @.github/workflows/release.yml around lines 139 - 146, The grep pattern
checking for static linking on line 140 only matches "not a dynamic executable"
but some toolchains report "statically linked" instead, causing false failures.
Update the grep command in the ldd check to accept both possible outputs by
modifying the pattern to match either "not a dynamic executable" or "statically
linked" using extended regex or basic grep alternation syntax.
| fi | ||
|
|
||
| info "Fetching latest release information" | ||
| response="$(curl -sSfL "$RELEASE_API")" |
There was a problem hiding this comment.
Add timeout and retry policy to all curl fetches.
Line 108 and Line 132 perform critical network calls without explicit timeout/retry limits, which can cause hangs or brittle installs on transient failures.
Proposed resiliency patch
- response="$(curl -sSfL "$RELEASE_API")"
+ response="$(curl -sSfL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 30 "$RELEASE_API")"
...
- if ! curl -sSfL "$url" -o "$output"; then
+ if ! curl -sSfL --retry 3 --retry-delay 2 --connect-timeout 10 --max-time 300 "$url" -o "$output"; then
rm -f "$output"
error "Failed to download $url"
exit 1
fiAlso applies to: 132-132
🤖 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 `@install.sh` at line 108, The curl commands on line 108 and line 132 lack
explicit timeout and retry mechanisms, making them vulnerable to network hangs
and transient failures during installation. Add the --max-time option to specify
a timeout limit for each curl request and the --retry option to automatically
retry failed requests a configurable number of times. Apply these options to
both curl invocations to ensure resilient network fetches throughout the install
script.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16036 +/- ##
=======================================
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:
|
Added detailed installation instructions for RAGFlow CLI on Linux, macOS, and Windows, including usage examples for installation scripts.
### What problem does this PR solve? As title ### Type of change - [x] New Feature (non-breaking change which adds functionality) - [x] Documentation Update
What problem does this PR solve?
As title
Type of change