Files
bid-doctor/.github/workflows/ci.yml
YANG JIANKUAN dd8c04001d
Some checks failed
ci / server (push) Has been cancelled
ci / web (push) Has been cancelled
ci / contract (push) Has been cancelled
feat(m6): 额度流水、套餐开通、数据删除、运营后台(M6 剩下的 P0)
决策 M6-1–M6-10(docs/architecture/m6-plan.md、docs/decisions.md)。

用户端:
- 额度与套餐页:本期额度、按功能分布、扣点规则、流水(逐条余额、关联项目和任务、导出 CSV)
- 开通 / 续费申请(对公转账,运营确认到账后开通),80% / 100% 提醒
- 专业版到期:整个账号只读、额度清零,到期前 30 / 7 / 0 天提醒(worker 每小时 billing_tick)
- 删除项目(彻底删除、销毁数据密钥),注销账号(企业名称 + 短信验证码)
- 通知铃铛、账号页

运营后台:
- 独立进程 bid-doctor ops(/ops/v1)和 apps/admin;用户名 + 密码 + TOTP + IP 白名单
- 开通申请(到账 / 开通 / 退回 / 发票)、企业查询和调额度、误报 / 漏报、失败任务、审计;不看业务内容
- 左侧菜单(标准 logo、可展开收起的分组、图标、待办数、环境标签)
- 运营人员角色只留结构:ops_admin.role、权限点、每个接口的检查点、菜单按权限过滤

数据库:迁移 0010(排队的订阅、申请单号、通知类型、billing_due)、0011(bd_ops 权限)、0012(运营角色)。
另修:取消解析 / 检查接口报 500;uuid7 进程内单调;data_key 销毁后不再新建;审计 None 存 SQL NULL。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 15:06:06 +08:00

84 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 合并的前提(架构 §8):类型检查、单元测试、租户隔离用例都通过;接口契约校验通过。
name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
server:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: bd_owner
POSTGRES_PASSWORD: dev-owner
POSTGRES_DB: bid_doctor
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U bd_owner" --health-interval 2s --health-retries 30
valkey:
image: valkey/valkey:8-alpine
ports: ["6379:6379"]
gotenberg: # 投标样例和招标样例都可能是 Word,转换要走 Gotenberg(SK2)
image: gotenberg/gotenberg:8
ports: ["3109:3000"]
env:
BD_TEST_PG: 127.0.0.1:5432
BD_TEST_VALKEY: redis://127.0.0.1:6379/1
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
version: "0.12.20"
- run: uv sync --frozen
- name: 数据库角色(直接跑部署用的脚本,两边不会漂移,SK2)
env:
PGHOST: 127.0.0.1
PGPASSWORD: dev-owner
POSTGRES_USER: bd_owner
POSTGRES_DB: bid_doctor
BD_APP_PASSWORD: dev-app
BD_OPS_PASSWORD: dev-ops
run: sh deploy/compose/postgres/init-roles.sh
- working-directory: server
run: |
../.venv/bin/ruff check src tests migrations
../.venv/bin/ruff format --check src tests migrations
../.venv/bin/pyright
../.venv/bin/lint-imports
../.venv/bin/pytest -q
web:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- name: 接口类型要和 openapi.yaml 一致
run: |
pnpm gen:api
git diff --exit-code packages/api-client/src/schema.d.ts
- run: pnpm typecheck
- run: pnpm build
contract:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: OpenAPI 完整校验(api-design §8)
run: npx --yes @redocly/cli@1.34.0 lint docs/architecture/openapi.yaml --skip-rule operation-4xx-response --skip-rule no-server-example.com