chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# 三省六部 · Edict — 代码所有权定义
|
||||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
||||
#
|
||||
# 当 PR 涉及以下路径时,GitHub 会自动请求对应 owner 做 review。
|
||||
# 配合分支保护规则中的 "Require review from Code Owners",
|
||||
# 确保核心代码的变更必须经过维护者审批。
|
||||
|
||||
# ── 全局默认 ──────────────────────────────────────────
|
||||
# 未匹配其他规则的文件,默认由维护者 review
|
||||
* @cft0808
|
||||
|
||||
# ── 核心后端 ──────────────────────────────────────────
|
||||
/dashboard/server.py @cft0808
|
||||
/dashboard/court_discuss.py @cft0808
|
||||
/agents/ @cft0808
|
||||
/edict/backend/ @cft0808
|
||||
|
||||
# ── 数据与配置 ────────────────────────────────────────
|
||||
/data/ @cft0808
|
||||
requirements.txt @cft0808
|
||||
|
||||
# ── 脚本与自动化 ──────────────────────────────────────
|
||||
/scripts/ @cft0808
|
||||
install.sh @cft0808
|
||||
start.sh @cft0808
|
||||
|
||||
# ── 部署基础设施 ──────────────────────────────────────
|
||||
Dockerfile @cft0808
|
||||
docker-compose.yml @cft0808
|
||||
/docker/ @cft0808
|
||||
|
||||
# ── CI/CD 与仓库配置 ─────────────────────────────────
|
||||
/.github/ @cft0808
|
||||
|
||||
# ── 以下路径欢迎社区贡献者自主 review ────────────────
|
||||
# /docs/ 可由任何 Committer review
|
||||
# /examples/ 可由任何 Committer review
|
||||
# README*.md 可由任何 Committer review
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: 报告一个 Bug
|
||||
labels: bug, needs-triage
|
||||
---
|
||||
|
||||
## 环境
|
||||
- OpenClaw 版本:
|
||||
- 操作系统:
|
||||
- Python 版本:
|
||||
|
||||
## 问题描述
|
||||
|
||||
## 复现步骤
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
## 期望行为
|
||||
|
||||
## 实际行为
|
||||
|
||||
## 错误日志
|
||||
```
|
||||
粘贴日志
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 💬 社区讨论
|
||||
url: https://github.com/cft0808/edict/discussions
|
||||
about: 功能讨论、使用心得和一般性问题请移步 Discussions
|
||||
- name: 📖 文档
|
||||
url: https://github.com/cft0808/edict/blob/main/docs/getting-started.md
|
||||
about: 快速上手指南和常见问题
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: 提交功能建议
|
||||
labels: enhancement, needs-triage
|
||||
---
|
||||
|
||||
## 功能描述
|
||||
|
||||
## 使用场景
|
||||
|
||||
## 期望效果
|
||||
|
||||
## 其他信息
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Question
|
||||
about: 提问 / 使用咨询
|
||||
labels: question, needs-triage
|
||||
---
|
||||
|
||||
## 问题描述
|
||||
|
||||
<!-- 尽量清楚地描述你的问题 -->
|
||||
|
||||
## 已尝试的方案
|
||||
|
||||
<!-- 你已经尝试过哪些方法? -->
|
||||
|
||||
## 相关环境
|
||||
|
||||
- OpenClaw 版本:
|
||||
- 操作系统:
|
||||
- Python 版本:
|
||||
@@ -0,0 +1,43 @@
|
||||
# Dependabot 自动依赖更新配置
|
||||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
# Python (pip) 依赖
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "P2-nice-to-have"
|
||||
commit-message:
|
||||
prefix: "chore(deps):"
|
||||
open-pull-requests-limit: 5
|
||||
|
||||
# npm 依赖
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "P2-nice-to-have"
|
||||
commit-message:
|
||||
prefix: "chore(deps):"
|
||||
open-pull-requests-limit: 3
|
||||
|
||||
# GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "ci"
|
||||
commit-message:
|
||||
prefix: "ci(deps):"
|
||||
open-pull-requests-limit: 5
|
||||
@@ -0,0 +1,44 @@
|
||||
# PR 路径 → 自动标签映射
|
||||
# 配合 .github/workflows/auto-label.yml 使用
|
||||
|
||||
dashboard:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'dashboard/**'
|
||||
|
||||
agents:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'agents/**'
|
||||
|
||||
edict-backend:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'edict/backend/**'
|
||||
|
||||
edict-frontend:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'edict/frontend/**'
|
||||
|
||||
scripts:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'scripts/**'
|
||||
|
||||
docker:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'Dockerfile'
|
||||
- 'docker-compose.yml'
|
||||
- 'docker/**'
|
||||
|
||||
ci:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: '.github/**'
|
||||
|
||||
documentation:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- 'docs/**'
|
||||
- '*.md'
|
||||
- '!CHANGELOG.md'
|
||||
|
||||
tests:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: 'tests/**'
|
||||
@@ -0,0 +1,18 @@
|
||||
## 变更描述
|
||||
<!-- 简要描述此 PR 的目的和变更内容 -->
|
||||
|
||||
## 变更类型
|
||||
- [ ] Bug 修复
|
||||
- [ ] 新功能
|
||||
- [ ] 重构 / 代码优化
|
||||
- [ ] 文档更新
|
||||
- [ ] CI / 工程配置
|
||||
|
||||
## 检查清单
|
||||
- [ ] 代码已通过 `python3 -m py_compile` 检查
|
||||
- [ ] 已在本地测试运行 `run_loop.sh`
|
||||
- [ ] 涉及看板的变更已在浏览器中验证
|
||||
- [ ] 更新了相关文档(如适用)
|
||||
|
||||
## 关联 Issue
|
||||
<!-- 如 Fixes #123 -->
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Auto Label PRs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
label:
|
||||
# Fork PRs do not get a write-capable GITHUB_TOKEN under pull_request,
|
||||
# so actions/labeler would fail with "Resource not accessible by integration".
|
||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v6
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
sync-labels: false
|
||||
|
||||
size-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Label PR size
|
||||
uses: codelytv/pr-size-labeler@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
xs_label: "size/XS"
|
||||
xs_max_size: 10
|
||||
s_label: "size/S"
|
||||
s_max_size: 50
|
||||
m_label: "size/M"
|
||||
m_max_size: 200
|
||||
l_label: "size/L"
|
||||
l_max_size: 500
|
||||
xl_label: "size/XL"
|
||||
fail_if_xl: false
|
||||
@@ -0,0 +1,124 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Shell lint
|
||||
run: |
|
||||
find scripts -name '*.sh' | while read f; do
|
||||
echo "Checking $f"
|
||||
bash -n "$f"
|
||||
done
|
||||
|
||||
- name: Check install script
|
||||
run: bash -n install.sh
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: 'pip'
|
||||
|
||||
- name: Syntax check (py_compile)
|
||||
run: |
|
||||
find scripts dashboard -name '*.py' | while read f; do
|
||||
echo " checking $f"
|
||||
python3 -m py_compile "$f"
|
||||
done
|
||||
|
||||
- name: Install test dependencies
|
||||
run: pip install pytest
|
||||
|
||||
- name: Run tests
|
||||
run: pytest tests/ -v
|
||||
|
||||
docker-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
tags: edict:test
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
edict-backend:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
env:
|
||||
POSTGRES_DB: edict
|
||||
POSTGRES_USER: edict
|
||||
POSTGRES_PASSWORD: edict_dev_2024
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U edict"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
DATABASE_URL: postgresql+asyncpg://edict:edict_dev_2024@localhost:5432/edict
|
||||
REDIS_URL: redis://localhost:6379/0
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: edict/backend/requirements.txt
|
||||
|
||||
- name: Install backend dependencies
|
||||
run: pip install -r edict/backend/requirements.txt
|
||||
|
||||
- name: Syntax check (py_compile)
|
||||
run: |
|
||||
find edict/backend -name '*.py' | while read f; do
|
||||
echo " checking $f"
|
||||
python3 -m py_compile "$f"
|
||||
done
|
||||
|
||||
- name: Run Alembic migrations
|
||||
working-directory: edict
|
||||
run: python -m alembic upgrade head
|
||||
|
||||
- name: Verify FastAPI app imports
|
||||
working-directory: edict/backend
|
||||
run: |
|
||||
python -c "from app.main import app; print(f'FastAPI app loaded: {len(app.routes)} routes')"
|
||||
@@ -0,0 +1,61 @@
|
||||
name: Docker Publish (Multi-Arch)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker image tag (e.g. latest, v1.2.3)'
|
||||
required: false
|
||||
default: 'latest'
|
||||
|
||||
env:
|
||||
REGISTRY: docker.io
|
||||
IMAGE_NAME: cft0808/sansheng-demo
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU (multi-arch emulation)
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=raw,value=${{ github.event.inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
build-args: |
|
||||
BUILDPLATFORM=linux/amd64
|
||||
@@ -0,0 +1,48 @@
|
||||
name: Stale Issues & PRs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * 1' # 每周一 UTC 02:00
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v10
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Issue 配置
|
||||
days-before-stale: 60
|
||||
days-before-close: 30
|
||||
stale-issue-label: "stale"
|
||||
stale-issue-message: >
|
||||
📜 此 Issue 已超过 60 天没有活动。
|
||||
如果问题仍然存在,请回复更新状态;否则此 Issue 将在 30 天后自动关闭。
|
||||
感谢你的贡献!
|
||||
close-issue-message: >
|
||||
🏛️ 此 Issue 因长期无活动已自动关闭。
|
||||
如需重新讨论,欢迎随时重新打开或创建新 Issue。
|
||||
exempt-issue-labels: "P0-critical,P1-important,good first issue,help wanted,pinned"
|
||||
|
||||
# PR 配置
|
||||
days-before-pr-stale: 30
|
||||
days-before-pr-close: 14
|
||||
stale-pr-label: "stale"
|
||||
stale-pr-message: >
|
||||
📜 此 PR 已超过 30 天没有活动。
|
||||
如果仍计划继续,请更新代码或回复说明进度;否则将在 14 天后自动关闭。
|
||||
close-pr-message: >
|
||||
🏛️ 此 PR 因长期无活动已自动关闭。
|
||||
如果你想继续这项工作,欢迎重新打开。
|
||||
exempt-pr-labels: "P0-critical,P1-important,work-in-progress"
|
||||
|
||||
# 通用配置
|
||||
operations-per-run: 30
|
||||
ascending: true
|
||||
remove-stale-when-updated: true
|
||||
Reference in New Issue
Block a user