Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ Primary commands (see `Makefile`):
- `make test` Run Rust + Flutter test suites
- `make build` Release build (Rust `--release` + `flutter build web`)
- `make format` / `make lint` Auto‑format & static analysis

CI required checks (main):
- `Flutter Tests`, `Rust API Tests`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and consistency with how other checks are listed, it would be better to place Flutter Tests and Rust API Tests on separate lines.

Suggested change
- `Flutter Tests`, `Rust API Tests`
- `Flutter Tests`
- `Rust API Tests`

- `Rust API Clippy (blocking)` (`-D warnings`)
- `Rustfmt Check` (blocking)
- `Cargo Deny Check`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved clarity and consistency with README.md, consider adding a brief description of what Cargo Deny Check does.

Suggested change
- `Cargo Deny Check`
- `Cargo Deny Check` (security & license check)


SQLx offline policy:
- API jobs validate `.sqlx` strictly; on mismatch:
- Uploads `api-sqlx-diff` artifact (old/new cache + patch)
- Adds PR comment with first 80 lines of diff when PR originates from same repo
- Fails the job to force cache refresh commit

Local helpers:
- `make api-lint` runs strict SQLx check + clippy
- `make api-sqlx-prepare-local` migrates DB (DB_PORT=5433) and refreshes `.sqlx`
- `make hooks` configures pre-commit hook to run `make api-lint`
- `make docker-up` / `make docker-down` Run via Docker Compose
Backend only: `cargo test -p jive-core`; Flutter only: `cd jive-flutter && flutter test`.

Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ make api-lint
CI 策略:
- 严格检查 `.sqlx` 与查询是否一致;若不一致:
- 上传 `api-sqlx-diff` 工件(含新旧缓存与 diff patch)
- 在 PR 自动评论首 80 行 diff 预览,便于定位
- 失败退出,提示开发者提交更新后的 `.sqlx/`
- 在 PR 自动评论首 80 行 diff 预览(仓库内 PR;Fork PR 仅 artifact)
- 失败退出,提示提交更新后的 `.sqlx/`

该脚本会:
- 尝试用 Docker 启动本地 Postgres/Redis(如已安装)
Expand All @@ -198,6 +198,20 @@ docker compose -f jive-api/docker-compose.db.yml up -d postgres
cd jive-api && ./prepare-sqlx.sh && cd ..
git add jive-api/.sqlx
git commit -m "chore(sqlx): update offline cache"

### CI 必要检查(main 分支保护)

当前 main 的 Required checks:

- `Flutter Tests`
- `Rust API Tests`
- `Rust API Clippy (blocking)`(`-D warnings`)
- `Rustfmt Check`(阻塞)
- `Cargo Deny Check`(安全与许可)

注意:
- PR 首次不稳定阶段,可将 `Cargo Deny` 保持非阻塞,但推荐尽快修复并转为阻塞。
- 本地建议:启用 git hooks(一次性):`make hooks`,自动在提交前执行 `make api-lint`。
```
```

Expand Down