Skip to content

ci: align pipeline with local quality gate and add migration checks - #170

Merged
LUPENGHAN merged 2 commits into
1024XEngineer:mainfrom
LUPENGHAN:ci/improve
Aug 10, 2026
Merged

ci: align pipeline with local quality gate and add migration checks#170
LUPENGHAN merged 2 commits into
1024XEngineer:mainfrom
LUPENGHAN:ci/improve

Conversation

@LUPENGHAN

Copy link
Copy Markdown
Contributor

关联 Issue

Closes #169

改动

  • CI 单 job → 并行 backend / migrations / frontend
  • backend job 调用 scripts/check.sh(ruff check+format、mypy、uv lock --check、pytest、alembic heads),CI 与本地门禁统一
  • 新增带 Postgres service 的 migrations job:alembic upgrade headalembic downgrade base
  • 加 concurrency cancel-in-progress、per-job timeout、workflow_dispatch
  • 引入 pytest-cov,80% 覆盖率下限(置于 check.sh,不进默认 addopts,保证本地单文件测试不误报)

验证

  • 本地 scripts/check.sh 全绿:ruff check+format、mypy(11 文件无问题)、pytest 6 passed / 覆盖率 97.44%、alembic heads
  • 单文件 pytest tests/test_health.py 干净退出(exit 0)
  • 迁移为线性链 0001→0002 且均有 downgrade;Postgres 验证在 CI 执行(本地无 Docker)

本轮不含(见 Issue Out of Scope)

依赖漏洞扫描(pip-audit / npm audit)、Dependabot、actions SHA 固定、CI 路径过滤 —— 后续独立 Issue 跟进。

- Split the single CI job into parallel backend / migrations / frontend jobs
- Backend job now runs scripts/check.sh (ruff check + format, mypy, uv lock
  --check, pytest, alembic heads) so CI matches the local quality gate
- Add a Postgres-backed migrations job that runs `alembic upgrade head`
  then `alembic downgrade base` to validate the migration chain both ways
- Add concurrency cancel-in-progress, per-job timeout-minutes, and a
  workflow_dispatch trigger
- Add pytest-cov with an 80% coverage floor enforced via scripts/check.sh
  (kept out of default pytest addopts so ad-hoc local runs stay clean)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 10, 2026 3:50am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found in this review.

Validated locally: backend quality gate and frontend lint, formatting, typecheck, and Android export all pass.

Run only once a PR is ready for review, so stacked PRs that wait on an
unmerged parent do not consume CI minutes while parked as drafts.
Adds ready_for_review to the trigger types, without which converting a
draft would never start a run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@LUPENGHAN

Copy link
Copy Markdown
Contributor Author

新增一个 commit,

  1. 后一个 PR 依赖前一个未合并的 PR 时,后者先挂草稿、等前者合并后再转正式,草稿期间不该占 CI 配额。目前 Feature/backend schedule schema migration #168 / feat(reminder): add application ports #179 / feat(reminder): add local mock adapters #180 / feat(reminder): wire createAppServices and AppRuntime #181 四个草稿 PR 都在跑检查。
  2. 改动两处:on.pull_request.typesready_for_review;三个 job 各加一条 if: github.event_name != 'pull_request' || github.event.pull_request.draft == false(Actions 没有 workflow 级别的 if,只能重复)。
  3. types 必须一起加:pull_request 默认只触发 opened / synchronize / reopened,"标记为 Ready" 不在其中,只加 if 的话草稿转正式时 CI 不会启动。
  4. if 里先判 event_name:push 与 workflow_dispatch 事件下 github.event.pull_request 为空,不先短路会把这两种触发也一起跳过。
  5. 对正常 PR 无影响:本 PR 非草稿,本次三个 job 全部执行并通过。
  6. 草稿期间仍会留一条运行记录(触发层无法区分 PR 是否为草稿),但 job 全部 skipped,不分配 runner、不消耗配额、不报红叉。

@LUPENGHAN
LUPENGHAN merged commit 8d32751 into 1024XEngineer:main Aug 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

完善 CI:以 scripts/check.sh 为单一事实来源,补齐类型/格式/迁移/覆盖率检查

2 participants