ci(P1 §10.2): 接夜间对拍 job 解冻对拍框架
新增 .gitea/workflows/parity-nightly.yml(cron 每日 02:00 CST + workflow_dispatch,跑 scripts/ci.sh 全量 seed+all+privilege 对拍 + 归档报告)。ParityCli 本就直连 JDBC 基线 vs 引擎 REST 逐行 diff、不一致退出码 2=「非0即阻断」内建;此前只 push 时跑,无提交的日子不跑→隐性漂移逃逸。夜间 job 补上。RowDiffTest 30/30 框架健康。§10.2 标 🟡:真正重拍刷新基线需 dev/CI 起引擎+真 DB 实跑(headless 跑不了),激活需 Gitea runner;--discover/--realprivilege 纳硬门前需真跑核实退出语义。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
53
.gitea/workflows/parity-nightly.yml
Normal file
53
.gitea/workflows/parity-nightly.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# eip4-platform 夜间对拍(Gitea Actions)。
|
||||||
|
#
|
||||||
|
# P1 修复(§10.2「逐行对拍框架已冻结」):push CI(ci.yml)只在有提交时跑对拍,无提交的日子不跑;
|
||||||
|
# 本工作流按 cron 每夜跑一次全量对拍——直连 JDBC(基线)vs 引擎 REST(被测)逐行逐列 diff,
|
||||||
|
# ParityCli 任一实体不一致即退出码 2 → 本 job 红(「本次 vs 基线 diff 非 0 即阻断」由 ParityCli 退出码内建)。
|
||||||
|
# 即便没人提交代码,也能捕获引擎/转换器/运行库的隐性漂移。
|
||||||
|
#
|
||||||
|
# 触发:每日 18:00 UTC(02:00 CST)+ 手动 workflow_dispatch。
|
||||||
|
# 前置条件:Gitea 实例需启用 Actions 且注册带 `ubuntu-latest` 标签的 act_runner;否则不会被调度。
|
||||||
|
#
|
||||||
|
# 注:--seed --all + --privilege 为硬门(本 job 跑这两项)。更广的 --discover(发现式抽样)/
|
||||||
|
# --realprivilege(客户库真实规则)退出语义偏探索性,暂未纳入硬门 job,见 §10.2 follow-up。
|
||||||
|
name: parity-nightly
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 18 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
nightly-parity:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:15
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: ci
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
|
ports: ["5433:5432"]
|
||||||
|
options: >-
|
||||||
|
--health-cmd "pg_isready -U ci" --health-interval 5s
|
||||||
|
--health-timeout 5s --health-retries 20
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: "21"
|
||||||
|
cache: maven
|
||||||
|
- name: 全量对拍(种子 21 实体 + C2 权限,逐行 diff,不一致即红)
|
||||||
|
env:
|
||||||
|
CI_PG_HOST: localhost
|
||||||
|
CI_PG_PORT: "5433"
|
||||||
|
CI_PG_USER: ci
|
||||||
|
CI_DB: eip4parity
|
||||||
|
CI_PORT: "8090"
|
||||||
|
run: bash scripts/ci.sh
|
||||||
|
- name: 归档对拍报告
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: parity-reports-${{ github.run_id }}
|
||||||
|
path: parity-reports/parity-*.json
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -203,7 +203,7 @@ EIP3(Vaadin / 老引擎)→ EIP4(amis 前端 + 保真层 + 转换器)迁
|
|||||||
- **✅【已完成 2026-06-24】可观测性近零**:原状=无 actuator/无健康端点/无 logback 配置/base 日志 DEBUG(prod 继承会刷屏)。**已做**:① platform-app 加 `spring-boot-starter-actuator`,`management` 只暴露 `health`(`probes.enabled` 开 liveness/readiness,`show-details/components: when-authorized` 匿名不泄露 db 等组件细节)——不上 Prometheus 全家桶,守中间件最小化;② `SecurityConfig.PUBLIC_PATHS` 加 `/actuator/health(/**)`,prod 链探针免认证可达;③ 新增 `logback-spring.xml`(控制台 + 50MB×14 天滚动文件,文件 appender 仅 dev/local/prod 启用、不污染单测);④ base `application.yml` 的 `com.dsasp`/`jdbc.core` 日志 DEBUG→INFO(prod 继承 INFO,dev 仍 DEBUG)。**验证**:真启动 dev profile(1.7s 起)curl `/actuator/health`=`200 {"status":"UP","groups":["liveness","readiness"]}`、`/health/readiness`=200 UP、`/health/liveness`=200 UP;SecurityProfileTest 3/3 + ArchitectureRulesTest 6/6 无回归。**残留**:prod JSON 结构化日志需 Spring Boot 3.4 内建或 logstash-encoder 依赖,留作后续(避免现在加依赖)。
|
- **✅【已完成 2026-06-24】可观测性近零**:原状=无 actuator/无健康端点/无 logback 配置/base 日志 DEBUG(prod 继承会刷屏)。**已做**:① platform-app 加 `spring-boot-starter-actuator`,`management` 只暴露 `health`(`probes.enabled` 开 liveness/readiness,`show-details/components: when-authorized` 匿名不泄露 db 等组件细节)——不上 Prometheus 全家桶,守中间件最小化;② `SecurityConfig.PUBLIC_PATHS` 加 `/actuator/health(/**)`,prod 链探针免认证可达;③ 新增 `logback-spring.xml`(控制台 + 50MB×14 天滚动文件,文件 appender 仅 dev/local/prod 启用、不污染单测);④ base `application.yml` 的 `com.dsasp`/`jdbc.core` 日志 DEBUG→INFO(prod 继承 INFO,dev 仍 DEBUG)。**验证**:真启动 dev profile(1.7s 起)curl `/actuator/health`=`200 {"status":"UP","groups":["liveness","readiness"]}`、`/health/readiness`=200 UP、`/health/liveness`=200 UP;SecurityProfileTest 3/3 + ArchitectureRulesTest 6/6 无回归。**残留**:prod JSON 结构化日志需 Spring Boot 3.4 内建或 logstash-encoder 依赖,留作后续(避免现在加依赖)。
|
||||||
|
|
||||||
**【验证体系】**
|
**【验证体系】**
|
||||||
- **逐行对拍框架已冻结 · high · M**:`parity-reports/` 全是 `20260611` 时间戳,对拍 main 末次提交 0611,11 天引擎/转换器改动从未重拍;`--discover`/`--realprivilege` 从不在 CI 跑。→ 接夜间 job + 基线锁定(本次 vs 上次 diff,非 0 即阻断)。
|
- **🟡【夜间 job 已接 2026-06-25,实跑待 runner+DB】逐行对拍框架已冻结**:原状=`parity-reports/` 全是 `20260611` 时间戳,11 天引擎/转换器改动从未重拍;push CI 只在有提交时跑对拍。**核实**:`ParityCli` 本就「直连 JDBC 基线 vs 引擎 REST 被测逐行 diff,任一不一致退出码 2」=「非 0 即阻断」是内建的(基线=实时 JDBC,非冻结文件);RowDiffTest 30/30 框架健康。**已做**:新增 `.gitea/workflows/parity-nightly.yml`(cron 每日 02:00 CST + 手动 dispatch,跑 `scripts/ci.sh` 全量 seed+all+privilege 对拍、归档报告)——无提交的日子也能捕获隐性漂移。**仍待(环境/基建门,非代码)**:① 真正重拍刷新基线需在 dev/CI 起引擎+真 DB 实跑(`bash scripts/ci.sh` 或 `ParityCli --seed --all`,DB 依赖,本会话 headless 跑不了);② 工作流激活需 Gitea 注册 act_runner(同 ci.yml);③ `--discover`/`--realprivilege` 更广范围退出语义偏探索性,纳入硬门前需真跑核实。
|
||||||
- **保真层引擎核心无单测 + 集成测试静默跳过 · high · L**:`FlowExcuteServiceImpl`(534 行服务流主干)无单测;`FlowExecuteLocalIT.java:60` `assumeTrue(false,"本地不可达,跳过")`=无 DB 的 CI 永远绿但什么都没测(反模式:把「未运行」伪装成「通过」)。→ CI 必须起 testcontainers,DB 不可达应**红**而非跳过。
|
- **保真层引擎核心无单测 + 集成测试静默跳过 · high · L**:`FlowExcuteServiceImpl`(534 行服务流主干)无单测;`FlowExecuteLocalIT.java:60` `assumeTrue(false,"本地不可达,跳过")`=无 DB 的 CI 永远绿但什么都没测(反模式:把「未运行」伪装成「通过」)。→ CI 必须起 testcontainers,DB 不可达应**红**而非跳过。
|
||||||
- **测试金字塔倒置 · high · L**:根目录 71 png + 前端 121 png 人工 dogfooding 是主回归手段;前端 vitest 仅 17 个;3 套 e2e config 故意不配 webServer(复用已跑环境)无法干净 CI 跑起。→ 关键闭环固化成自启动可进 CI 的稳定 e2e;扩 vitest 把「翻译正确但运行时哑火」下沉到单测。
|
- **测试金字塔倒置 · high · L**:根目录 71 png + 前端 121 png 人工 dogfooding 是主回归手段;前端 vitest 仅 17 个;3 套 e2e config 故意不配 webServer(复用已跑环境)无法干净 CI 跑起。→ 关键闭环固化成自启动可进 CI 的稳定 e2e;扩 vitest 把「翻译正确但运行时哑火」下沉到单测。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user