Repository navigation
Go CLI: add support for windows, linux, macos - #16082
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 with no reviewable changes (1)
📝 WalkthroughWalkthroughThe release workflow is refactored to introduce a matrix-driven ChangesRelease Pipeline Refactor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)
374-377:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
latestDocker tag is pushed even for nightly/prerelease builds.The Docker push always tags as
latestregardless of whether this is a stable release or nightly build. For nightly builds, this means users pullinglatestget potentially unstable code.🔧 Proposed fix to push `latest` only for stable releases
- name: Build and push image run: | sudo docker login --username infiniflow --password-stdin <<< ${{ secrets.DOCKERHUB_TOKEN }} sudo docker build -t infiniflow/ragflow:${RELEASE_TAG} -f Dockerfile . - sudo docker tag infiniflow/ragflow:${RELEASE_TAG} infiniflow/ragflow:latest sudo docker push infiniflow/ragflow:${RELEASE_TAG} - sudo docker push infiniflow/ragflow:latest + if [[ "${RELEASE_TAG}" == v* ]]; then + sudo docker tag infiniflow/ragflow:${RELEASE_TAG} infiniflow/ragflow:latest + sudo docker push infiniflow/ragflow:latest + 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 374 - 377, The workflow unconditionally pushes the `latest` tag regardless of build type, which means nightly and prerelease builds overwrite the stable latest image. Add conditional logic before the `sudo docker push infiniflow/ragflow:latest` command to only execute it for stable releases. Determine if the build is stable by checking the RELEASE_TAG variable against nightly/prerelease patterns (typically containing keywords like "nightly", "pre", "alpha", "beta", or "-rc"). Only push the latest tag when the RELEASE_TAG represents a stable release version.
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
137-142: 💤 Low valueConsider setting
persist-credentials: falsefor improved security posture.The checkout action persists credentials by default, which can lead to token leakage through artifacts or caches. Since this job only needs read access and doesn't push changes, disabling credential persistence is safer.
🔒 Proposed fix
- name: Check out code uses: actions/checkout@v6 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 fetch-tags: true + persist-credentials: falseApply the same change to the checkout steps in
publish_cli_assets(line 310) andrelease(line 365) jobs.🤖 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 137 - 142, Add `persist-credentials: false` to the checkout action configuration in `.github/workflows/release.yml` to disable credential persistence and improve security. Apply this change to all three checkout steps: the one at lines 137-142 (main location shown in the diff), the one in the publish_cli_assets job at line 310, and the one in the release job at line 365. This prevents token leakage through artifacts or caches since these jobs only require read access and do not push changes.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.
Inline comments:
In @.github/workflows/release.yml:
- Around line 279-281: The CGO_CFLAGS and CGO_LDFLAGS environment variable
assignments in the Windows build configuration use backslash path separators
which can cause linker failures with Go's CGO toolchain. Replace the backslashes
with forward slashes in both the CGO_CFLAGS variable (which references
`\include\office_oxide_c`) and the CGO_LDFLAGS variable (which references
`\lib\office_oxide.lib`). This ensures the paths are properly formatted for the
linker regardless of the specific Windows toolchain being used.
---
Outside diff comments:
In @.github/workflows/release.yml:
- Around line 374-377: The workflow unconditionally pushes the `latest` tag
regardless of build type, which means nightly and prerelease builds overwrite
the stable latest image. Add conditional logic before the `sudo docker push
infiniflow/ragflow:latest` command to only execute it for stable releases.
Determine if the build is stable by checking the RELEASE_TAG variable against
nightly/prerelease patterns (typically containing keywords like "nightly",
"pre", "alpha", "beta", or "-rc"). Only push the latest tag when the RELEASE_TAG
represents a stable release version.
---
Nitpick comments:
In @.github/workflows/release.yml:
- Around line 137-142: Add `persist-credentials: false` to the checkout action
configuration in `.github/workflows/release.yml` to disable credential
persistence and improve security. Apply this change to all three checkout steps:
the one at lines 137-142 (main location shown in the diff), the one in the
publish_cli_assets job at line 310, and the one in the release job at line 365.
This prevents token leakage through artifacts or caches since these jobs only
require read access and do not push changes.
🪄 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: c6c53f6c-3a2e-4c0b-b2d1-9c5c31f9d33d
📒 Files selected for processing (1)
.github/workflows/release.yml
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
386-389: Migrate to PyPI trusted publishing instead ofPYPI_API_TOKEN.This workflow currently stores a long-lived PyPI credential. If trusted publishing is enabled on PyPI for both
ragflow-cliandragflow-sdk, the workflow should addid-token: writepermission and publish without--token. This requires configuring trusted publishing on each PyPI package page first.Current state uses:
uv publish --token ${{ secrets.PYPI_API_TOKEN }}- No
id-token: writepermission in the workflowTarget state (once PyPI trusted publishing is configured):
- Add
id-token: writeto permissions- Remove
--token ${{ secrets.PYPI_API_TOKEN }}from publish commandsSuggested workflow changes
permissions: contents: write + id-token: write actions: read checks: read statuses: read @@ - name: Build and push ragflow-cli if: startsWith(github.ref, 'refs/tags/v') run: | - cd admin/client && uv build && uv publish --token ${{ secrets.PYPI_API_TOKEN }} + cd admin/client && uv build && uv publishNote: Apply the same permission changes and publish command modifications to the
ragflow-sdkbuild job at line 384.🤖 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 386 - 389, The workflow currently uses a long-lived PYPI_API_TOKEN secret for publishing both ragflow-cli and ragflow-sdk packages. Replace this with PyPI trusted publishing for better security. Add id-token: write permission to the workflow permissions section at the top. Then for both the ragflow-cli build job (lines 386-389) and the ragflow-sdk build job (line 384), modify the uv publish commands by removing the --token ${{ secrets.PYPI_API_TOKEN }} flag so the commands rely on OIDC-based authentication instead. This assumes trusted publishing is already configured on the PyPI package pages for both ragflow-cli and ragflow-sdk.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 @.github/workflows/release.yml:
- Around line 386-389: The workflow currently uses a long-lived PYPI_API_TOKEN
secret for publishing both ragflow-cli and ragflow-sdk packages. Replace this
with PyPI trusted publishing for better security. Add id-token: write permission
to the workflow permissions section at the top. Then for both the ragflow-cli
build job (lines 386-389) and the ragflow-sdk build job (line 384), modify the
uv publish commands by removing the --token ${{ secrets.PYPI_API_TOKEN }} flag
so the commands rely on OIDC-based authentication instead. This assumes trusted
publishing is already configured on the PyPI package pages for both ragflow-cli
and ragflow-sdk.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f679049f-ae95-48ac-8324-c04d49830db5
📒 Files selected for processing (1)
.github/workflows/release.yml
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16082 +/- ##
=======================================
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:
|
myf-bee
left a comment
There was a problem hiding this comment.
There are no major issues
What problem does this PR solve?
As title
Type of change