把两条路由门禁串进 npm run lint 并用 guardrail 锁住接线
Project CI / AI game creator shell Rust crates (push) Successful in 1m30s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m2s
Project CI / Backend tests (push) Successful in 3m55s
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Successful in 1m30s
Project CI / AI game creator shell Rust smoke (push) Successful in 2m2s
Project CI / Backend tests (push) Successful in 3m55s
Project CI / AI game creator shell Rust lane 2/2 (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
- 根因:check:nginx-spa-routes 与 check:pingora-route-parity 从来没有自动调用方(只有切换期聚合门禁 check:pingora-release-readiness 含 parity,而它不在 CI 里跑),所以红了一个月也没人看见 - package.json 的 lint 链在 check:maintenance-page 之后接入 check:nginx-spa-routes 与 check:pingora-route-parity,因此 check:repository-ci、CI 与 pre-push 都会执行 - check-production-ops 新增两条 guardrail:断言 package.json 的 lint 链里必须出现 npm run check:nginx-spa-routes / npm run check:pingora-route-parity,删任一条立刻变红(变异验证已做) - 文档:索引第五节与 Pingora 试点文档更新为「已接进 CI」;pitfalls 新增「为什么以前会漏:加新门禁先问它有没有自动调用方」 - 验证:npm run lint 全绿(含两条新门禁 + eslint + typecheck)、check:production-ops OK、encoding / doc-index / diff / prettier / eslint 通过
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
- **事实**:主站 SPA 路由要三处同批更新才自洽——① 前端路由源 `src/routing/activeAppPageRoutes.ts` 的 `STAGE_ROUTE_ENTRIES` 与 `src/routing/activeAppRoutes.tsx`;② Nginx 三份模板(`deploy/nginx/genarrative.conf`、`deploy/nginx/genarrative-dev-http.conf`、`deploy/container/nginx.conf`)里 `# BEGIN GENARRATIVE MAIN SPA ROUTES` 的精确 allowlist;③ Pingora 网关 `server-rs/crates/pingora-gateway/src/main.rs` 的 `MAIN_SPA_PATHS`(精确匹配、大小写不敏感、允许一个尾部斜杠)。
|
||||
- **代价**:2026-08-26 加 `/components`、`/design-system` 时只加了前端路由,两个门禁红了一个月(生产深链会 404 而不是 `index.html`);2026-09-28(`87e52860a`「游戏发行入口改为平台同源路径」)补了 nginx 侧的 5 条 `/games*`,却漏了 Pingora 侧,`check:pingora-route-parity` 继续红到 2026-09-29 才补齐(`MAIN_SPA_PATHS` 5→12 条)。
|
||||
- **判据/入口**:`npm run check:nginx-spa-routes`(12 条路由 × 3 份模板;断言未知路径只读真实静态文件并 404、大小写与一个尾部斜杠容忍)与 `npm run check:pingora-route-parity`(同一套路由 + `MAIN_SPA_PATHS` 逐条相等)。后者还读 `deploy/pingora/nginx-route-parity.matrix.json`:新增路由要同时补矩阵用例,矩阵里的 `docs` 片段会去 `docs/technical/【开发运维】Pingora独立网关试点-2026-06-11.md` 里找,文档没写同样判红。2026-09-29 起它还做**反向覆盖**:两份 Nginx 模板里出现的每条 `location` 都必须被矩阵某条用例声明(变异验证:往生产模板插一条无矩阵声明的 `location` 即报「没有被矩阵覆盖」),所以「模板改了、矩阵和 Pingora 没跟上」这类漂移不会再漏过。
|
||||
- **为什么以前会漏**:这两条门禁原来**没有任何自动调用方**(只有 `check:pingora-release-readiness` 这个切换期聚合门禁含有 parity,而它不在 CI 里跑),所以红了一个月也没人看见。2026-09-29 起两条都串进 `npm run lint`(⇒ `check:repository-ci` ⇒ CI 与 pre-push),并且 `check:production-ops` 新增两条 guardrail 断言 `package.json` 的 lint 链里必须出现 `npm run check:nginx-spa-routes` / `npm run check:pingora-route-parity`——把任一条拿掉,`check:production-ops` 立刻报「package.json 缺少 npm run …」。加新门禁时先问一句:它有没有自动调用方?
|
||||
- **别踩**:`/games/game_<32 位小写十六进制 id>/…` **不是** SPA 深链,而是发行网关路由(Nginx 代理到 `/api/game-distribution/releases/<gameId><asset>` 并 `proxy_set_header Cookie ""`),Pingora 侧对应 `RouteDecision::ReleaseGateway`(重写上游路径、清空 Cookie、不进 SPA fallback、不套 `limit_conn`/`limit_req`、不受维护闸拦截)。把它写进 `MAIN_SPA_PATHS`,或让 SPA 正则吞掉它,都会破坏在线游玩入口。`check:pingora-gateway-smoke` 已覆盖「重写到发行网关 + 清空 Cookie + 形状不符仍 404」;本机跑它要先设 `OPENSSL_CONF`(见本文件另一条),且改过网关源码后**不能**加 `--skip-build`(会拿旧二进制得到假 404)。
|
||||
|
||||
## AGC 版本探测必须显式提供隔离用户目录
|
||||
|
||||
Reference in New Issue
Block a user