fix(staging): await public release identity
Staging Backend Quality Gate / validate (pull_request) Successful in 13m57s
Staging Backend Quality Gate / publish (pull_request) Has been skipped

This commit is contained in:
Jesse
2026-08-07 01:07:08 +08:00
parent 8dc61e3135
commit 3221b6a9a4
4 changed files with 75 additions and 27 deletions
+16
View File
@@ -2352,3 +2352,19 @@
- 相关记录:BUG-129、BUG-131、ERR-096、ERR-099
- 复发自:无
- 修复版本:待 frontend build bounded timeout 与 staging exact-SHA 验收
## BUG-137 | staging deploy 在公网 upstream 尚未收敛时用旧 SHA 立即判失败
- 状态:investigating
- 首次发现:2026-08-06
- 最近更新:2026-08-06
- 影响面:Gitea `Deploy staging` 最终公网验证、自动回滚;数据库迁移已成功,production 未受影响。
- 用户现象:exact-SHA gate `1514` 与 migration `1516` 成功后,deploy `1517``1518` 均启动目标 web/API image 并达到容器 healthy,却在约 3 秒后的公网 verification 返回非零,随后成功恢复旧 web/worker;公网和 `.state/deployed-revision` 均保持旧 SHA `e59f15d352787f3d05425ba8c459d092e9801a20`
- 触发条件:Compose 切换到目标容器后,旧 Caddy upstream 在短暂收敛窗口仍可让 `/login` 返回 200;脚本只轮询 `/login`,然后对公网 health SHA 和其余 predicate 仅检查一次,读取旧 SHA 时立即触发回滚。
- 根因:发布验证把“login 可达”和“公网已路由到 exact SHA”拆成了不对称检查;容器健康与代理 upstream 收敛不是同一时刻,单次 SHA 检查形成确定性 race。目标 image 隔离 probe 已确认注入的 `GITHUB_SHA` 为目标 SHA。
- 修复:在原 60 秒总预算内,每 5 秒原子重查 login、admin 未登录重定向、admin API/account 401、公网 health exact SHA、私有 API health 和 Swiss Ephemeris;仅当所有 predicate 同轮满足才成功。预算耗尽仍 fail closed 并只输出状态码、observed SHA、health 状态等脱敏摘要,不输出正文、env 或凭据。
- 验证:待合同测试、PR gate、新 reviewed exact-SHA push gate、immutable artifact、migration check 与真实 staging deploy 验收;完成前不得标记 resolved。
- 防复发:发布验证必须等待最终外部路由 identity,而不能把单个 readiness endpoint 当作代理收敛证明;所有重试必须有总上限,失败记录仅含非敏感 predicate 状态并保持自动回滚。
- 相关记录:BUG-129、BUG-136、ERR-099、ERR-100
- 复发自:无
- 修复版本:待 staging verification convergence gate 与 exact-SHA deploy 验收