fix(cd): keep alertmanager metrics test on controlled profile
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 59s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-02 20:31:34 +08:00
parent d30436573b
commit 0e7b7b704a
3 changed files with 34 additions and 0 deletions

View File

@@ -53129,6 +53129,25 @@ production browser smoke:
- 沒有使用 GitHub / gh / GitHub API / GitHub Actions。
- 沒有重啟主機,沒有 Docker / Nginx / K3s / DB / firewall restart沒有 workflow_dispatch沒有 DROP / TRUNCATE / restore / prune。
## 2026-07-02 — P0 CD #4439 Alertmanager metrics profile 修正
**完成內容**
- Gitea public run log 讀回 `#4439` 失敗點為 tests job 的 B5`AWOOOI_CD_TEST_PROFILE=full` 後進入 `BLOCKER b5_docker_socket_unavailable`,不是 `apps/api/tests/test_alertmanager_webhook_metrics.py` 單測失敗。
- 根因是 `apps/api/src/api/v1/webhooks.py` 已在 controlled-runtime allowlist但新增的 `apps/api/tests/test_alertmanager_webhook_metrics.py` 未列入 changed-file classifier導致 narrow Alertmanager metrics patch 誤落 full/B5。
- `.gitea/workflows/cd.yaml` 已補上 `apps/api/tests/test_alertmanager_webhook_metrics.py` controlled-runtime allowlist 與 focused pytest 清單;`ops/runner/test_cd_controlled_runtime_profile.py` 新增防回歸測試。
- 修正方向是 source classifier / focused verifier不是打開 Docker socket、恢復 legacy runner 或放寬 runner pressure gate。
**本地驗證結果**
- `DATABASE_URL=sqlite+aiosqlite:////tmp/awoooi-codex-api-test.db PYTHONPATH=apps/api python3.11 -m pytest -q apps/api/tests/test_alertmanager_webhook_metrics.py ops/runner/test_cd_controlled_runtime_profile.py -p no:cacheprovider``48 passed`
- `python3.11 -m py_compile apps/api/src/api/v1/webhooks.py apps/api/tests/test_alertmanager_webhook_metrics.py ops/runner/test_cd_controlled_runtime_profile.py`:通過。
- `python3.11 ops/runner/guard-gitea-runner-pressure.py --root .``GITEA_RUNNER_PRESSURE_GUARD_OK workflow_files=12 scheduled_workflows=4 auto_branch_events_on_110=0 generic_runner_labels=0`
- `git diff --check`:通過。
**仍維持**
- 沒有讀 secret / runner token / `.runner` 內容 / `.env` / raw sessions / SQLite / auth。
- 沒有使用 GitHub / gh / GitHub API / GitHub Actions。
- 沒有重啟主機,沒有 Docker / Nginx / K3s / DB / firewall restart沒有 workflow_dispatch沒有 DROP / TRUNCATE / restore / prune。
**下一步**
- amend / push 到 Gitea main 後讀回新的 CDdeploy 後驗證 reboot scorecard 與 priority work-order production API 已出現 `windows99_management_channel``windows99_remote_execution_channel_ready=false`