chore: import upstream snapshot with attribution
Ruff Format Check / Ruff Format & Lint (push) Failing after 7m39s
Deploy VitePress site to Pages / build (push) Failing after 9m11s
Deploy VitePress site to Pages / Deploy (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:32:26 +08:00
commit 1443d3fdf9
732 changed files with 196602 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
---
name: 提交一个BUG或者报错
about: 无法启动、无法回答、后端报错等等
title: 'Error: '
labels: ''
assignees: ''
---
1️⃣ 描述一下问题
<!-- 简单描述一下问题(如何产生的,什么情况下,进行什么操作的时候)-->
2️⃣ 报错日志
请运行以下命令,并提供部分相关日志:
```sh
# macOS / Linux
make logs
# Windows
docker logs --tail=100 api-dev
git rev-parse HEAD
```
<!-- 在下面粘贴日志的输出 -->
```
make logs 的输出:
```
3️⃣ 相关截图
#️⃣ 其他相关信息
✅ 如果问题与模型调用相关,请尝试切换到其他在线模型
@@ -0,0 +1,85 @@
---
name: 提交一个启动问题
about: Docker镜像拉取、服务启动、端口占用等相关问题
title: 'Startup: '
labels: startup
assignees: ''
---
## 1️⃣ 问题描述
请清晰描述您在使用 Docker 或启动服务时遇到的问题:
- 操作步骤:您执行了什么操作?
- 预期结果:您期望看到什么?
- 实际结果:实际发生了什么?
例如:"执行 `docker compose up -d` 后,api-dev 服务一直重启,查看日志显示无法连接到 Milvus"
## 2️⃣ 环境信息
请提供以下信息,帮助我们快速定位问题:
- 操作系统:Windows/macOS/Linux 及版本
- Docker 版本:执行 `docker --version` 输出
- Docker Compose 版本:执行 `docker compose --version` 输出
- 项目版本:执行 `git rev-parse HEAD` 输出
## 3️⃣ 启动命令
请提供您使用的完整启动命令:
```bash
# 例如
docker compose up -d
# 或
make up
```
## 4️⃣ 日志信息
请提供相关服务的日志(至少包含最近 100 行):
```bash
# 查看所有服务状态
docker ps
# 查看 api-dev 服务日志
docker logs --tail=100 api-dev
# 查看所有服务日志
docker compose logs --tail=100
```
将日志粘贴到下方(可根据问题相关性选择部分日志):
```
# api-dev 日志
...
# 其他相关服务日志
...
```
## 5️⃣ 配置文件(可选)
如果您修改过 `docker-compose.yml``.env` 文件,请提供相关配置片段(注意隐藏敏感信息):
```yaml
# docker-compose.yml 相关部分
...
# .env 相关部分
...
```
## 6️⃣ 其他信息
您还可以提供以下信息帮助我们解决问题:
- 是否已尝试过重启 Docker 服务?
- 是否已清理过 Docker 缓存或旧容器?
- 网络环境是否有特殊配置(如代理、防火墙等)?
- 是否有其他相关的错误提示或截图?
@@ -0,0 +1,11 @@
---
name: 提交一个提问
about: 关于项目使用的问题
title: 'Question: '
labels: question
assignees: ''
---
**问题描述**
@@ -0,0 +1,17 @@
---
name: 提交一个需求建议
about: 为这个项目提个建议
title: 'Feat: '
labels: enhancement
assignees: ''
---
**#⃣ 您的功能请求是否与某个问题相关?请描述。**
<!--清晰简明地描述问题所在。例如:当[...]时,我感觉不方便。-->
**#⃣ 描述您期望的解决方案**
<!--清晰简明地描述您希望看到的结果。-->
**#⃣ 附加背景信息**
<!--在此处添加关于该功能请求的其他背景信息或截图。-->
+28
View File
@@ -0,0 +1,28 @@
## 变更描述
> 🔥 务必注意,本项目不允许提交未经 “Human Review” 过的代码,不允许 Agent 未经人类审阅,直接提交 PR。不允许 Agent 直接提交回复。
>
> Code is Cheap, Show Me Your Thoughts!
简要描述这个 PR 做了什么
## 变更类型
- [ ] 新功能
- [ ] Bug 修复
- [ ] 文档更新
- [ ] 其他
## 测试
- [ ] 已在 Docker 环境测试
- [ ] 相关功能正常工作
**相关日志或者截图**
## 说明
(可选)有什么需要特别说明的吗?
---
💡 **提示**: 提交前可以运行 `make lint``make format` 检查代码规范
+29
View File
@@ -0,0 +1,29 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '40 9 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: '此 Issue 已标记为待关闭,若 14 天内无进一步活动将被自动关闭。'
close-issue-message: '因 14 天无响应,此 Issue 已自动关闭。如有需要,请重新打开。'
stale-issue-label: 'no-issue-activity'
only-labels: 'to-be-closed'
days-before-stale: 30
days-before-close: 14
+72
View File
@@ -0,0 +1,72 @@
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
#
name: Deploy VitePress site to Pages
on:
# 在 docs 相关变更推送时运行构建(任意分支)
push:
paths:
- 'docs/**'
- '.github/workflows/deploy.yml'
# 在面向 main 的 PR 中提前验证 docs 构建
pull_request:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/deploy.yml'
# 允许你从 Actions 选项卡手动运行此工作流程
workflow_dispatch:
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
concurrency:
group: pages
cancel-in-progress: false
jobs:
# 构建工作
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm install
working-directory: docs
- name: Build with VitePress
run: npm run build
working-directory: docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
# 部署工作
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
+49
View File
@@ -0,0 +1,49 @@
name: Publish yuxi-cli
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: packages/yuxi-cli
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.7.2"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --group test
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: packages/yuxi-cli/dist/
+157
View File
@@ -0,0 +1,157 @@
# GitHub Actions workflow for Ruff code formatting and linting
# 自动运行 Ruff 格式检查和修复
#
# 触发条件:
# 1. Push 到 main 分支时:自动格式化并提交
name: Ruff Format Check
on:
push:
branches:
- main
paths:
- 'backend/**/*.py'
- 'backend/pyproject.toml'
- 'Makefile'
- '.github/workflows/ruff.yml'
# 设置写入权限,允许自动提交格式化代码
permissions:
contents: write
jobs:
ruff:
name: Ruff Format & Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
# 1. 检出代码
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
# 2. 安装 uv(项目使用 uv 作为包管理器)
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.7.2"
# 3. 设置 Python 环境
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# 4. 安装 ruff 依赖(根据项目配置,ruff 在 dev 依赖组中)
- name: Install dependencies
run: |
uv sync --group dev
# 5. 运行 Ruff 格式检查(与项目的 make lint 命令一致)
- name: Run Ruff format check
id: ruff-format
run: |
set +e # 不立即退出失败
echo "Running ruff check (uv run python -m ruff check package)..."
uv run python -m ruff check package
ruff_check_result=$?
echo "Running ruff format diff check (uv run python -m ruff format package --diff)..."
uv run python -m ruff format package --diff
ruff_format_result=$?
echo "Running import sorting check (uv run python -m ruff check --select I package)..."
uv run python -m ruff check --select I package
ruff_import_result=$?
# 检查是否有任何错误
if [ $ruff_check_result -eq 0 ] && [ $ruff_format_result -eq 0 ] && [ $ruff_import_result -eq 0 ]; then
echo "ruff_format_passed=true" >> $GITHUB_OUTPUT
echo "✅ Ruff format check passed"
else
echo "ruff_format_passed=false" >> $GITHUB_OUTPUT
echo "❌ Ruff format check failed"
echo "::warning::Ruff format check found issues that should be addressed"
# 汇总错误信息
echo "## Ruff Format Issues Summary" > $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The following formatting issues were found:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# 运行 ruff check 以获取详细错误信息
echo "### Detailed Issues:" >> $GITHUB_STEP_SUMMARY
uv run python -m ruff check package --output-format=github >> $GITHUB_STEP_SUMMARY 2>&1 || true
echo "" >> $GITHUB_STEP_SUMMARY
echo "To fix these issues locally, run:" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "make format" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
fi
# 6. 针对不同事件类型执行不同操作
- name: Process Ruff Results
if: ${{ github.event_name == 'push' }}
env:
GIT_AUTHOR_NAME: "GitHub Actions"
GIT_AUTHOR_EMAIL: "actions@github.com"
GIT_COMMITTER_NAME: "GitHub Actions"
GIT_COMMITTER_EMAIL: "actions@github.com"
run: |
echo "Processing push event to main branch..."
# 检查当前是否有未提交的修改
if ! git diff --exit-code --quiet; then
echo "⚠️ Warning: There are uncommitted changes before formatting"
echo "The formatting process might need to handle this specially."
fi
# 先检查是否有格式问题
echo "Checking for formatting issues..."
set +e
uv run python -m ruff check package --quiet
has_ruff_issues=$?
set -e
if [ $has_ruff_issues -eq 0 ]; then
echo "✅ No formatting issues found"
exit 0
fi
echo "Formatting issues detected, running automatic fixes..."
# 自动应用格式修复(与项目的 make format 命令一致)
echo "Running uv run ruff format package"
uv run ruff format package
echo "Running uv run ruff check package --fix"
uv run ruff check package --fix
echo "Running uv run python -m ruff check --select I package --fix"
uv run python -m ruff check --select I package --fix
# 检查是否有格式变更
echo "Checking for formatting changes..."
if git diff --exit-code --quiet; then
echo "✅ No formatting changes needed"
else
echo "📝 Formatting changes detected"
echo "Changed files:"
git diff --name-only
# 添加所有变更并提交
git add .
git commit -m "style: auto-format with ruff [skip ci]"
echo "📤 Pushing formatting changes..."
git push
echo "✅ Formatting changes committed and pushed"
fi