Skip to content

Commit e16c2df

Browse files
authored
Merge branch 'main' into feat/team-search-highlight
2 parents 765dcb1 + 1ed2fc2 commit e16c2df

5,188 files changed

Lines changed: 902710 additions & 159652 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/go-naming/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: go-naming
33
description: Go naming conventions and best practices. Use this skill when working with Go code and need to name packages, files, directories, structs, interfaces, functions, variables, or constants. Provides comprehensive naming guidelines following Go community standards.
44
---
55

6-
Strictly follow the naming conventions in [rules/named.md](rules/named.md)
6+
Strictly follow the naming conventions in [rules/named.md](../../rules/named.md)

.dockerignore

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,18 @@ docker/oceanbase/
2727
docker/seekdb/
2828

2929
# ── Go and C++ build outputs ────────────────────────────────────────────────
30-
internal/cpp/build/
31-
internal/cpp/cmake-build-release/
32-
internal/cpp/cmake-build-debug/
30+
internal/binding/cpp/build/
31+
internal/binding/cpp/cmake-build-release/
32+
internal/binding/cpp/cmake-build-debug/
3333
target/
3434

35-
# ── Downloaded dependency artifacts (mounted from infiniflow/ragflow_deps) ──
36-
chrome-linux64-*
37-
chromedriver-linux64-*
38-
tika-server-standard-*.jar
39-
tika-server-standard-*.jar.md5
40-
cl100k_base.tiktoken
41-
libssl*.deb
42-
uv-*.tar.gz
43-
huggingface.co/
44-
nltk_data/
45-
9b5ad71b2ce5302211f9c61530b329a4922fc6a4
35+
# ── ragflow_deps build context (built as a separate image, mounted ──
36+
# ── from infiniflow/ragflow_deps:latest by the main Dockerfile) ──
37+
# Excluding the entire directory keeps the main build context small
38+
# regardless of which deps files download_deps.py currently fetches.
39+
# The deps image is built from this directory with:
40+
# cd ragflow_deps && docker build -f Dockerfile -t infiniflow/ragflow_deps .
41+
ragflow_deps/
4642

4743
# ── IDE and editor config ──────────────────────────────────────────────────
4844
.idea/

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
*.sh text eol=lf
22
docker/entrypoint.sh text eol=lf executable
3+
4+
# Binary fixtures must be stored byte-for-byte. Mark them binary so git
5+
# never applies text/CRLF normalization, and so the pre-commit text fixers
6+
# (see tools/hooks/check_files.py) skip them. OLE2 .msg files in particular
7+
# were previously corrupted by the mixed-line-ending / end-of-file fixers.
8+
*.msg binary
9+

.github/codeql/codeql-config.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CodeQL configuration. The default CodeQL Analysis workflow (managed by
2+
# GitHub) reads this file when scanning the repository. We use it to
3+
# exclude files that the Go analysis cannot compile — the rest of the
4+
# repo compiles fine, but the CGO-based office_oxide bindings require
5+
# a native header (`office_oxide.h`) that isn't present in the CodeQL
6+
# runner image. Without this exclusion the entire Go analysis aborts
7+
# with `fatal error: office_oxide.h: No such file or directory`, which
8+
# means no Go alerts can be re-evaluated and alerts on these files
9+
# stay open indefinitely even after their root cause is fixed.
10+
#
11+
# The excluded files are MS Office document parsers. They are also
12+
# excluded from `go test` and `go build` in local development when
13+
# the office_oxide C library is not installed, so this exclusion
14+
# brings CodeQL in line with the rest of the toolchain.
15+
paths-ignore:
16+
- internal/ingestion/parser/doc_parser.go
17+
- internal/ingestion/parser/docx_parser.go
18+
- internal/ingestion/parser/ppt_parser.go
19+
- internal/ingestion/parser/pptx_parser.go
20+
- internal/ingestion/parser/xls_parser.go
21+
- internal/ingestion/parser/xlsx_parser.go
22+
# Generated / vendored — also break analysis without adding signal.
23+
- "**/testdata/**"
24+
- "**/node_modules/**"
25+
- "**/*.pb.go"

.github/pull_request_template.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
### What problem does this PR solve?
1+
### Summary
22

33
_Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._
4-
5-
### Type of change
6-
7-
- [ ] Bug Fix (non-breaking change which fixes an issue)
8-
- [ ] New Feature (non-breaking change which adds functionality)
9-
- [ ] Documentation Update
10-
- [ ] Refactoring
11-
- [ ] Performance Improvement
12-
- [ ] Other (please describe):

.github/workflows/release.yml

Lines changed: 213 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
push:
1010
tags:
1111
- "v*.*.*" # normal release
12+
- 'nightly' # mutable tag
1213

1314
permissions:
1415
contents: write
@@ -22,8 +23,12 @@ concurrency:
2223
cancel-in-progress: true
2324

2425
jobs:
25-
release:
26+
prepare:
2627
runs-on: [ "self-hosted", "ragflow-release" ]
28+
outputs:
29+
release_tag: ${{ steps.release.outputs.release_tag }}
30+
prerelease: ${{ steps.release.outputs.prerelease }}
31+
2732
steps:
2833
- name: Ensure workspace ownership
2934
run: echo "chown -R ${USER} ${GITHUB_WORKSPACE}" && sudo chown -R ${USER} ${GITHUB_WORKSPACE}
@@ -36,7 +41,15 @@ jobs:
3641
fetch-depth: 0
3742
fetch-tags: true
3843

39-
- name: Prepare release body
44+
# https://github.com/actions/setup-go
45+
- name: Set up Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version-file: go.mod
49+
cache: true
50+
51+
- name: Prepare release metadata
52+
id: release
4053
run: |
4154
if [[ ${GITHUB_EVENT_NAME} != "schedule" ]]; then
4255
RELEASE_TAG=${GITHUB_REF#refs/tags/}
@@ -53,8 +66,8 @@ jobs:
5366
fi
5467
echo "RELEASE_TAG=${RELEASE_TAG}" >> ${GITHUB_ENV}
5568
echo "PRERELEASE=${PRERELEASE}" >> ${GITHUB_ENV}
56-
RELEASE_DATETIME=$(date --rfc-3339=seconds)
57-
echo Release ${RELEASE_TAG} created from ${GITHUB_SHA} at ${RELEASE_DATETIME} > release_body.md
69+
echo "release_tag=${RELEASE_TAG}" >> ${GITHUB_OUTPUT}
70+
echo "prerelease=${PRERELEASE}" >> ${GITHUB_OUTPUT}
5871
5972
- name: Move the existing mutable tag
6073
# https://github.com/softprops/action-gh-release/issues/171
@@ -72,15 +85,205 @@ jobs:
7285
fi
7386
fi
7487
75-
- name: Create or overwrite a release
76-
# https://github.com/actions/upload-release-asset has been replaced by https://github.com/softprops/action-gh-release
88+
build_cli:
89+
needs: prepare
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
include:
94+
- goos: linux
95+
goarch: amd64
96+
runner: ubuntu-24.04
97+
- goos: linux
98+
goarch: arm64
99+
runner: ubuntu-24.04-arm
100+
- goos: darwin
101+
goarch: amd64
102+
runner: macos-15-intel
103+
- goos: darwin
104+
goarch: arm64
105+
runner: macos-14
106+
- goos: windows
107+
goarch: amd64
108+
runner: windows-latest
109+
output_ext: .exe
110+
- goos: windows
111+
goarch: arm64
112+
runner: windows-11-arm
113+
output_ext: .exe
114+
runs-on: ${{ matrix.runner }}
115+
env:
116+
CLI_NAME: ragflow-cli
117+
CLI_MAIN: ./cmd/ragflow-cli.go
118+
DIST_DIR: dist/cli
119+
RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
120+
121+
steps:
122+
# https://github.com/actions/checkout/blob/v6/README.md
123+
- name: Check out code
124+
uses: actions/checkout@v6
125+
with:
126+
token: ${{ secrets.GITHUB_TOKEN }}
127+
fetch-depth: 0
128+
fetch-tags: true
129+
130+
# https://github.com/actions/setup-go
131+
- name: Set up Go
132+
uses: actions/setup-go@v5
133+
with:
134+
go-version-file: go.mod
135+
cache: true
136+
137+
- name: Build Go CLI release binaries on non-Windows
138+
if: runner.os != 'Windows'
139+
shell: bash
140+
run: |
141+
set -euo pipefail
142+
143+
mkdir -p "${DIST_DIR}"
144+
145+
if [[ ! -e "${CLI_MAIN}" ]]; then
146+
echo "::error::Go CLI entry does not exist: ${CLI_MAIN}"
147+
echo "::error::Please update CLI_MAIN in .github/workflows/release.yml"
148+
exit 1
149+
fi
150+
151+
echo "Building Go CLI release binaries"
152+
echo "CLI name: ${CLI_NAME}"
153+
echo "CLI main: ${CLI_MAIN}"
154+
echo "Release tag: ${RELEASE_TAG}"
155+
echo "Commit: ${GITHUB_SHA}"
156+
157+
output="${DIST_DIR}/${CLI_NAME}-${RELEASE_TAG}-${{ matrix.goos }}-${{ matrix.goarch }}"
158+
echo "Building ${{ matrix.goos }}/${{ matrix.goarch }} -> ${output}"
159+
160+
CGO_ENABLED=0 \
161+
GOOS="${{ matrix.goos }}" \
162+
GOARCH="${{ matrix.goarch }}" \
163+
go build \
164+
-trimpath \
165+
-ldflags="-s -w -X main.version=${RELEASE_TAG} -X main.commit=${GITHUB_SHA}" \
166+
-o "${output}" \
167+
"${CLI_MAIN}"
168+
169+
chmod +x "${output}"
170+
171+
- name: Build Go CLI release binaries on Windows
172+
if: runner.os == 'Windows'
173+
shell: pwsh
174+
run: |
175+
New-Item -ItemType Directory -Force -Path $env:DIST_DIR | Out-Null
176+
177+
if (-not (Test-Path $env:CLI_MAIN)) {
178+
Write-Error "Go CLI entry does not exist: $env:CLI_MAIN"
179+
exit 1
180+
}
181+
182+
$output = Join-Path $env:DIST_DIR "${env:CLI_NAME}-${env:RELEASE_TAG}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.output_ext }}"
183+
Write-Host "Building ${{ matrix.goos }}/${{ matrix.goarch }} -> $output"
184+
185+
$env:CGO_ENABLED = "0"
186+
$env:GOOS = "${{ matrix.goos }}"
187+
$env:GOARCH = "${{ matrix.goarch }}"
188+
189+
go build `
190+
-trimpath `
191+
-ldflags="-s -w -X main.version=$env:RELEASE_TAG -X main.commit=$env:GITHUB_SHA" `
192+
-o "$output" `
193+
"$env:CLI_MAIN"
194+
195+
- name: Upload CLI artifact
196+
uses: actions/upload-artifact@v4
197+
with:
198+
name: cli-${{ matrix.goos }}-${{ matrix.goarch }}
199+
path: dist/cli/*
200+
if-no-files-found: error
201+
202+
publish_cli_assets:
203+
needs:
204+
- prepare
205+
- build_cli
206+
runs-on: [ "self-hosted", "ragflow-release" ]
207+
208+
steps:
209+
- name: Ensure workspace ownership
210+
run: echo "chown -R ${USER} ${GITHUB_WORKSPACE}" && sudo chown -R ${USER} ${GITHUB_WORKSPACE}
211+
212+
# https://github.com/actions/checkout/blob/v6/README.md
213+
- name: Check out code
214+
uses: actions/checkout@v6
215+
with:
216+
token: ${{ secrets.GITHUB_TOKEN }}
217+
fetch-depth: 0
218+
fetch-tags: true
219+
220+
- name: Download CLI artifacts
221+
uses: actions/download-artifact@v5
222+
with:
223+
pattern: cli-*
224+
path: dist/cli
225+
merge-multiple: true
226+
227+
- name: Prepare CLI release assets
228+
env:
229+
RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
230+
run: |
231+
set -euo pipefail
232+
233+
RELEASE_DATETIME=$(date --rfc-3339=seconds)
234+
echo Release ${RELEASE_TAG} created from ${GITHUB_SHA} at ${RELEASE_DATETIME} > release_body.md
235+
236+
cd dist/cli
237+
sha256sum * > SHA256SUMS
238+
cd -
239+
240+
echo "Generated CLI release assets:"
241+
ls -lh dist/cli
242+
243+
- name: Upload Go CLI release assets
77244
uses: softprops/action-gh-release@v2
78245
with:
79-
token: ${{ secrets.GITHUB_TOKEN }} # Use the secret as an environment variable
80-
prerelease: ${{ env.PRERELEASE }}
81-
tag_name: ${{ env.RELEASE_TAG }}
82-
# The body field does not support environment variable substitution directly.
246+
token: ${{ secrets.GITHUB_TOKEN }}
247+
prerelease: ${{ needs.prepare.outputs.prerelease }}
248+
tag_name: ${{ needs.prepare.outputs.release_tag }}
83249
body_path: release_body.md
250+
files: |
251+
dist/cli/*
252+
tools/scripts/install.sh
253+
tools/scripts/install.ps1
254+
255+
release:
256+
needs:
257+
- prepare
258+
- publish_cli_assets
259+
runs-on: [ "self-hosted", "ragflow-release" ]
260+
env:
261+
RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
262+
263+
steps:
264+
- name: Ensure workspace ownership
265+
run: echo "chown -R ${USER} ${GITHUB_WORKSPACE}" && sudo chown -R ${USER} ${GITHUB_WORKSPACE}
266+
267+
# https://github.com/actions/checkout/blob/v6/README.md
268+
- name: Check out code
269+
uses: actions/checkout@v6
270+
with:
271+
token: ${{ secrets.GITHUB_TOKEN }}
272+
fetch-depth: 0
273+
fetch-tags: true
274+
275+
- name: Build server binary (with native libs / ORT)
276+
# The production Dockerfile does `COPY bin bin`, so the binary must be
277+
# built (and ORT statically linked from the runner image at
278+
# /opt/ragflow-native-libs) before the docker build. This makes ORT's
279+
# presence in the released image an explicit, visible precondition
280+
# instead of relying on a pre-populated bin/ from elsewhere.
281+
env:
282+
CGO_ENABLED: '1'
283+
run: |
284+
set -euo pipefail
285+
./build.sh --cpp
286+
./build.sh --go
84287
85288
- name: Build and push image
86289
run: |

0 commit comments

Comments
 (0)